Skip to content

Commit ea27006

Browse files
marcus7070jmwright
andauthored
Update some examples (#775)
* Update some examples for workplane centerOption default ProjectedOrigin * Typo in doc/examples.rst Co-authored-by: Jeremy Wright <[email protected]> Co-authored-by: Jeremy Wright <[email protected]>
1 parent 05e42a7 commit ea27006

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

doc/examples.rst

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -396,20 +396,22 @@ Creating Workplanes on Faces
396396
This example shows how to locate a new workplane on the face of a previously created feature.
397397

398398
.. 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
402402

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.
406406

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`.
408410

409411
.. cadquery::
410412

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
413415

414416
.. topic:: Api References
415417

@@ -426,18 +428,19 @@ Keep in mind that the origin of new workplanes are located at the center of a fa
426428
Locating a Workplane on a vertex
427429
---------------------------------
428430

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
432435

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.
435438

436439
.. cadquery::
437440

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
441444

442445
.. topic:: Api References
443446

0 commit comments

Comments
 (0)