Geometry Quality with BRepOffsetAPI_MakePipe


I have serious problems with the geometry quality from BRepOffsetAPI_MakePipe. I have a crossection which should be extruded along a trace (spine). The resulting geometry for arcs looks more like extruded on a polygon instead of a arc.

The following code contains a minimal version of what I do,
using real values. Perhaps someone could enlighten me what is going wrong.

Thanks VERY much, Carsten


// define some points for the crosssection
gp_Pnt origProfP1( 0.0, 0.0, 0.);
gp_Pnt origProfP2( .012, 0.0, 0.);
gp_Pnt origProfP3( .012, 0.15, 0.);
gp_Pnt origProfP4( 0.0, 0.15, 0.);

// Create lines
Handle(Geom_TrimmedCurve) origProfline1 = GC_MakeSegment(origProfP1, origProfP2);
Handle(Geom_TrimmedCurve) origProfline2 = GC_MakeSegment(origProfP2, origProfP3);
Handle(Geom_TrimmedCurve) origProfline3 = GC_MakeSegment(origProfP3, origProfP4);
Handle(Geom_TrimmedCurve) origProfline4 = GC_MakeSegment(origProfP4, origProfP1);

// Create edges from lines
TopoDS_Edge origProfedge1 = BRepBuilderAPI_MakeEdge(origProfline1);
TopoDS_Edge origProfedge2 = BRepBuilderAPI_MakeEdge(origProfline2);
TopoDS_Edge origProfedge3 = BRepBuilderAPI_MakeEdge(origProfline3);
TopoDS_Edge origProfedge4 = BRepBuilderAPI_MakeEdge(origProfline4);

// Make crossection wire
BRepBuilderAPI_MakeWire profileOriginMakeWire;
profileOriginMakeWire.Add( origProfedge1 );
profileOriginMakeWire.Add( origProfedge2 );
profileOriginMakeWire.Add( origProfedge3 );
profileOriginMakeWire.Add( origProfedge4 );
TopoDS_Wire profileWire = profileOriginMakeWire.Wire();

// construct a trace (semi-circle)
gp_Pnt start( 52.55, 15.47, 0.);
gp_Pnt middle( 53.9, 16.82, 0.);
gp_Pnt end( 55.25, 15.47, 0.);

Handle(Geom_TrimmedCurve) traceCurve = GC_MakeArcOfCircle(start, middle, end);
TopoDS_Edge traceEdge = BRepBuilderAPI_MakeEdge(traceCurve);
BRepBuilderAPI_MakeWire traceMakeWire;
traceMakeWire.Add( traceEdge );
TopoDS_Wire traceWire = traceMakeWire.Wire();

// rotate the crossection about x-axis
gp_Trsf T1;
gp_Ax1 uaxis( gp_Pnt(0,0,0), gp_Vec( 1,0,0) );
T1.SetRotation( uaxis, PI / 2.0);
BRepBuilderAPI_Transform Rot( T1 );
profileWire = TopoDS::Wire(Rot.Shape());

// move to start point off trace
gp_Trsf T2;
T2.SetTranslation(origProfP1, start);

// make face from crosssection
BRepBuilderAPI_MakeFace profileMakeFace( profileWire );
TopoDS_Shape profilFace = profileMakeFace;

// Extrude using MakePipe
TopoDS_Shape pipe = BRepOffsetAPI_MakePipe (traceWire, profilFace);

Rob Bachrach's picture

On first glance, your code looks fine to me. I did notice that you have a very small cross section w.r.t. the size of the trace. Is it possible that the pipe is being created properly, but the tesselation used to display the shape on your screen is too coarse? Don't forget, the shape is displayed by breaking it into triangles. Arcs can often look like polygons. You might try using BRepMesh to tesselate your geometry with a closer deflection and see if the display improves.

Carsten Zerbst's picture


my problem is the STEP export, so tesselation is not that issue.
But it might be easier when we move from metre to millimetre
and get the better geometry quality

Carsten Zerbst's picture

One additional Note,

when changing the values from Metre to Millimetre, we get the desired

Bye, Carsten