I was going through the tutorial by Manuel C. Merkle on Creating Geometry with VEX.
I hope someone might be able to shed light on working with VEX in the way I wish to utilize it.
In doing the tutorial I realized it was getting close to showing how to do something I've been wanting to work on.
In one of the first examples he creates a simple primitive from “coded” points.
What I've been wanting to is something similar with the exception of mixing part coded points ( user defined ) combined with existing geometry points.
Below is the code that has been slightly modified ( the 2 point functions replacing the two addpoint functions that is in the video:
int newpoint0 = addpoint( 0, { 10, 8, 0 }); int newpoint1 = addpoint( 0, { 14, 8, 0 }); int newpoint2 = point( 0, "P", 9); int newpoint3 = point( 0, "P", 5); int prim0 = addprim(0, "poly" ); int vertex0 = addvertex( 0, prim0, newpoint0 ); int vertex1 = addvertex( 0, prim0, newpoint1 ); int vertex2 = addvertex( 0, prim0, newpoint2 ); int vertex3 = addvertex( 0, prim0, newpoint3 );
However, this code does not work completely.
I don't get errors in the code but only the addpoint functions work as expected.
The “point numbers” references( 9 on one line and the 5 on the next ) don't work as expected ( they don't correspond to the point numbers from the group node. )
Also, since the example in the help files shows the function returning a vector I tried the following thinking there are 3 values being x,y and z and trying to get the x value. But this doesn't work either.
vector pre_newpoint2 = point( 0, "P", 9); vector pre_newpoint3 = point( 0, "P", 5); int newpoint2 = pre_newpoint2[0]; int newpoint3 = pre_newpoint3[0];
I've also tried the getattribute function as well with similar undesired results. ( I'm wanting to make a copy of those points from the original geometry so that I make a second geometry object where some of the points of that second geometry still follow/correspond to the original geometry points, but that is another topic. I mention this because there seems to be a getattr function as well.
Any help on this is much appreciated.