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

Method mirrorInPlane

cadquery/occ_impl/geom.py:787–808  ·  view source on GitHub ↗
(self, listOfShapes, axis="X")

Source from the content-addressed store, hash-verified

785 return Plane(self.origin, newXdir, newZdir)
786
787 def mirrorInPlane(self, listOfShapes, axis="X"):
788
789 local_coord_system = gp_Ax3(
790 self.origin.toPnt(), self.zDir.toDir(), self.xDir.toDir()
791 )
792 T = gp_Trsf()
793
794 if axis == "X":
795 T.SetMirror(gp_Ax1(self.origin.toPnt(), local_coord_system.XDirection()))
796 elif axis == "Y":
797 T.SetMirror(gp_Ax1(self.origin.toPnt(), local_coord_system.YDirection()))
798 else:
799 raise NotImplementedError
800
801 resultWires = []
802 for w in listOfShapes:
803 mirrored = w.transformShape(Matrix(T))
804
805 # attempt stitching of the wires
806 resultWires.append(mirrored)
807
808 return resultWires
809
810 def _setPlaneDir(self, xDir):
811 """Set the vectors parallel to the plane, i.e. xDir and yDir"""

Callers 3

testPlaneMethodsMethod · 0.95
mirrorYMethod · 0.80
mirrorXMethod · 0.80

Calls 5

MatrixClass · 0.85
toPntMethod · 0.80
toDirMethod · 0.80
transformShapeMethod · 0.80
appendMethod · 0.80

Tested by 1

testPlaneMethodsMethod · 0.76