CadQuery / CadQuery/cadquery

Simple 'cut' of two a Box and a Sphere creates unusable object

Open
#1,584 3 comments 0 reactions 0 assignees View on GitHub
OCC kernel issue
Dominant language
Python
Stars
5.8k
Forks
541
Avg merge
3d 2h
Merged PRs (30d)
5

Description

This very simple script creates a box and cuts out part of it with a sphere. It confuses cq-editor (instead of a cut one gets a hole to look into the cube), and creates a completely unusable stl file with over 1000 open edges, (the equivalent translate() call instead of transformGeometry() is slightly better with only 4 open edges). Is there any workaround? Thanks

```python
import cadquery as cq

res=cq.Solid.makeBox(10,10,10)
sphere=cq.Solid.makeSphere(4,angleDegrees1=-90)

m=[[1,0,0,10],[0,1,0,0],[0,0,1,5],[0,0,0,1]]
res=res.cut(sphere.transformGeometry(cq.Matrix(m)))
#res=res.cut(sphere.translate([10,0,5]))

ass = cq.Assembly()
ass.add(res, color=cq.Color("red"))

cq.exporters.export(cq.Workplane("XY").add(res), 'mesh.stl')
show_object(ass)
```
![image](https://github.com/CadQuery/cadquery/assets/972471/bc91d989-07c7-4e22-a070-1285636cdb67)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.