CadQuery / CadQuery/cadquery

Adding two closed wires to workplane then do offset2D(), resulting in one wire broken

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

Description

## To Reproduce

```python
import cadquery as cq
import math
OP = cq.Vector(0, 0, 0)
X = cq.Vector(1, 0, 0)
Y = cq.Vector(0, 1, 0)
Z = cq.Vector(0, 0, 1)

wr_elp = cq.Wire.makeEllipse(15, 16, OP, Z, X)
wr_circ =cq.Wire.makeCircle(16, OP, Z)

sld_lofted = (
cq.Workplane()
.add(wr_elp)
.toPending()
.add(wr_circ.moved(0, 0, 30))
.toPending()
.loft()
)
# show_object(sld_lofted)

wr_sectioned = (
cq.Workplane(origin=(0, 0, 5) )
.add(sld_lofted)
.section()
.wires()[0]
)
# show_object(wr_sectioned)

two_ring_wires = (
cq.Workplane(origin=(0, 0, 5))

# ring1
.add(wr_sectioned)
.toPending()
.offset2D(5)

# ring2
.add(wr_sectioned)
.toPending()
.offset2D(-3)

#.extrude(10)
)
show_object(two_ring_wires)
```

Image

Only when two wires are in the workplane, this bug happends. If comment out one of ring1/ring2, you'll get a closed wire.

## Environment

OS: Linux
Python 3.11

CadQuery installed by `pip install cadquery`

Was CadQuery installed using Conda?: no

Using:

[pip_list.txt](https://github.com/user-attachments/files/22985315/pip_list.txt)

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.