Defines a coordinate system in space, in which 2D coordinates can be used. :param plane: the plane in which the workplane will be done :type plane: a Plane object, or a string in (XY|YZ|XZ|front|back|top|bottom|left|right) :param origin: the desired origin of the new workplane
| 122 | |
| 123 | |
| 124 | class Workplane(object): |
| 125 | """ |
| 126 | Defines a coordinate system in space, in which 2D coordinates can be used. |
| 127 | |
| 128 | :param plane: the plane in which the workplane will be done |
| 129 | :type plane: a Plane object, or a string in (XY|YZ|XZ|front|back|top|bottom|left|right) |
| 130 | :param origin: the desired origin of the new workplane |
| 131 | :type origin: a 3-tuple in global coordinates, or None to default to the origin |
| 132 | :param obj: an object to use initially for the stack |
| 133 | :type obj: a CAD primitive, or None to use the centerpoint of the plane as the initial |
| 134 | stack value. |
| 135 | :raises: ValueError if the provided plane is not a plane, a valid named workplane |
| 136 | :return: A Workplane object, with coordinate system matching the supplied plane. |
| 137 | |
| 138 | The most common use is:: |
| 139 | |
| 140 | s = Workplane("XY") |
| 141 | |
| 142 | After creation, the stack contains a single point, the origin of the underlying plane, |
| 143 | and the *current point* is on the origin. |
| 144 | |
| 145 | .. note:: |
| 146 | You can also create workplanes on the surface of existing faces using |
| 147 | :meth:`workplane` |
| 148 | """ |
| 149 | |
| 150 | objects: List[CQObject] |
| 151 | ctx: CQContext |
| 152 | parent: Optional["Workplane"] |
| 153 | plane: Plane |
| 154 | |
| 155 | _tag: Optional[str] |
| 156 | |
| 157 | @overload |
| 158 | def __init__(self, obj: CQObject) -> None: |
| 159 | ... |
| 160 | |
| 161 | @overload |
| 162 | def __init__( |
| 163 | self, |
| 164 | inPlane: Union[Plane, str] = "XY", |
| 165 | origin: VectorLike = (0, 0, 0), |
| 166 | obj: Optional[CQObject] = None, |
| 167 | ) -> None: |
| 168 | ... |
| 169 | |
| 170 | def __init__(self, inPlane="XY", origin=(0, 0, 0), obj=None): |
| 171 | """ |
| 172 | make a workplane from a particular plane |
| 173 | |
| 174 | :param inPlane: the plane in which the workplane will be done |
| 175 | :type inPlane: a Plane object, or a string in (XY|YZ|XZ|front|back|top|bottom|left|right) |
| 176 | :param origin: the desired origin of the new workplane |
| 177 | :type origin: a 3-tuple in global coordinates, or None to default to the origin |
| 178 | :param obj: an object to use initially for the stack |
| 179 | :type obj: a CAD primitive, or None to use the centerpoint of the plane as the initial |
| 180 | stack value. |
| 181 | :raises: ValueError if the provided plane is not a plane, or one of XY|YZ|XZ |
no outgoing calls