CadQuery / cadquery

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

Cutting a sphere by a box fails in one direction #1183

Open bernhard-42 opened 2 years ago

bernhard-42 commented 2 years ago

Test code

import cadquery as cq

show_object(
    cq.Workplane().sphere(1).cut(
        cq.Workplane().box(2, 2, 0.5)
    ).translate((0,0,2))
)
show_object(
    cq.Workplane().sphere(1).cut(
        cq.Workplane().box(0.5, 2, 2)
    )
)

Result: The top cut is ok, the bottom cut is broken

image

Environment:

CadQuery:

Successfully installed cadquery-2.2.dev531+g03c3266
adam-urbanczyk commented 2 years ago

Try with clean=False as a workaround.

bernhard-42 commented 1 year ago

Sorry for the late reply, missed your answer.

Do you mean

import cadquery as cq

obj = cq.Workplane().sphere(1).cut(
    cq.Workplane().box(0.5, 2, 2),
    clean=True
)
show_object(obj)

It still shows the wrong behaviour

adam-urbanczyk commented 1 year ago

I meant clean=False (see above).

bernhard-42 commented 1 year ago

Sorry, clean=False works, my bad

bernhard-42 commented 1 year ago

Please feel free to close the issue, if you don't want to track the workaround.

Thank you!

adam-urbanczyk commented 1 year ago

The issue is fine, those things do get improved with newer OCCT releases.