CadQuery / cadquery

A python parametric CAD scripting framework based on OCCT
https://cadquery.readthedocs.io
Other
3.03k stars 284 forks source link

Inner shell is built for extruded polyline solid but outer shell is not built for same solid #1494

Open sadr0b0t opened 7 months ago

sadr0b0t commented 7 months ago

I have solid extruded from polyline. If I make a shell for it with inner thickness (-0.5), it is built ok. If try to build outer shell (0.5 thickness), I get "Brep_API: command not done".

Maybe there is a reason for it, but looks like a bug or missing feature to me.

import cadquery as cq

_plate = (
        cq.Workplane("XY")
        .lineTo(3, 0)
        .lineTo(5, 1)
        .lineTo(6, 1)
        .lineTo(6, 4)
        .lineTo(0, 4)
        .mirrorY()
        .extrude(3)
        .faces("<Z or >Z")
        .shell(-0.5) # ok
        #.shell(0.5) # fail
    )

show_object(_plate)

Снимок экрана от 2024-01-13 20-04-55 Снимок экрана от 2024-01-13 20-10-08

adam-urbanczyk commented 7 months ago

Sometime one has to work around kernel issues. In this case the following code doe work:

import cadquery as cq

_plate = (
        cq.Workplane("XY")
        .lineTo(3, 0)
        .lineTo(5, 1)
        .lineTo(6, 1)
        .lineTo(6, 4)
        .lineTo(0, 4)
        .mirrorY()
        .extrude(3)
        .faces("<Z or >Z")
        #.shell(-0.5) # ok
        .shell(0.5, kind='intersection') # ok
    )

show_object(_plate)