CadQuery / CadQuery/cadquery

Extrusion of overlapping wires is not reproducible

Open
#833 4 comments 0 reactions 0 assignees View on GitHub
docs
Dominant language
Python
Stars
5.8k
Forks
541
Avg merge
3d 2h
Merged PRs (30d)
5

Description

I noticed that when I create multiple overlapping 2D shapes and extrude them
they are generally `union()`'ed together into a single object:

```py
single_object = (
cq.Workplane("XY")
.moveTo(1.5,1)
.rect(3,2)
.moveTo(2,2.1)
.polygon(5,0.5)
.extrude(1)
)
```

and this works nicely when all of the shapes are well behaved shapes such as
`.rect()`, `.circle()`, or `.ellipse()`. However when any two of them behave
like poly-lines the result of `.extrude()` is a set of separate but overlapping
objects.

```py
multiple_overlapping_objects = (
cq.Workplane("XY")
# equivalent rectangle from individual lines
.line(0,2)
.line(3,0)
.line(0,-2)
.close()
# same polygon as above
.moveTo(2,2.1)
.polygon(5,0.5)
.extrude(1)
)
```

as evidenced by:

```py
single_object.faces(">Z").wires().size()
# > 1
multiple_overlapping_objects.faces(">Z").wires().size()
# > 2
```

Note that if I tag the plane (`cq.Workplane("XY").tag("xy")`) and extrude the
intermediate shapes (`.extrude(1).workplaneFromTagged("xy")`), I get the expected result -- i.e. a single object that is the union of all the extruded shapes:

```py
(
cq.Workplane("XY").tag("xy")
# equivalent rectangle from individual lines
.line(0,2)
.line(3,0)
.line(0,-2)
.close()
.extrude(1).workplaneFromTagged("xy")
# define the outline
.moveTo(2,2.1)
.polygon(5,0.5)
.extrude(1)
.faces(">Z").wires().size()
)
# > 1
```

Possibly related to [this issue](https://github.com/CadQuery/cadquery/issues/759)

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.