Skip to content

Commit 23e4c59

Browse files
author
Jordan Poles
committed
Rearranging and styling
1 parent f265e66 commit 23e4c59

File tree

1 file changed

+106
-93
lines changed

1 file changed

+106
-93
lines changed

doc/_static/cadquery_cheatsheet.html

Lines changed: 106 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
<head>
44
<title>CadQuery Cheatsheet</title>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
67

78
<style type="text/css">
89
.section {
910
margin: 0.5em;
1011
padding: 0px 0.5em 0.5em;
1112
background-color: #EBEBEB;
1213
min-width: 300px;
13-
max-width: 30vw;
14+
max-width: min(50vw, 100%);
1415
}
15-
{
16-
16+
.section-subtitle {
17+
margin-bottom: 4px;
1718
}
1819
h2 a, h2 a:visited, .section a,.section a:visited {
1920
color: #1f4b8f;
@@ -41,16 +42,16 @@
4142
<h1><img src="https://cadquery.readthedocs.io/en/latest/_static/cadquery_logo_dark.svg" height=30> Cheatsheet</h1>
4243
<i>A Quick Guide To The Most Commonly Used Functions!
4344
<br/>
44-
<sub>For the full API ref <a href="https://cadquery.readthedocs.io/en/latest/apireference.html" target="_blank">click here!</a></sub></i>
45+
<sub>For the full API ref <a target="_blank" href="https://cadquery.readthedocs.io/en/latest/apireference.html" target="_blank">click here!</a></sub></i>
4546
</div>
46-
<div style="display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-around;">
47+
<div style="display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-around; row-gap: 10px;">
4748
<div class="section" hidden>
4849
<h2>Documentation</h2>
4950
<ul style="background-color:#ffffff;margin-bottom:0px;margin-top:0px;">
50-
<li><a href="https://cadquery.readthedocs.io/en/latest/">CadQuery Documentation</a></li>
51-
<li><a href="https://github.com/CadQuery/cadquery/blob/master/README.md">CadQuery Readme</a></li>
52-
<li><a href="https://github.com/CadQuery/cadquery/tree/master/examples">CadQuery Examples</a></li>
53-
<li><a href="https://cadquery.readthedocs.io/en/latest/apireference.html">CadQuery API Reference</a></li>
51+
<li><a target="_blank" href="https://cadquery.readthedocs.io/en/latest/">CadQuery Documentation</a></li>
52+
<li><a target="_blank" href="https://github.com/CadQuery/cadquery/blob/master/README.md">CadQuery Readme</a></li>
53+
<li><a target="_blank" href="https://github.com/CadQuery/cadquery/tree/master/examples">CadQuery Examples</a></li>
54+
<li><a target="_blank" href="https://cadquery.readthedocs.io/en/latest/apireference.html">CadQuery API Reference</a></li>
5455
</ul>
5556
</div>
5657
<div class="section">
@@ -161,9 +162,78 @@ <h2>BREP Terminology</h2><br />
161162
</tr>
162163
</table>
163164
</div>
165+
<div class="section">
166+
<h2>Selector String Modifiers</h2><br />
167+
<div class="section-subtitle">See <a target="_blank" href="https://cadquery.readthedocs.io/en/latest/selectors.html">CadQuery String Selectors</a> for more information.<br />
168+
Axis Strings are: X, Y, Z, XY, YZ, XZ</div>
169+
<table style="width:100%;">
170+
<tr>
171+
<th style="width:10%;">Modifier</th>
172+
<th style="width:90%;">Description</th>
173+
</tr>
174+
<tr>
175+
<td>&#124;</td>
176+
<td>Parallel to = <a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.ParallelDirSelector">ParallelDirSelector</a></td>
177+
</tr>
178+
<tr>
179+
<td>&#35;</td>
180+
<td>Perpendicular to = <a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.PerpendicularDirSelector">PerpendicularDirSelector</a></td>
181+
</tr>
182+
<tr>
183+
<td>&#43;</td>
184+
<td>Positive direction = <a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.DirectionSelector">DirectionSelector</a></td>
185+
</tr>
186+
<tr>
187+
<td>&#45;</td>
188+
<td>Negative direction = <a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.DirectionSelector">DirectionSelector</a></td>
189+
</tr>
190+
<tr>
191+
<td>&gt;</td>
192+
<td>Max = <a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.DirectionMinMaxSelector">DirectionMinMaxSelector</a>(directionMax=True)</td>
193+
</tr>
194+
<tr>
195+
<td>&lt;</td>
196+
<td>Min = <a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.DirectionMinMaxSelector">DirectionMinMaxSelector</a>(directionMax=False)</td>
197+
</tr>
198+
<tr>
199+
<td>&#37;</td>
200+
<td>Curve/surface type = <a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.TypeSelector">TypeSelector</a></td>
201+
</tr>
202+
</table>
203+
</div>
204+
<div class="section">
205+
<h2>Selector Methods</h2><br />
206+
<div class="section-subtitle">CadQuery selector strings and classes allow filtering to select objects.</div>
207+
<table style="width:100%;">
208+
<tr>
209+
<th style="width:40%;">Selector Methods</th>
210+
<th style="width:60%;">Selector Classes
211+
</th>
212+
</tr>
213+
<tr>
214+
<td><a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.Workplane.faces">CQ.faces</a>(selector)</td>
215+
<td><a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.selectors.NearestToPointSelector">NearestToPointSelector</a>(pnt)</td>
216+
<tr>
217+
<td><a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.Workplane.edges">CQ.edges</a>(selector)</td>
218+
<td><a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.selectors.ParallelDirSelector">ParallelDirSelector</a>(vector)</td>
219+
</tr>
220+
<tr>
221+
<td><a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.Workplane.vertices">CQ.vertices</a>(selector)</td>
222+
<td><a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.selectors.DirectionSelector">DirectionSelector</a>(vector)</td>
223+
</tr>
224+
<tr>
225+
<td><a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.Workplane.solids">CQ.solids</a>(selector)</td>
226+
<td><a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.selectors.DirectionMinMaxSelector">DirectionMinMaxSelector</a>(vector)</td>
227+
</tr>
228+
<tr>
229+
<td><a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.Workplane.shells">CQ.shells</a>(selector)</td>
230+
<td><a target="_blank" href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.selectors.TypeSelector">TypeSelector</a>(typeString)</td>
231+
</tr>
232+
</table>
233+
</div>
164234
<div class="section">
165235
<h2>Named Planes</h2><br />
166-
<i></i>Direction references refer to the global directions.</i>
236+
<div class="section-subtitle">Direction references refer to the global directions.</div>
167237
<table style="width:100%;">
168238
<tr>
169239
<th style="width:25%;">Name</th>
@@ -227,6 +297,7 @@ <h2>Named Planes</h2><br />
227297
</tr>
228298
</table>
229299
</div>
300+
230301
<div class="section" hidden>
231302
<h2>Core Classes</h2><br />
232303
<table style="width:100%;">
@@ -248,80 +319,13 @@ <h2>Core Classes</h2><br />
248319
</tr>
249320
</table>
250321
</div>
251-
<div class="section">
252-
<h2>Selector String Modifiers</h2><br />
253-
Selectors are a complex topic: see <a href="https://cadquery.readthedocs.io/en/latest/selectors.html">CadQuery String Selectors</a> for more information.<br />
254-
Axis Strings are: X, Y, Z, XY, YZ, XZ
255-
<table style="width:100%;">
256-
<tr>
257-
<th style="width:10%;">Modifier</th>
258-
<th style="width:90%;">Description</th>
259-
</tr>
260-
<tr>
261-
<td>&#124;</td>
262-
<td>Parallel to (same as <a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.ParallelDirSelector">ParallelDirSelector</a>). Can return multiple objects.</td>
263-
</tr>
264-
<tr>
265-
<td>&#35;</td>
266-
<td>Perpendicular to (same as <a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.PerpendicularDirSelector">PerpendicularDirSelector</a>)</td>
267-
</tr>
268-
<tr>
269-
<td>&#43;</td>
270-
<td>Positive direction (same as <a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.DirectionSelector">DirectionSelector</a>)</td>
271-
</tr>
272-
<tr>
273-
<td>&#45;</td>
274-
<td>Negative direction (same as <a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.DirectionSelector">DirectionSelector</a>)</td>
275-
</tr>
276-
<tr>
277-
<td>&gt;</td>
278-
<td>Maximize (same as <a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.DirectionMinMaxSelector">DirectionMinMaxSelector</a> with directionMax=True)</td>
279-
</tr>
280-
<tr>
281-
<td>&lt;</td>
282-
<td>Minimize (same as <a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.DirectionMinMaxSelector">DirectionMinMaxSelector</a> with directionMax=False)</td>
283-
</tr>
284-
<tr>
285-
<td>&#37;</td>
286-
<td>Curve/surface type (same as <a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.TypeSelector">TypeSelector</a>)</td>
287-
</tr>
288-
</table>
289-
</div>
290-
<div class="section">
291-
<h2>Selector Methods</h2><br />
292-
CadQuery selector strings allow filtering various types of object lists.
293-
Most commonly, Edges, Faces, and Vertices are used, but all objects types can be filtered.<br />
294-
<table style="width:100%;">
295-
<tr>
296-
<th style="width:40%;">Selector Methods</th>
297-
<th style="width:60%;">Selector Classes
298-
</th>
299-
</tr>
300-
<tr>
301-
<td><a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.Workplane.faces">CQ.faces</a>(selector)</td>
302-
<td><a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.selectors.NearestToPointSelector">NearestToPointSelector</a>(pnt)</td>
303-
<tr>
304-
<td><a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.Workplane.edges">CQ.edges</a>(selector)</td>
305-
<td><a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.selectors.ParallelDirSelector">ParallelDirSelector</a>(vector)</td>
306-
</tr>
307-
<tr>
308-
<td><a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.Workplane.vertices">CQ.vertices</a>(selector)</td>
309-
<td><a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.selectors.DirectionSelector">DirectionSelector</a>(vector)</td>
310-
</tr>
311-
<tr>
312-
<td><a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.Workplane.solids">CQ.solids</a>(selector)</td>
313-
<td><a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.selectors.DirectionMinMaxSelector">DirectionMinMaxSelector</a>(vector)</td>
314-
</tr>
315-
<tr>
316-
<td><a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.Workplane.shells">CQ.shells</a>(selector)</td>
317-
<td><a href="https://cadquery.readthedocs.io/en/latest/classreference.html#cadquery.selectors.TypeSelector">TypeSelector</a>(typeString)</td>
318-
</tr>
319-
</table>
320-
</div>
321-
<div class="section">
322+
323+
<div class="section" style="max-width: 600px">
322324
<h2>Examples of Filtering Faces</h2><br />
323-
All types of filters work on faces. In most cases, the selector refers to the direction of the normal vector of the face.
324-
If a face is not planar, selectors are evaluated at the center of mass of the face. This can lead to results that are quite unexpected.
325+
<div class="section-subtitle">
326+
All types of filters work on faces. In most cases, the selector refers to the direction of the normal vector of the face.
327+
If a face is not planar, selectors are evaluated at the center of mass of the face. This can lead to results that are quite unexpected.
328+
</div>
325329
<table style="width:100%;">
326330
<tr>
327331
<th style="width:10%;">Selector</th>
@@ -373,10 +377,12 @@ <h2>Examples of Filtering Faces</h2><br />
373377
</tr>
374378
</table>
375379
</div>
376-
<div class="section">
380+
<div class="section" style="max-width: 600px">
377381
<h2>Examples of Filtering Edges</h2><br />
378-
Some filter types are not supported for edges. The selector usually refers to the direction of the edge.
379-
Non-linear edges are not selected for any selectors except type (%). Non-linear edges are never returned when these filters are applied.
382+
<div class="section-subtitle">
383+
Some filter types are not supported for edges. The selector usually refers to the direction of the edge.
384+
Non-linear edges are not selected for any selectors except type (%). Non-linear edges are never returned when these filters are applied.
385+
</div>
380386
<table style="width:100%;">
381387
<tr>
382388
<th style="width:10%;">Selector</th>
@@ -428,27 +434,34 @@ <h2>Examples of Filtering Edges</h2><br />
428434
</tr>
429435
</table>
430436
</div>
431-
<div class="section">
437+
<div class="section" style="max-width: 600px">
432438
<h2>Examples of Filtering Vertices</h2><br />
433-
Only a few of the filter types apply to vertices. The location of the vertex is the subject of the filter.
439+
<div class="section-subtitle">Only a few of the filter types apply to vertices. The location of the vertex is the subject of the filter.</div>
434440
<table style="width:100%;">
435441
<tr>
436442
<th style="width:10%;">Selector</th>
437443
<th style="width:40%;">Selector Class</th>
438444
<th style="width:40%;">Selects</th>
439-
<th style="width:10%;"># Objects Returned</th>
440445
</tr>
441446
<tr>
442447
<td>&gt;Y</td>
443448
<td>DirectionMinMaxSelector</td>
444-
<td>Vertices farthest in the positive y dir</td>
445-
<td>0 or 1</td>
449+
<td>Vertices farthest in the +Y dir</td>
446450
</tr>
447451
<tr>
448452
<td>&lt;Y</td>
449453
<td>DirectionMinMaxSelector</td>
450-
<td>Vertices farthest in the negative y dir</td>
451-
<td>0 or 1</td>
454+
<td>Vertices farthest in the -Y dir</td>
455+
</tr>
456+
<tr>
457+
<td>&gt;&gt;Y[-2]</td>
458+
<td>CenterNthSelector</td>
459+
<td>2nd farthest vertex in the +Y dir</td>
460+
</tr>
461+
<tr>
462+
<td>&lt;&lt;Y[0]</td>
463+
<td>CenterNthSelector</td>
464+
<td>1st closest vertex in the Y dir</td>
452465
</tr>
453466
</table>
454467
</div>

0 commit comments

Comments
 (0)