Wed, 09/14/2011 - 13:33

I've had problems now with BRepBuilderAPI_MakeEdge in cases of periodic multiple times now.

Consider the following example:

-An edge, describing a section of a 2d circle, going from 2*PI-eps to 2*PI+eps. Let this circle, lying on the plane "hPlane", be called "hCurve".

-To construct an equivalent edge from the circular curve, BRepBuilderAPI_MakeEdge(hCurve, hPlane, startvertex, endvertex) is employed

-Strangely, the new edge is the inverted section of the original edge. It is going from 0+eps all the way around to 2*PI-eps.

Why? The vertices are projected onto the curve. This results in the following curve parameters:

startvertex -> 2*PI-eps

endvertey -> 0+eps

Now OCC finds the parameter values in wrong order and swaps the vertices. The curve direction, on the other hand, is not reversed. Therefore the resulting edge is going from eps all around the circle to 2*PI-eps.

I find this behaviour very unintuitive. I understand that you cannot simply change the behaviour of your code because of a large existing codebase. But wouldn't it be possible to add a flag to the function, defaulting to "TRUE", signaling whether the user wants the vertices to be swapped or not?

Wed, 09/14/2011 - 15:47

Dear Fabian,

Very probably the value is to small.

See for more details BReplib_MakeEdge.cxx file (Project method).

Regards