David Derwin

davidderwin

About Me

Expertise
Generalist
Location
United States

Connect

Recent Forum Posts

VEX : using FOR wihtout errors but doesn't work Oct. 22, 2018, 3:10 p.m.

You're very close! Your condition in the for loop is currently i==stop, meaning the loop will run as long as i==stop returns true. When the loop starts, i=0 which is not equal to stop (in your example stop would be equal to 2 and in all cases would be greater than 0). I guess it technically isn't incorrect code is why it doesn't error out but it doesn't run as expected.

If you change your for condition to:

for(int i=0; i<stop; i++)


it will work as expected.


Full code only changing that one line:

int stop = @numprim;

for(int i=0; i<stop; i++)
    {
    vector pos = prim(0, "P", i);
    push(f[]@zpos, pos.z);
    }

edges from knife tool July 2, 2018, 3:55 p.m.

One way to do this would be:

1. make a group of all points
2. do knife operation
3. do a group combine set to group type “Points” to make a new point group, set to “Equals All But” the point group prior to knife (from step 1) (this will give you a point group with only the new points created from the knife operation).
4. do a group promote from points to edges on the group from step 3 (making sure to turn ON the toggle to “Include Only Elements Entirely Contained in Original Group”).

This will give you an edge group with just the newly created edge from the knife.

If you have a lot of knife operations and need separate groups for each new knife edge this might not be the most elegant solution but you can repeat the process as many times as needed or can insert as many knife operations after step 2 and get a single edge group from all knife operations.

list of vertices July 2, 2018, 10:51 a.m.

Try this in a primitive wrangle:

i@primvtx = primvertices(0, @primnum);


It will return the list of vertices on each primitive as an array attribute.