Skip to content

Rounded loft failing to offset in 0.11 #1351

Description

@jgraichen

In 0.10, I was creating two sketches. The bottom one is smaller than the top one.

Image

As a loft, they create this body:

Image

Doing an offset with -1 and the top and bottom faces open resulted in this:

Image

With 0.11, the offset call fails with:

Traceback (most recent call last):
  File ".venv/lib/python3.13/site-packages/build123d/topology/three_d.py", line 680, in offset_3d
    offset_occt_solid = offset_builder.Shape()
OCP.OCP.StdFail.StdFail_NotDone: BRep_API: command not done

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "run.py", line 43, in <module>
    b.offset(
    ~~~~~~~~^
        amount=-1,
        ^^^^^^^^^^
        openings=part.faces().group_by(b.Axis.Z)[-1]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        + part.faces().group_by(b.Axis.Z)[0],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File ".venv/lib/python3.13/site-packages/build123d/operations_generic.py", line 678, in offset
    solid.offset_3d(openings_in_this_solid, amount, kind=kind).fix()
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.13/site-packages/build123d/topology/three_d.py", line 682, in offset_3d
    raise RuntimeError(
        "offset Error, an alternative kind may resolve this error"
    ) from err
RuntimeError: offset Error, an alternative kind may resolve this error

I didn't find any kind that works. Do you have any idea?

I could create a new left with two offsetted sketches and do a subtracting loft, but offset was so nice.

Here is a reproducing script:

# build123d

import build123d as b
import ocp_vscode

WIDTH = 41.2
length = 24.4 * 3

with b.BuildPart() as part:
    with b.BuildSketch(b.Plane.XY.offset(40)) as skt:
        with b.BuildLine():
            b.Polyline(
                [
                    (0, 0),
                    (0, WIDTH),
                    (length, WIDTH),
                    (length, 0),
                    ((length / 2 + 20), 0),
                    ((length / 2 + 20), 10),
                    ((length / 2 - 20), 10),
                    ((length / 2 - 20), 0),
                    (0, 0),
                ]
            )
        b.make_face()

        vtouter = (
            skt.vertices().group_by(b.Axis.X)[0] + skt.vertices().group_by(b.Axis.X)[-1]
        )
        b.fillet(vtouter, radius=7)

        vtinner = (
            skt.vertices().group_by(b.Axis.X)[2] + skt.vertices().group_by(b.Axis.X)[3]
        )
        b.fillet(vtinner, radius=2.5)

    with b.BuildSketch(b.Plane.XY) as skb:
        b.add(skt)
        b.offset(amount=-1)

    b.loft([skb.sketch, skt.sketch])

    b.offset(
        amount=-1,
        openings=part.faces().group_by(b.Axis.Z)[-1]
        + part.faces().group_by(b.Axis.Z)[0],
    )

ocp_vscode.show(part)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions