MCPcopy Index your code
hub / github.com/CadQuery/cadquery / __init__

Method __init__

cadquery/occ_impl/geom.py:583–605  ·  view source on GitHub ↗

Create a Plane from origin in global coordinates, vector xDir, and normal direction for the plane.

(
        self,
        origin: Union[Tuple[Real, Real, Real], Vector],
        xDir: Optional[Union[Tuple[Real, Real, Real], Vector]] = None,
        normal: Union[Tuple[Real, Real, Real], Vector] = (0, 0, 1),
    )

Source from the content-addressed store, hash-verified

581 # been a multimethod.
582 @multidispatch
583 def __init__(
584 self,
585 origin: Union[Tuple[Real, Real, Real], Vector],
586 xDir: Optional[Union[Tuple[Real, Real, Real], Vector]] = None,
587 normal: Union[Tuple[Real, Real, Real], Vector] = (0, 0, 1),
588 ):
589 """Create a Plane from origin in global coordinates, vector xDir, and normal direction for the plane."""
590 zDir = Vector(normal)
591 if zDir.Length == 0.0:
592 raise ValueError("normal should be non null")
593
594 self.zDir = zDir.normalized()
595
596 if xDir is None:
597 ax3 = gp_Ax3(Vector(origin).toPnt(), Vector(normal).toDir())
598 xDir = Vector(ax3.XDirection())
599 else:
600 xDir = Vector(xDir)
601 if xDir.Length == 0.0:
602 raise ValueError("xDir should be non null")
603
604 self._setPlaneDir(xDir)
605 self.origin = Vector(origin)
606
607 @multidispatch
608 def __init__(

Callers

nothing calls this directly

Calls 11

normalizedMethod · 0.95
_setPlaneDirMethod · 0.95
rotateZMethod · 0.95
rotateYMethod · 0.95
rotateXMethod · 0.95
VectorClass · 0.85
MatrixClass · 0.85
toPntMethod · 0.80
toDirMethod · 0.80
transformMethod · 0.80
toTupleMethod · 0.45

Tested by

no test coverage detected