jianbaoxia
CAD master
I try to get the hatch of shape follow Quaoar's advice, however, when I instance the class "DBRep_IsoBuilder", I get a so inexplicable bug.
Let me give my simple demo first:
The OCCT version I use is 7.6.0.
What the demo do is just build a TopoDS_Face, and then get a DBRep_IsoBuilder instance.
First question: when I debug the demo, I get a exception from "Draw_Interpretor.cxx". I didn't call it, I thought this may because the constructor of "DBRep_IsoBuilder" call it. As show below:
Second question: This is what make me feel unable to understand!!!
I annotation the code:
However, I get the same exception. The demo just only build a TopoDS_Face now. And after I call the constructor of "DBRep_IsoBuilder" and annotation it, I get the same bug, the code of build TopoDS_Face could not work.
Why? I'm so puzzle.
Let me give my simple demo first:
Code:
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <gp_Pnt.hxx>
#include <TopoDS_Edge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <TopoDS_Wire.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <TopoDS_Face.hxx>
#include <DBRep_IsoBuilder.hxx>
int main(int argc, char** argv)
{
// build a topo_face
Standard_Real theXmin = 0.0;
Standard_Real theXmax = 2.0;
Standard_Real theZmin = 0.0;
Standard_Real theZmax = 2.0;
Standard_Real theY = 0.0;
gp_Pnt p1(theXmin, theY, theZmin);
gp_Pnt p2(theXmax, theY, theZmin);
gp_Pnt p3(theXmax, theY, theZmax);
gp_Pnt p4(theXmin, theY, theZmax);
TopoDS_Edge e1 = BRepBuilderAPI_MakeEdge(p1, p2);
TopoDS_Edge e2 = BRepBuilderAPI_MakeEdge(p2, p3);
TopoDS_Edge e3 = BRepBuilderAPI_MakeEdge(p3, p4);
TopoDS_Edge e4 = BRepBuilderAPI_MakeEdge(p4, p1);
TopoDS_Wire w = BRepBuilderAPI_MakeWire(e1, e2, e3, e4);
TopoDS_Face top_face = BRepBuilderAPI_MakeFace(w);
//
DBRep_IsoBuilder IsoBuild(top_face, 100, 10);
return 0;
}
What the demo do is just build a TopoDS_Face, and then get a DBRep_IsoBuilder instance.
First question: when I debug the demo, I get a exception from "Draw_Interpretor.cxx". I didn't call it, I thought this may because the constructor of "DBRep_IsoBuilder" call it. As show below:
Second question: This is what make me feel unable to understand!!!
I annotation the code:
Code:
DBRep_IsoBuilder IsoBuild(top_face, 100, 10);
Why? I'm so puzzle.