| 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""" |