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
Copy file name to clipboardExpand all lines: doc/sketch.rst
+25-3Lines changed: 25 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,17 +25,38 @@ combining them using boolean operations.
25
25
cq.Sketch()
26
26
.trapezoid(4,3,90)
27
27
.vertices()
28
-
.circle(.5,mode='s')
28
+
.circle(.5,mode='s')
29
29
.reset()
30
30
.vertices()
31
31
.fillet(.25)
32
32
.reset()
33
-
.rarray(.6,1,5,1).slot(1.5,0.4,mode='s',angle=90)
33
+
.rarray(.6,1,5,1).slot(1.5,0.4,mode='s',angle=90)
34
34
)
35
35
36
36
Note that selectors are implemented, but selection has to be explicitly reset. Sketch
37
37
class does not implement history and all modifications happen in-place.
38
38
39
+
Modes
40
+
^^^^^
41
+
42
+
Every operation from the face API accepts a mode parameter to define how to combine the created object with existing ones. It can be fused (``mode='a'``), cut (``mode='s'``), intersected (``mode='i'``) or just stored for construction (``mode='c'``). In the last case, it is mandatory to specify a ``tag`` in order to be able to refer to the object later on. By default faces are fused together. Note the usage of the subtractive and additive modes in the example above. The additional two are demonstrated below.
43
+
44
+
.. cadquery::
45
+
:height: 600px
46
+
47
+
result = (
48
+
cq.Sketch()
49
+
.rect(1, 2, mode='c', tag='base')
50
+
.vertices(tag='base')
51
+
.circle(.7)
52
+
.reset()
53
+
.edges('|Y', tag='base')
54
+
.ellipse(1.2, 1, mode='i')
55
+
.reset()
56
+
.rect(2, 2, mode='i')
57
+
.clean()
58
+
)
59
+
39
60
40
61
Edge-based API
41
62
==============
@@ -62,6 +83,7 @@ If needed, one can construct sketches by placing individual edges.
62
83
Once the construction is finished it has to be converted to the face-based representation
63
84
using :meth:`~cadquery.Sketch.assemble`. Afterwards, face based operations can be applied.
64
85
86
+
65
87
Convex hull
66
88
===========
67
89
@@ -269,4 +291,4 @@ Reusing of existing sketches is needed when using :meth:`~cadquery.Workplane.lof
269
291
.loft()
270
292
)
271
293
272
-
When lofting only outer wires are taken into account.
294
+
When lofting only outer wires are taken into account and inner wires are silently ignored.
0 commit comments