gumyr / build123d

A python CAD programming library
Apache License 2.0
505 stars 85 forks source link

Tapered extrude only works with N<=2 polar locations despite equivalent topology #568

Open MatthiasJ1 opened 7 months ago

MatthiasJ1 commented 7 months ago
N = 2 # ok
N = 3 # fails
with BuildPart() as p:
    with BuildSketch() as s:
        with PolarLocations(0, N, 0, 180):
            Rectangle(100, 1)
    extrude(amount=-2, taper=-15)

Oddly, if you fillet the outside vertices even slightly, this will work:

N = 20
with BuildPart() as p:
    with BuildSketch() as s:
        with PolarLocations(0, N, 0, 180):
            Rectangle(100, 1)
        fillet(s.vertices().sort_by_distance((0,0,0))[N*2:], 0.1)
    extrude(amount=-2, taper=-15)
gumyr commented 7 months ago

The bug seems to be deep within the OCCT BRepOffsetAPI_MakeOffset code. This is the result of the offset: image which isn't very useful for the creation of the taper.