def _getPln(self, arg: Shape) -> gp_Pln: if isinstance(arg, Face): rv = gp_Pln(self._getPnt(arg), arg.normalAt().toDir()) elif isinstance(arg, (Edge, Wire)): normal = arg.normal() origin = arg.Center() plane = Plane(origin, normal=normal) rv = plane.toPln() else: raise ValueError(f"Cannot construct a plane for {arg}.") return rv
def toPln(self) -> gp_Pln: return gp_Pln( gp_Ax3(self.origin.toPnt(), self.zDir.toDir(), self.xDir.toDir()))