Hi all,
I've been developing an interlocking tabletop terrain system for a little while in OpenSCAD due to my experience with it, but I'm looking at moving over to CADQuery because I has hitting some limitations with pure functional languages and implementing some randomized procedural elements.
I ran into some issues when porting the code over, specifically with creating a 4-symmetry shape with a cut. I've created an sample of the issue I encountered:
```
PROFILE_OUTER = [
(10, 0),
( 8, 8),
( 0, 10),
]
PROFILE_INNER = [
( 1, 1),
( 9, 1),
( 9, 9),
( 1, 9),
]
# (1) Broken - Seems to connect back to first sketch
# show_object((
# cq.Workplane("XY")
# .polyline(PROFILE_OUTER)
# .mirrorX()
# .mirrorY()
# .extrude(1)
# .polyline(PROFILE_INNER)
# .close()
# .extrude(2)
# ))
# (2) Works
show_object((
cq.Workplane("XY")
.polyline(PROFILE_OUTER)
.mirrorX()
.mirrorY()
.extrude(1)
.polyline(PROFILE_INNER)
.polyline([PROFILE_INNER[-1],PROFILE_INNER[0]])
.mirrorX()
.mirrorY()
.extrude(2)
))
# (3) Works but not the intended Output
# show_object((
# cq.Workplane("XY")
# .polyline(PROFILE_OUTER)
# .close()
# .extrude(1)
# .polyline(PROFILE_INNER)
# .close()
# .extrude(2)
# ))
# (4) Doesnt work: RuntimeError("Cannot convert object type '%s' to vector " % type(obj))
# show_object((
# cq.Workplane("XY")
# .polyline(PROFILE_OUTER)
# .mirrorY()
# .mirrorX()
# .close()
# .extrude(1)
# .polyline(PROFILE_INNER)
# .close()
# .extrude(2)
# ))
# (5) Doesnt work: ValueError("No pending wires present")
# show_object((
# cq.Workplane("XY")
# .polyline(PROFILE_OUTER)
# .mirrorX()
# .mirrorY()
# .extrude(1)
# .polyline(PROFILE_INNER)
# .polyline([PROFILE_INNER[-1],PROFILE_INNER[0]])
# .extrude(2)
# ))
```
It seems like the close function picks up the last point of the first polyline (1), which requires me to manually complete the shape (2). The first shape is constructed using mirroring, so I can't close the polyline first, though does allow me to use close for the second shape (3), and attempting to call close after the mirrors in the first object results in an exception (4).
I also noted that if I manually close the second shape but don't mirror then that results in another error (5).
I feel like I must be missing some rules about the interactions of somethings? I can't seem to find a way to clear that point from the previous sketch. I've got something that works for my project for now, but I want to make sure I'm not operating with some fundamental misunderstanding.
Thanks for your time,
Natalie
Attached is the image in cq-editor for (1)
