
Tue, 11/11/2008 - 23:08
When the BRep_Tool::Triangulation to discretize the surface, the Poly_Triangulation handle could be gotten. After the we can use the following codes to obtain the vertex of triangle meshes:
-------------------------------------
for (int j = 1; j NbTriangles(); j++)// triangulation is the Handle(Poly_Triangulation)
{
Poly_Triangle triangle = (triangulation -> Triangles())(j);
for (int k = 1; k
{
uv = (triangulation->UVNodes())(triangle(k));
prop.SetParameters(uv.X(), uv.Y());
gp_Pnt pt = prop.Value();
m_arrPts.Add(pt); // m_arrPts is the gp_Pnt array;
}
-------------------------------------
In this way, We can find that there are many redundant points in m_arrPts. Maybe you can say that pt will be added into m_arrPts if there is no element in m_arrPts whose coordinats is unequal to that of pt. I am wondering if there is another fast API in OCC utilized to carry out that???
Thanks a lot.
Tue, 11/11/2008 - 23:16
Sorry to bother. Poly_Triangulation::Nodes() can be used to handle that.