arlo

arlo

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Sort and Reverse using VEX April 19, 2020, 10:33 a.m.

ok, thank you again for the code and the explanation!

Sort and Reverse using VEX April 19, 2020, 2:16 a.m.

thank you

really appreciated
a good point for studying and improving my vex coding
So you suggest to simplify the whole process, removing the primitive and creating a new one. I like it

I only have one question: you create two arrays, points and vertex, but at the end you use only one array, using this expression:
addprim(prim_num, geohandle, type, points, vertices)

this is your code:
addprim(primNumber, 0, “polyline”, points, points);

now I tried to change the last line of the code, adding the vertex array:
addprim(primNumber, 0, “polyline”, points, vertex);

but I get exactly the same results. I also checked on the Geometry Spreadsheet. Absolutely the same points, primitives and vertices
But the two arrays are slightly different, at the beginning and at the end
points {127, 24, 108, 30, 34, …, 107, 68, 92, 75, 126}
vertex {127, 0, 24, 108, 30, 34 …, 25, 107, 68, 92, 75}

Is it an expected behaviour?

best

Sort and Reverse using VEX April 17, 2020, 7:23 a.m.

Hi all!

I've been practicing more and more in the use of this wonderful tool that is VEX, and I was wondering if you could give me some hint in finding the best direction to solve this problem:

as you can see on the hipfile, I was able to extend the first and last point of a curve, creating two points and attaching them to the curve. To obtain the right connection of the vertex, the only solution that I could find was to reverse the order of the point using a Sort and a Reverse SOP, and create the second point with the same code and a Pointwrangle

It works, even if I resample the curve the first and last points are exended in the right way, but I'm looking for a more straightforward solution using only VEX: is there a quick way to sort and reverse using VEX, rather then using the two SOPs? Is the reverse solution the right way to solve this problem (ie when you need to attach two points to the first and last point of a polygonal curve), or you might suggets a simpler solution?