
Tue, 08/14/2007 - 17:35
Forums:
Dear all,
I have just generated a BSplineCurve with GeomAPI_Interpolate and have converted this BSplineCurve into a TopoEdge with BRep_Builder.
Now I would like to add this TopoEdge to an already existing TopoShape or TopoCompound.
I tried to use the Add from BRep_Builder but I think that this might only work with Shapes.
Currently my code looks like this:
BRep_Builder aBuilder;
aBuilder.MakeEdge(aTopoEdge,anInterpolationCurve,0.001);
aBuilder.Add(aTopoShape,aTopoEdge);
But with this code I get an exception and the programm is halted at the free function :(
Could someone help me out on how I have to do it the right way to get some topos grouped together?
Thx in advance.
Joachim
Fri, 08/17/2007 - 10:25
Hmm..
Is there really nobody who knows how to combine some TopoEdges or TopoWires into one TopoShape or TopoCompound?
I experimented quiet a lot during the last days but its still not working :(
Thank you in advance for any help!!
Joachim
Fri, 08/17/2007 - 11:38
Hi,
See how to add various topological entities to a Compound.
============================
BRep_Builder builder;
TopoDS_Compound Comp;
builder.MakeCompound(Comp);
TopoDS_Vertex aVertex = BRepBuilderAPI_MakeVertex(gp_Pnt(-20,10,-30));
builder.Add(Comp,aVertex);
gp_Lin line(gp_Ax1(gp_Pnt(10,10,10),gp_Dir(1,0,0)));
TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(line,-20,10);
builder.Add(Comp,anEdge);
gp_Sphere sphere (gp_Ax3(gp_Pnt(-80,0,0),gp_Dir(1,0,0)),150);
TopoDS_Face aFace = BRepBuilderAPI_MakeFace(sphere,0.1,0.7,0.2,0.9);
builder.Add(Comp,aFace);
TopoDS_Shape aBox = BRepPrimAPI_MakeBox(gp_Pnt(-60,0,0),30,60,40);
builder.Add(Comp,aBox);
bye
- PG
Fri, 08/17/2007 - 12:03
This is exactly what I was looking for.
Thx a lot PG