Bad result of BRepOffsetAPI_ThruSections to create a ruled surface.

Hi All,

I am using BRepOffsetAPI_ThruSections to create loft or ruled surface. But I find it can't work well on wires which contains several edges. Such as this sample,

| wire2 |
| _____ |
| | \ |
| | \ |
| |_____| |

wire1 is a rectangle wire which contains 4 edges. wire2 contains 5 edges, one edge is a chamfer edge.
But using BRepOffsetAPI_ThruSections, I can't get correct ruled surface no matter how I change the start points of the wire to match the loop order. In fact, I suffer this problem for a long time, but I can't find any improvement in 6.2, 6.3 version. I really hope OCC team to improve this basic modelling API, it's really important for modeling loft and ruled surface.

-Cauchy Ding

Cauchy Ding's picture


To format the shape, I have to use "*" instead of the space.

jelle's picture

I'm experiencing the exact same problem.
I'm seeing a lot of segfaults when calling BrepOffsetAPI_ThruSections, when lofting wires which have different numbers of edges.
Not cool to see such a fundemental feature not being able to deal with such input!


jelle's picture


There might be a pretty simple fix for this; it seems that BrepOffsetAPI_ThruSections::CreateRuled does *not* except 2 wires with different number of edges.
This is not checked in the BrepOffsetAPI_ThruSections, when calling BRepFill_Generator:

void BRepOffsetAPI_ThruSections::CreateRuled()
Standard_Integer nbSects = myWires.Length();
BRepFill_Generator aGene;
// for (Standard_Integer i=1; i<=nbSects; i++) {
Standard_Integer i;
for (i=1; i<=nbSects; i++) {
TopoDS_Shell shell = aGene.Shell();

I'm sorry, I'm not a C++ dev, but what do you think?
Could that be it?


jelle's picture

Ai, I'm sorry, the above is incorrect; BrepFill_CompatibleWires is called in the .Build method

jelle's picture

I'm a little bit futher: BrepFill_CompatibleWires is to blame.
An interesting thread here:
Seems the issue surfaced before.


Markus's picture

Same problem here - it seems that this is really hard to solve. Are there any workarounds for this?

jelle's picture

You could use BrepFill().Face(edg1,edg2) or .Shell(wire1,wire2)
That way the input curves are not altered ( usually, you *need* this though ;')


Markus Hagemann's picture

Is this still an issue? Or is it at least solved in the commercial version?

sergey zaritchny's picture

At the moment you can consider it as a limitation of the algorithm -
each wire selected must have the same number of edges and vertices.
Probably you may use the sweeping algorithm of MakePipeShell, ?