CadQuery

2.7.0 · active · verified Sun Apr 12

CadQuery is an intuitive, easy-to-use Python module for building parametric 3D CAD models. It provides a fluent API for creating complex shapes and assemblies, leveraging the OpenCASCADE CAD kernel. Currently at version 2.7.0, it maintains an active development cycle with regular bugfix releases and periodic minor version updates.

Warnings

Install

Imports

Quickstart

This quickstart creates a simple rectangular box using the `Workplane` object, which is the primary entry point for 2D sketching and 3D modeling in CadQuery. The generated `result` object can be viewed in `CQ-editor` or exported to various CAD formats like STEP.

import cadquery as cq

# Define dimensions for a simple box
length = 80.0
height = 60.0
thickness = 10.0

# Create a rectangular box starting on the XY plane
result = cq.Workplane("XY").box(length, height, thickness)

# If running in CQ-editor, 'result' will be automatically displayed.
# For headless use or export, you would typically save it:
# cq.exporters.export(result, "my_box.step")

# This line is for testing/headless environments to confirm an object exists
assert result.isValid()

view raw JSON →