How to tesselate edges

Good afternoon,

I'd like to tesselate a TopoDS_Edge with no associated TopoDS_Face, I tried to use BRepMesh_FastDiscret, as following:

BRepMesh_FastDiscret *myMesh =
new BRepMesh_FastDiscret(deflection, *Topo_Edge, aBox, angle, Standard_True, Standard_True);
if (myMesh == NULL)
{
PRINT_ERROR("Can't get tesselatation for this curve.\n");
return CUBIT_FAILURE;
}

I did get a non-Null pointer for myMesh, but when I print it out, it doesn't have vertices and edges:

vertices = { = {myData1 = 0x0, myData2 = 0x0, isDouble = 0, mySaturated = 0, myNbBuckets = 1, mySize = 0}, }, edges = { = {myData1 = 0x0, myData2 = 0x0, isDouble = 0, mySaturated = 0, myNbBuckets = 1, mySize = 0}, },

so query of num_points = myMesh->NbVertices(); crashes.

How do I get a correct tesselation of an Edge?

Thanks!

Jane

Stephane Routelous's picture

you can use one of the GCPnts_* classes (TangentialDeflection may be the best) with a BRepAdaptor_Curve created from your edge

Stephane

Jane Hu's picture

Thanks, Stephane. I'll try it out and let you know.

Jane