Files
cadquery/doc/apireference.rst

213 lines
3.9 KiB
ReStructuredText
Raw Normal View History

2013-04-15 21:22:54 -04:00
.. _apireference:
***********************
CadQuery API Reference
***********************
2020-06-22 08:42:16 +02:00
The CadQuery API is made up of 2 main objects:
2015-11-28 21:05:20 -05:00
2021-08-20 15:44:42 +03:00
* **Workplane** -- Wraps a topological entity and provides a 2D modelling context.
2015-11-28 21:05:20 -05:00
* **Selector** -- Filter and select things
2013-04-23 20:33:39 -04:00
2015-11-28 21:05:20 -05:00
This page lists methods of these objects grouped by **functional area**
2013-04-15 21:22:54 -04:00
.. seealso::
This page lists api methods grouped by functional area.
Use :ref:`classreference` to see methods alphabetically by class.
Initialization
----------------
2015-12-01 22:54:36 -05:00
.. currentmodule:: cadquery
2013-04-23 20:33:39 -04:00
2013-04-15 21:22:54 -04:00
Creating new workplanes and object chains
.. autosummary::
Workplane
.. _2dOperations:
2021-08-20 15:44:42 +03:00
2D Operations
2013-04-15 21:22:54 -04:00
-----------------
2021-08-20 15:44:42 +03:00
Creating 2D constructs that can be used to create 3D features.
2015-11-28 21:05:20 -05:00
2021-08-20 15:44:42 +03:00
All 2D operations require a **Workplane** object to be created.
2013-04-15 21:22:54 -04:00
2015-12-01 22:54:36 -05:00
.. currentmodule:: cadquery
2013-04-15 21:22:54 -04:00
.. autosummary::
2015-12-01 22:54:36 -05:00
Workplane.center
2013-04-15 21:22:54 -04:00
Workplane.lineTo
Workplane.line
Workplane.vLine
Workplane.vLineTo
Workplane.hLine
Workplane.hLineTo
Workplane.polarLine
Workplane.polarLineTo
2013-04-15 21:22:54 -04:00
Workplane.moveTo
Workplane.move
Workplane.spline
2019-06-15 16:50:54 +02:00
Workplane.parametricCurve
2021-03-21 18:47:10 +01:00
Workplane.parametricSurface
2013-04-15 21:22:54 -04:00
Workplane.threePointArc
2019-06-15 16:50:54 +02:00
Workplane.sagittaArc
Workplane.radiusArc
2020-06-22 08:42:16 +02:00
Workplane.tangentArcPoint
2013-04-15 21:22:54 -04:00
Workplane.mirrorY
Workplane.mirrorX
Workplane.wire
Workplane.rect
Workplane.circle
2020-07-12 11:50:37 +02:00
Workplane.ellipse
Workplane.ellipseArc
2013-04-15 21:22:54 -04:00
Workplane.polyline
Workplane.close
Workplane.rarray
2019-06-15 16:50:54 +02:00
Workplane.polarArray
2020-07-12 11:50:37 +02:00
Workplane.slot2D
Workplane.offset2D
2013-04-15 21:22:54 -04:00
.. _3doperations:
2021-08-20 15:44:42 +03:00
3D Operations
2013-04-15 21:22:54 -04:00
-----------------
2021-08-20 15:44:42 +03:00
Some 3D operations also require an active 2D workplane, but some do not.
2015-11-28 21:05:20 -05:00
2021-08-20 15:44:42 +03:00
3D operations that require a 2D workplane to be active:
2013-04-15 21:22:54 -04:00
.. autosummary::
Workplane.cboreHole
Workplane.cskHole
Workplane.hole
Workplane.extrude
Workplane.cut
Workplane.cutBlind
Workplane.cutThruAll
Workplane.box
2019-06-15 16:50:54 +02:00
Workplane.sphere
2021-08-25 16:42:07 +01:00
Workplane.cylinder
2013-04-15 21:22:54 -04:00
Workplane.union
Workplane.combine
2019-06-15 16:50:54 +02:00
Workplane.intersect
Workplane.loft
Workplane.sweep
Workplane.twistExtrude
Workplane.revolve
Workplane.text
2015-11-28 21:05:20 -05:00
2021-08-20 15:44:42 +03:00
3D operations that do NOT require a 2D workplane to be active:
2015-11-28 21:05:20 -05:00
.. autosummary::
2020-06-22 08:42:16 +02:00
Workplane.shell
Workplane.fillet
Workplane.chamfer
Workplane.split
Workplane.rotate
Workplane.rotateAboutCenter
Workplane.translate
Workplane.mirror
2013-04-15 21:22:54 -04:00
2015-11-28 21:05:20 -05:00
File Management and Export
---------------------------------
.. autosummary::
2020-06-22 08:42:16 +02:00
Workplane.toSvg
Workplane.exportSvg
2015-11-28 21:05:20 -05:00
2013-04-15 21:22:54 -04:00
2015-12-01 22:54:36 -05:00
.. autosummary::
importers.importStep
2020-07-12 11:50:37 +02:00
importers.importDXF
2020-07-29 08:52:04 +02:00
exporters.export
2015-12-01 22:54:36 -05:00
2013-04-15 21:22:54 -04:00
Iteration Methods
------------------
Methods that allow iteration over the stack or objects
.. autosummary::
Workplane.each
Workplane.eachpoint
.. _stackMethods:
2015-11-28 21:05:20 -05:00
Stack and Selector Methods
------------------------------
2013-04-15 21:22:54 -04:00
CadQuery methods that operate on the stack
.. autosummary::
2020-06-22 08:42:16 +02:00
Workplane.all
Workplane.size
Workplane.vals
Workplane.add
Workplane.val
Workplane.first
Workplane.item
Workplane.last
Workplane.end
Workplane.vertices
Workplane.faces
Workplane.edges
Workplane.wires
Workplane.solids
Workplane.shells
Workplane.compounds
2013-04-15 21:22:54 -04:00
.. _selectors:
Selectors
------------------------
2015-11-28 21:05:20 -05:00
Objects that filter and select CAD objects. Selectors are used to select existing geometry
as a basis for further operations.
2013-04-15 21:22:54 -04:00
.. currentmodule:: cadquery.selectors
2013-04-15 21:22:54 -04:00
.. autosummary::
2015-11-28 21:05:20 -05:00
NearestToPointSelector
BoxSelector
BaseDirSelector
ParallelDirSelector
DirectionSelector
2017-04-22 00:40:24 +02:00
DirectionNthSelector
LengthNthSelector
AreaNthSelector
2020-11-18 17:26:01 +10:30
RadiusNthSelector
2015-11-28 21:05:20 -05:00
PerpendicularDirSelector
TypeSelector
DirectionMinMaxSelector
2020-12-18 12:15:46 +10:30
CenterNthSelector
2015-11-28 21:05:20 -05:00
BinarySelector
AndSelector
SumSelector
SubtractSelector
InverseSelector
2015-12-01 22:54:36 -05:00
StringSyntaxSelector
.. _assembly:
2020-09-04 13:11:16 +02:00
Assemblies
----------
Workplane and Shape objects can be connected together into assemblies
.. currentmodule:: cadquery
.. autosummary::
Assembly
Assembly.add
Assembly.save
2020-09-07 15:37:13 +02:00
Assembly.constrain
Assembly.solve
2020-09-07 15:37:13 +02:00
Constraint
Color