I wasn’t aware of those functions, that’s cool! This seems to work quite nicely from a quick test… granted this is a curve with 4/5 points 🙂 Would be keen to see if this does what you need, @mattiasmalmer, and any performance issues you run into!
prim wrangle: “` function void insertvertex(int geohandle; int prim_num; int insertion_index; int point_num) { int points[] = primpoints(0, prim_num); insert(points, insertion_index, point_num); foreach (int i; int point; points) { setvertexpoint(0, prim_num, i, point); } }
vector new_pos = point(1, “P”, 0); int new_pt = addpoint(0, new_pos);
int insertion_index = chi(“insertion_index”); insertvertex(0, i@primnum, insertion_index, new_pt); “`
I made it into a `insertvertex` function if you feel like reusing this via a custom vex library 🙂 The last few lines is just me querying a point position from the wrangle’s second input and choosing which index to insert it on~
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20241402/09/24/insert_vertex.gif