Fri, 04/21/2017 - 18:00
Hello,
I want to use BRepOffsetAPI_MakeOffsetShape to offseting a shape which is loaded from an stl file.
The used code is as follows
TopoDS_Shape shape;
StlAPI_Reader reader;
TopoDS_Compound compound;
BRep_Builder aBuilder;
GeomAbs_JoinType joinType = GeomAbs_Arc;
reader.Read(shape, "shape.stl");
qDebug()<<"Reading stl file : "<<myTimer.elapsed()<<endl;
aBuilder.MakeCompound(compound);
//aBuilder.Add(compound, cube);
TopExp_Explorer aExpFace;
//Building the shell composed by faces
TopoDS_Shell aShell;
aBuilder.MakeShell(aShell);
int i=0;
for(aExpFace.Init(shape,TopAbs_FACE);aExpFace.More();aExpFace.Next())
{
TopoDS_Face aFace = TopoDS::Face(aExpFace.Current());
aBuilder.Add(aShell,aFace);
}
BRepBuilderAPI_Sewing sewOp;
sewOp.Load(aShell);
sewOp.Perform();
//Creation of the offset
//Offset along the positive normal
BRepOffsetAPI_MakeOffsetShape faceOffset3(sewOp.SewedShape(),1,1e-6,BRepOffset_Skin,false,false,joinType);
//BRepOffsetAPI_MakeOffset faceOffset3
if ( !faceOffset3.IsDone() )
{
cout << "error" << endl;
}
Mon, 04/24/2017 - 12:03
Hello
After BRepOffsetAPI_MakeOffsetShape , it is necessary to apply a triangulation?
In fact it is a triangulated shape in begin, how can I export the shape after offseting.
Thank you for your help