예제 #1
0
    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
예제 #2
0
파일: geom.py 프로젝트: luzpaz/cadquery
    def toPln(self) -> gp_Pln:

        return gp_Pln(
            gp_Ax3(self.origin.toPnt(), self.zDir.toDir(), self.xDir.toDir()))