@@ -396,20 +396,22 @@ Creating Workplanes on Faces
396
396
This example shows how to locate a new workplane on the face of a previously created feature.
397
397
398
398
.. note ::
399
- Using workplanes in this way are a key feature of CadQuery. Unlike typical 3d scripting language,
400
- using work planes frees you from tracking the position of various features in variables, and
401
- allows the model to adjust itself with removing redundant dimensions
399
+ Using workplanes in this way are a key feature of CadQuery. Unlike a typical 3d scripting
400
+ language, using work planes frees you from tracking the position of various features in
401
+ variables, and allows the model to adjust itself with removing redundant dimensions
402
402
403
- The :py:meth: `Workplane.faces() ` method allows you to select the faces of a resulting solid. It accepts
404
- a selector string or object, that allows you to target a single face, and make a workplane oriented on that
405
- face.
403
+ The :py:meth: `Workplane.faces() ` method allows you to select the faces of a resulting solid. It
404
+ accepts a selector string or object, that allows you to target a single face, and make a workplane
405
+ oriented on that face.
406
406
407
- Keep in mind that the origin of new workplanes are located at the center of a face by default.
407
+ Keep in mind that by default the origin of a new workplane is calculated by forming a plane from the
408
+ selected face and projecting the previous origin onto that plane. This behaviour can be changed
409
+ through the centerOption argument of :py:meth: `Workplane.workplane `.
408
410
409
411
.. cadquery ::
410
412
411
- result = cq.Workplane("front").box(2,3, 0.5) # make a basic prism
412
- result = result.faces(">Z").workplane().hole(0.5) # find the top-most face and make a hole
413
+ result = cq.Workplane("front").box(2,3, 0.5) # make a basic prism
414
+ result = result.faces(">Z").workplane().hole(0.5) # find the top-most face and make a hole
413
415
414
416
.. topic :: Api References
415
417
@@ -426,18 +428,19 @@ Keep in mind that the origin of new workplanes are located at the center of a fa
426
428
Locating a Workplane on a vertex
427
429
---------------------------------
428
430
429
- Normally, the :py:meth: `Workplane.workplane ` method requires a face to be selected. But if a vertex is selected
430
- **immediately after a face **, :py:meth: `Workplane.workplane ` will locate the workplane on the face, with the origin at the vertex instead
431
- of at the center of the face
431
+ Normally, the :py:meth: `Workplane.workplane ` method requires a face to be selected. But if a vertex
432
+ is selected **immediately after a face **, :py:meth: `Workplane.workplane ` with the centerOption
433
+ argument set to CenterOfMass will locate the workplane on the face, with the origin at the vertex
434
+ instead of at the center of the face
432
435
433
- The example also introduces :py:meth: `Workplane.cutThruAll `, which makes a cut through the entire part, no matter
434
- how deep the part is
436
+ The example also introduces :py:meth: `Workplane.cutThruAll `, which makes a cut through the entire
437
+ part, no matter how deep the part is.
435
438
436
439
.. cadquery ::
437
440
438
- result = cq.Workplane("front").box(3,2, 0.5) # make a basic prism
439
- result = result.faces(">Z").vertices("<XY").workplane(centerOption="CenterOfMass") #select the lower left vertex and make a workplane
440
- result = result.circle(1.0).cutThruAll() # cut the corner out
441
+ result = cq.Workplane("front").box(3,2, 0.5) # make a basic prism
442
+ result = result.faces(">Z").vertices("<XY").workplane(centerOption="CenterOfMass") # select the lower left vertex and make a workplane
443
+ result = result.circle(1.0).cutThruAll() # cut the corner out
441
444
442
445
.. topic :: Api References
443
446
0 commit comments