CadQuery / CadQuery/cadquery

Can offset2D be applied to only 1 of multiple pending wires?

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

Description

I have a model where I'd like to offset a faces boundary, then offset those edges again (by a different amount), and then extrude between those two offsets. See the example.

I understand what is happening here - the first offset works and then I add the "outer" wires to pending again so the second offset is being applied to *both* the outer boundary and the previously offset wire (which is still pending). But I'd like this second offset to only be applied to the "outer" boundary wire, so that I end up with 2 pending wires that are defined independently of each other with only reference to the boundary. Is there a straight forward way to do this, so I can extrude the area between those two offsets.

```python
import cadquery as cq
result = cq.Workplane('XY').box(1, 1, 0.2)
show_object(result)
result = result.faces('>Z').wires().tag('outer').toPending().offset2D(-0.05)
show_object(result)
result = result.wires(tag='outer').toPending().offset2D(-0.2)
show_object(result)
result = result.extrude(0.1)
show_object(result)
```

The desired result can be achieved by switching the offset order:

```python
import cadquery as cq
result = cq.Workplane('XY').box(1, 1, 0.2)
show_object(result)
result = result.faces('>Z').wires().tag('outer').toPending().offset2D(-0.20)
show_object(result)
result = result.wires(tag='outer').toPending().offset2D(-0.05)
show_object(result)
result = result.extrude(0.1)
show_object(result)
```

But I'm still curious if this is the best way to achieve what I want or if there is a better recommendation. And ideally I'm still interested in a way to have the offset2D only affect 1 pending wire so that the order doesn't matter and the final two offsets are independent of each other.

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.