[vtkusers] how to get vertex coordinates in stl file

Vladimir Lazunin lazunin.v.aa at m.titech.ac.jp
Mon Jun 18 00:49:42 EDT 2007


As far as I remember, there could be an issue with GetPoint(), that it  
always returns a pointer to the same place, but the content of that place  
is different each time, depending on the point id. Try to re-arrange  your  
code like this and see if it helps:

dpPointA = Points->GetPoint(a);
x1=dpPointA[0];
y1=dpPointA[1];
z1=dpPointA[2];
dpPointB = Points->GetPoint(b);
x2=dpPointB[0];
y2=dpPointB[1];
z2=dpPointB[2];
....


>
>    dpPointA = Points->GetPoint(a);
>    dpPointB = Points->GetPoint(b);
>    dpPointC = Points->GetPoint(c);
>    double x1,y1,z1,x2,y2,z2,x3,y3,z3;
>    x1=dpPointA[0];
>    y1=dpPointA[1];
>    z1=dpPointA[2];
>    x2=dpPointB[0];
>    y2=dpPointB[1];
>    z2=dpPointB[2];
>    x3=dpPointC[0];
>    y3=dpPointC[1];
>    z3=dpPointC[2];
> }
>  ===================================================================
>  I find dpPointA , dpPointB and dpPointC point to the same address, so
> I only get one point coordinate of one triangle facet ,Why?



More information about the vtkusers mailing list