From 0abb33c6ebd45ea21f3668ad0ad1d5ff1dae3dfc Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Wed, 23 Jul 2014 00:33:34 -0400 Subject: [PATCH] Fixed some CSS issues and added more information on selectors. --- doc/cheatsheet/cadquery_cheatsheet.html | 248 ++++++++++++++++++++---- 1 file changed, 205 insertions(+), 43 deletions(-) diff --git a/doc/cheatsheet/cadquery_cheatsheet.html b/doc/cheatsheet/cadquery_cheatsheet.html index a63720c..f164387 100644 --- a/doc/cheatsheet/cadquery_cheatsheet.html +++ b/doc/cheatsheet/cadquery_cheatsheet.html @@ -27,10 +27,10 @@ -
+

Documentation

-

BREP Terminology


- +
- - + + - - + + - - + + - - + + - - + + - - + + - - + +
vertexA single point in spacevertexA single point in space
edgeA connection between two or more vertices along a particular path (called a curve)edgeA connection between two or more vertices along a particular path (called a curve)
wireA collection of edges that are connected togetherwireA collection of edges that are connected together
faceA set of edges or wires that enclose a surfacefaceA set of edges or wires that enclose a surface
shellA collection of faces that are connected together along some of their edgesshellA collection of faces that are connected together along some of their edges
solidA shell that has a closed interiorsolidA shell that has a closed interior
compoundA collection of solidscompoundA collection of solids

Named Planes


- Available named planes are as follows.
- Direction references refer to the global
- directions. - + Available named planes are as follows. Direction references refer to the global directions. +
- - - - + + + + @@ -139,43 +137,207 @@
NamexDiryDirzDirNamexDiryDirzDir
XY
-
+
+
+

Selector Methods


+ CadQuery selector strings allow filtering various types of object lists. + Most commonly, Edges, Faces, and Vertices are used, but all objects types can be filtered.
+ + + + + + + + + + + + + + + + + + + + + + + + +
Selector MethodDescription
CQ.faces(selector=None)Select the faces of objects on the stack, optionally filtering the selection.
CQ.edges(selector=None)Select the edges of objects on the stack, optionally filtering the selection.
CQ.vertices(selector=None)Select the vertices of objects on the stack, optionally filtering the selection.
CQ.solids(selector=None)Select the solids of objects on the stack, optionally filtering the selection.
CQ.shells(selector=None)Select the shells of objects on the stack, optionally filtering the selection.
+

Selector String Modifiers


Selectors are a complex topic: see CadQuery String Selectors for more information.
Axis Strings are: X, Y, Z, XY, YZ, XZ - +
- - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + +
ModifierDescriptionModifierDescription
|Parallel to (same as ParallelDirSelector). Can return multiple objects.|Parallel to (same as ParallelDirSelector). Can return multiple objects.
#Perpendicular to (same as PerpendicularDirSelector)#Perpendicular to (same as PerpendicularDirSelector)
+Positive direction (same as DirectionSelector)+Positive direction (same as DirectionSelector)
-Negative direction (same as DirectionSelector)-Negative direction (same as DirectionSelector)
>Maximize (same as DirectionMinMaxSelector with directionMax=True)>Maximize (same as DirectionMinMaxSelector with directionMax=True)
<Minimize (same as DirectionMinMaxSelector with directionMax=False)<Minimize (same as DirectionMinMaxSelector with directionMax=False)
%Curve/surface type (same as TypeSelector)%Curve/surface type (same as TypeSelector)
+
+
+

Examples of Filtering Faces


+ All types of filters work on faces. In most cases, the selector refers to the direction of the normal vector of the face. + 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. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SelectorSelector ClassSelects# Objects Returned
+ZDirectionSelectorFaces with normal in +z direction0 or 1
|ZParallelDirSelectorFaces parallel to xy plane0..many
-XDirectionSelectorFaces with normal in neg x direction0..many
#ZPerpendicularDirSelectorFaces perpendicular to z direction0..many
%PlaneTypeSelectorFaces of type plane0..many
>YDirectionMinMaxSelectorFace farthest in the positive y dir0 or 1
<YDirectionMinMaxSelectorFace farthest in the negative y dir0 or 1
+
+
+

Examples of Filtering Edges


+ Some filter types are not supported for edges. The selector usually refers to the direction of the edge. + Non-linear edges are not selected for any selectors except type (%). Non-linear edges are never returned when these filters are applied. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SelectorSelector ClassSelects# Objects Returned
+ZDirectionSelectorEdges aligned in the Z direction0..many
|ZParallelDirSelectorEdges parallel to z direction0..many
-XDirectionSelectorEdges aligned in neg x direction0..many
#ZPerpendicularDirSelectorEdges perpendicular to z direction0..many
%PlaneTypeSelectorEdges type line0..many
>YDirectionMinMaxSelectorEdges farthest in the positive y dir0 or 1
<YDirectionMinMaxSelectorEdges farthest in the negative y dir0 or 1
+
+
+

Examples of Filtering Vertices


+ Only a few of the filter types apply to vertices. The location of the vertex is the subject of the filter. + + + + + + + + + + + + + + + + + +
SelectorSelector ClassSelects# Objects Returned
>YDirectionMinMaxSelectorVertices farthest in the positive y dir0 or 1
<YDirectionMinMaxSelectorVertices farthest in the negative y dir0 or 1