MCPcopy
hub / github.com/CadQuery/cadquery / mirrorX

Method mirrorX

cadquery/cq.py:2255–2279  ·  view source on GitHub ↗

Mirror entities around the x axis of the workplane plane. :return: a new object with any free edges consolidated into as few wires as possible. All free edges are collected into a wire, and then the wire is mirrored, and finally joined into a new wire Typi

(self: T)

Source from the content-addressed store, hash-verified

2253 return consolidated.consolidateWires()
2254
2255 def mirrorX(self: T) -> T:
2256 """
2257 Mirror entities around the x axis of the workplane plane.
2258
2259 :return: a new object with any free edges consolidated into as few wires as possible.
2260
2261 All free edges are collected into a wire, and then the wire is mirrored,
2262 and finally joined into a new wire
2263
2264 Typically used to make creating wires with symmetry easier.
2265 """
2266 # convert edges to a wire, if there are pending edges
2267 n = self.wire(forConstruction=False)
2268
2269 # attempt to consolidate wires together.
2270 consolidated = n.consolidateWires()
2271
2272 mirroredWires = self.plane.mirrorInPlane(consolidated.wires().vals(), "X")
2273
2274 for w in mirroredWires:
2275 consolidated.objects.append(w)
2276 consolidated._addPendingWire(w)
2277
2278 # attempt again to consolidate all of the wires
2279 return consolidated.consolidateWires()
2280
2281 def _addPendingEdge(self, edge: Edge) -> None:
2282 """

Callers 5

testOccBottleMethod · 0.80
testSimpleMirrorMethod · 0.80
testUnorderedMirrorMethod · 0.80
testChainedMirrorMethod · 0.80
testOffset2DMethod · 0.80

Calls 7

wireMethod · 0.95
consolidateWiresMethod · 0.80
mirrorInPlaneMethod · 0.80
appendMethod · 0.80
_addPendingWireMethod · 0.80
valsMethod · 0.45
wiresMethod · 0.45

Tested by 5

testOccBottleMethod · 0.64
testSimpleMirrorMethod · 0.64
testUnorderedMirrorMethod · 0.64
testChainedMirrorMethod · 0.64
testOffset2DMethod · 0.64