Hi Igor,
Thanks a lot for your reply.
The solution you suggested is useful only for cones and cylinders. But my interest is quite wide. ie: I am getting problem with faces of booleaned objects also. You know, such faces are highly irregular (with no centre and/or radius etc ...). Can you suggest how to overcome this problem (with faces of boolean objects).
Meantime, I changed the previous code slightly, as follows.
Step 1; Extract each face as follows--- =============================
for (ExpFace.Init (myShape,TopAbs_FACE); ExpFace.More(); ExpFace.Next()) {
TopoDS_Face TopologicalFace = TopoDS::Face (ExpFace.Current());
const Handle(Geom_Surface)& S = BRep_Tool::Surface(TopologicalFace,l);
if (S.IsNull()) continue;
TopologicalFace.Orientation (TopAbs_FORWARD) ;
AddFaceDisplay(TopologicalFace, displaydata); }
Step 2:
The AddFaceDisplay function adds the display of the face as line segments in the list displaydata. The code that computes the display data is as follows ===============================================
AddFaceDisplay(TopoDS_Face& F, MyDispData displaydata) {
GeomAbs_IsoType type;
Standard_Real param, start, end;
BRepAdaptor_Surface bas(F,Standard_True);
GeomAdaptor_Surface S = bas.Surface();
Handle(GeomAdaptor_HSurface) HS = new GeomAdaptor_HSurface(S);
Adaptor3d_IsoCurve C(HS);
DBRep_IsoBuilder IsoBuild(F, 1.0e100, 10) ;
DBRep_Face *DBFace = new DBRep_Face(F, IsoBuild.NbDomains());
Standard_Integer lastIso = IsoBuild.LoadIsos(DBFace) ; // modified to give number of Iso curves
for(int i=0; iGetIso(i+1, type, param, start, end);
if (type == GeomAbs_IsoU)
{
DrawIsoCurveOn(C,GeomAbs_IsoU,param,start,end, displaydata);
}
else // (type == GeomAbs_IsoV)
{
DrawIsoCurveOn(C,GeomAbs_IsoV,param,start,end, displaydata);
}
} }
The DBRep_IsoBuilder and DBRep_Face are taken from Draw pakacge.
This changes solves the problem with cone and cylinder top/bottom surfaces. But the faces of booleaned objects are still a problem.
However, when we displayed the triangular facets of the objects and primitives it came out fine. Problem is with generation and/or display of Iso curves only.
Kindly let me know, if we are following the right path, and what is lacking where .
Thanks in advance..
Prasad.