PDA

View Full Version : generate surface out of point set


barbis
3rd February 2012, 13:57
Hello!

i have made a module, which reads a set of point coordinates like this:

for (int j=0; j<nPoints; j++)
{
McVec3f p;
p[0] = field->evalReg(j+2,0,0);
p[1] = field->evalReg(j+2,1,0);
p[2] = field->evalReg(j+2,2,0);
surface->points[j] = p;

}

What i am trying to do is to create a surface from these points but i don't
have any information about the triangles, which seems to be obligatory in the "Readtrimesh" example in mypackage.

How would it be possible to create a surface just of a set of points?
Should i read them as hxcluster or vertexset instead?

Thanks!
toni

forum_admin
13th February 2012, 15:41
Hi Toni,

To generate surface, you do need to load the data as vertexset or hxcluster.

Once the data is loaded, you can try a few modules under "Surface Transforms" to build your surface, such as Convex Hull, Delaunay Triangularization, or Point Wrap Triangularization, to build a surface out of the point cloud.

Let me know how it goes.

Best,
-Shawn

barbis
14th February 2012, 09:02
Dear Shawn,

very much thanks for your answer. I did find in hxsurfacetools folder a header file called Triangulator, which i thought could do the job. But i was not able to make it work because i had no idea about the input variables:

void triangulate(int x, int y, int nMat, int* label,
int* prob, int* prob2, int tableInv[8], McMutex *mutex=NULL);

/** General triangulation method. Same as before, with additional
parameters for referencing a smooth material. */
void triangulate(int x, int y, int nMat, int* label, int const *smoothMatLbl,
int* prob, int* prob2, int tableInv[8],
int const smoothMat, int const *pSmooth, int const *qSmooth,
McMutex *mutex=NULL);

How does one proceed here? I don't know the meaning of any of those inputs... I got around this problem by doing the triangulation in matlab and but it would be nice to know how does one do this in amira!


thanks.

p.s. i did not find any info about point wrap triangulation... ??