You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix additional spaces in Python code blocks in tests (#1861)
The correct alignment is the 3 column, aligned to the `code-block` directive,
not the 4 column.
The extra space is not removed by the docutils parser, so the docs
all had an extra space in them, which is very annoying for copy-pasting,
especially into limited editors like the CQ-editor where you have to clean up
every code sample before it works (otherwise you get IndentationError).
Copy file name to clipboardExpand all lines: doc/free-func.rst
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,39 +53,39 @@ It begins with defining few edges.
53
53
54
54
.. code-block:: python
55
55
56
-
edge1 = circle(r)
57
-
edge2 = circle(2*r).moved(z=dh)
58
-
edge3 = circle(r).moved(z=1.5*dh)
56
+
edge1 = circle(r)
57
+
edge2 = circle(2*r).moved(z=dh)
58
+
edge3 = circle(r).moved(z=1.5*dh)
59
59
60
60
61
61
Those edges are used to create the side faces of the final solid using :meth:`~cadquery.occ_impl.shapes.loft`.
62
62
63
63
.. code-block:: python
64
64
65
-
side = loft(edge1, edge2, edge3)
65
+
side = loft(edge1, edge2, edge3)
66
66
67
67
Once the side is there, :meth:`~cadquery.occ_impl.shapes.cap` and :meth:`~cadquery.occ_impl.shapes.fill` are used to define the top and bottom faces.
68
68
Note that :meth:`~cadquery.occ_impl.shapes.cap` tries to maintain curvature continuity with respect to the context shape. This is not the case for :meth:`~cadquery.occ_impl.shapes.fill`.
69
69
70
70
.. code-block:: python
71
71
72
-
# bottom face
73
-
bottom = fill(side.edges('<Z'))
72
+
# bottom face
73
+
bottom = fill(side.edges('<Z'))
74
74
75
-
# top face with continuous curvature
76
-
top = cap(side.edges('>Z'), side, [(0,0,1.75*dh)])
75
+
# top face with continuous curvature
76
+
top = cap(side.edges('>Z'), side, [(0,0,1.75*dh)])
77
77
78
78
Next, all the faces are assembled into a solid.
79
79
80
80
.. code-block:: python
81
81
82
-
s = solid(side, bottom, top)
82
+
s = solid(side, bottom, top)
83
83
84
84
Finally, the solid is duplicated and placed in the desired locations creating the final compound object. Note various usages of :meth:`~cadquery.Shape.moved`.
85
85
86
86
.. code-block:: python
87
87
88
-
result = s.moved((-3*r, 0, 0), (3*r, 0, 0))
88
+
result = s.moved((-3*r, 0, 0), (3*r, 0, 0))
89
89
90
90
In general all the operations are implemented as free functions, with the exception of placement and selection which are strictly related to a specific shape.
0 commit comments