MCPcopy
hub / github.com/CadQuery/cadquery / Workplane

Class Workplane

cadquery/cq.py:124–4561  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

122
123
124class 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

Callers 15

showablesFunction · 0.90
wpFunction · 0.90
importBoxMethod · 0.90
importCompoundMethod · 0.90
box123Function · 0.90
test_step_optionsFunction · 0.90
test_fused_assemblyFunction · 0.90

Calls

no outgoing calls

Tested by 15

showablesFunction · 0.72
wpFunction · 0.72
importBoxMethod · 0.72
importCompoundMethod · 0.72
box123Function · 0.72
test_step_optionsFunction · 0.72
test_fused_assemblyFunction · 0.72