About

What is cqparts?

cqparts is CAD for Python programmers, short for cadquery parts.

Using cqparts you can wrap geometry made with cadquery to build complex and deeply parametric models.

What can it do?

You can build solid geometry in the same way you write an application; your geometry can be built on a headless system, automated, and revision controlled to your hearts content.

You can also export your models ready to be processed for 3D printing, milling, or to be displayed / imported to another application.

Examples

A Cube

The "Hello World" of 3D geometry:


import cadquery
import cqparts
from cqparts.params import PositiveFloat

class Cube(cqparts.Part):
    size = PositiveFloat(1, doc="length along one side")

    def make(self):
      return cadquery.Workplane('XY').box(
          self.size, self.size, self.size,
          centered=(True, True, False),
      )

# Create an instance
my_cube = Cube(size=10)  # changed size to 10

# Dispaly it
from cqparts.display import display
display(my_cube)
  

The cqparts documentation has a much more comprehensive set of simple examples to get you started.

Parts Library

All the models below are python programs just like the cube above.

They have the full power of Python and any imported libraries to use when building the geometry.

Select any of the following examples for a 3D render of the object, and links to their source code.


Everything Else

Real World

Install

Pre-requisites

cadquery
python -m pip install cadquery
For more detailed instructions, visit the cadquery documentation.

PyPI

python -m pip install cqparts

Documentation

cqparts Documentation
cadquery Documentation

License

Apache License 2.0

"A permissive license whose main conditions require preservation of copyright and license notices. Contributors provide an express grant of patent rights. Licensed works, modifications, and larger works may be distributed under different terms and without source code."

Please see the LICENSE file distributed with cqparts for the full license agreement.

Development

dev instructions here

WebAPI

The cool thing about the cqparts_webapi is that it built this website.