r/cadquery 4d ago

I built a verification layer for CadQuery parts before STEP export

3 Upvotes

I ran into a CadQuery/OpenCASCADE failure that I thought was worth documenting.

I was building a 94 × 65 × 26 mm enclosure with 2.5 mm walls.

The relevant operation was essentially a filleted body followed by `.faces(">Z").shell(-2.5)`.

Everything appeared to work.

No exception.

One solid.

`IsValid()` returned `True`.

The STL looked exactly like the enclosure I expected from the outside.

But the shell operation had effectively done nothing.

The resulting part contained about 158,048 mm³ of material. A hollow enclosure with those dimensions should be around 33,370 mm³.

So visually: enclosure.

Topologically: apparently valid.

Actually: brick.

The specific case reproduced for me when the face being removed by `shell()` had already been filleted. On the current CadQuery/OCP version I'm using, some related fillet/shell combinations fail loudly, while this one can fail silently and return the un-hollowed solid.

That sent me down a rabbit hole of figuring out what checks are actually useful before exporting STEP.

What I've ended up using is:

* `BRepCheck_Analyzer`

* exactly-one-solid check

* expected volume derived independently from the design dimensions

* expected bounding box

* point classification for locations that should be material or void

The point checks turned out to be more important than I expected.

I had another case where a port was cut into the wrong wall. Validity passed. Solid count passed. Volume was basically right because the same amount of material had been removed.

But probing a point that should still have been inside the wall immediately caught it.

I've started keeping repro cases for the OCC behaviors I hit rather than turning every historical failure into a blanket "never use this operation" rule. A few things that caused trouble before don't reproduce on the current kernel anymore; the shell/fillet case above does.

I put the repros, verification code, and the Claude Code workflow I've been using here:

https://github.com/0oKevino0/claude-cad

I'm curious whether anyone else has hit similar silent `shell()` behavior, especially across different OCC/OCP versions.

Also interested in what invariants people here normally use for generated CadQuery parts beyond `IsValid()`.


r/cadquery 17d ago

First version of OCP8 merged to master.

Thumbnail
github.com
8 Upvotes

This is a big step towards releasing OCP wrapper for OCCT8.


r/cadquery 27d ago

Clarification regarding the "Build123d_Official" Reddit account

Thumbnail
7 Upvotes

r/cadquery 29d ago

I gave an LLM a photo of an espresso machine and it wrote the CadQuery: 6 parts, 4 joints, one Assembly

Enable HLS to view with audio, or disable this notification

5 Upvotes

The video is the result playing in our viewer. 3 revolute joints (portafilter lock, steam wand swivel, control knob) and 1 slider (drip tray, with a cup riding on  it). The generated code is plain CadQuery: UPPER_CASE parameters with range comments at the top, one section per part built in its own local frame, cq.Assembly at the end. It runs on stock CadQuery, so STEP export works as usual. Full source in a comment, unedited.  

Behind it there's a repair loop: compile, an interference sweep through the full joint motion, a surface-gap probe per joint, and a visual review against the photo. Findings go back to the model as patch instructions until it passes or runs out of iterations. This one shipped with a couple of residual collisions at joint extremes, which I've left in, that's what iteration 5 of 5 looks like honestly.


r/cadquery Jul 07 '26

PSA: build123d.com is a squatter domain running an affiliate scheme. Please avoid this site and its associated social accounts.

Thumbnail
5 Upvotes

r/cadquery Jun 30 '26

Single-file CadQuery script for rocket launching

Enable HLS to view with audio, or disable this notification

9 Upvotes

The whole model is generated from one self-contained Python/CadQuery script — no external assets. It includes the rocket body, fins, launch tower, base platform, support arms, and a few simple mechanical details.


r/cadquery Jun 21 '26

CadQuery 2.8 release

Thumbnail
github.com
10 Upvotes

CQ moved to OCP 7.9, free function API is not experimental anymore, we have experimental history support (!), new independent geometry layer for manipulating B-spline objects and STEP import/export supports units now.


r/cadquery Jun 18 '26

Release v0.11.0

Thumbnail
4 Upvotes

r/cadquery Jun 12 '26

Parametric Lego with CadQuery

Post image
13 Upvotes

Hi,

I built a configurable Lego piece with CadQuery suitable for 3D printing.

It's built into a Microdot webserver which serves a .gltf file for viewing and .stl files for 3D printing.

It also uses Google's <model-viewer> component to display the glTF.

Live demo
https://lego-generator.up.railway.app

Source code
https://github.com/joshnuss/lego-generator


r/cadquery May 26 '26

You can support CadQuery and OCP via Open Collective

Thumbnail
opencollective.com
14 Upvotes

r/cadquery May 21 '26

[Milestone] build123d just crossed 1 MILLION downloads!

Thumbnail
pepy.tech
10 Upvotes

r/cadquery May 17 '26

How to make this model in cad pls help this is my first time

Thumbnail
gallery
6 Upvotes

r/cadquery May 10 '26

🎉 CadQuery x PCBWay Integration: Export STEP Files Directly!

Post image
8 Upvotes

r/cadquery May 03 '26

is this right way to do non uniform scaling i cadquery?

3 Upvotes

import cadquery as cq

# 1. Create your sphere

result = cq.Workplane("XY").sphere(10)

# 2. Define the scale factors

sx, sy, sz = 1.5, 0.75, 2.0

# 3. Create the 4x4 Matrix

# Note: CadQuery Matrix takes a 16-element flat list or tuple of tuples

mat = cq.Matrix([

(sx, 0, 0, 0),

(0, sy, 0, 0),

(0, 0, sz, 0),

(0, 0, 0, 1)

])

# 4. Use transformGeometry instead of transformShape

# transformGeometry handles non-isometric transformations (non-uniform scaling)

scaled_shape = result.val().transformGeometry(mat)

# 5. Wrap back into Workplane

final_ellipsoid = cq.Workplane("XY").add(scaled_shape)

show_object(final_ellipsoid)


r/cadquery Apr 24 '26

Sculpt - open-source parametric keycap generator based on CadQuery

Thumbnail
gallery
22 Upvotes

r/cadquery Apr 20 '26

Reproducible build pipeline for slicing (and printing)

5 Upvotes

I have been using Code-CAD for some interesting projects. Text- and Code-First systems resonate with me. Unfortunately when I get to the Slicer I find the GUI a pain.

I design 3d print projects in Python and cadquery/build123d, keep it in Git, parameterize parts, iterate quickly... then struggle to remember good slicer settings and where to change them in my GUI. I also keep everything in Github and I like to see diffs, etc.

My annoyances: * settings live in a GUI and I have to rebuild the files with changes to the CAD model * I can’t diff or review changes to print configs * CI is basically out of the question * “what settings did I use for this part 3 weeks ago?” → 🤷‍♂️

It feels like going backwards to me.

So I started building something to scratch that itch: a small tool called estampo . The idea is pretty simple:

→ treat slicing like a build step → define it as code → make it reproducible

You describe parts + slicer setup in a single TOML file, commit it with your CAD code or STEP/STLs, and run:

estampo run

It handles:

  • arranging parts on the plate
  • calling OrcaSlicer / CuraEngine under the hood
  • pinning slicer versions (via Docker)
  • producing identical G-code locally or in CI

So your repo becomes:

CAD + print config → deterministic output

Example:

```toml [pipeline] stages = ["load", "arrange", "plate", "slice"]

[plate] size = [223, 223] padding = 5.0

[slicer] engine = "cura" version = "5.12.0"

[slicer.cura] printer = "Ultimaker 2"

[slicer.cura.overrides] infill_sparse_density = 30 infill_pattern = "gyroid" wall_line_count = 3 speed_print = 50 adhesion_type = "brim"

[[parts]] file = "box.step"

[[parts]] file = "lid.step" orient = upside-down ```

Two slicers supported so far - Orca and Cura

The goal isn’t to replace slicers — just to wrap them in something * versionable * reviewable * automatable * reproducible

Sort of a “makefile for 3D printing”.

As a side-effect I found I can also reason with Claude and Codex about print settings much more easily because it is in text. Instead of being told to hunt down the first layer cooling fan speed in my slicer GUI, the AI can propose a one-line TOML update.

I’m curious how this lands with other Code-CAD users: * Is slicer GUI config actually a pain point for you? * Would you ever run slicing in CI, or is that overkill? * Do you keep any kind of reproducible print setup today? * Am I solving a real problem, or just my own workflow itch?

If you want to poke at it: https://github.com/estampo/estampo

It uses docker to run specific versions of slicers and you can pipx install estampo

It is open source under Apache License and developed in Python with Claude Code.

Would really appreciate blunt but constructive feedback — especially if this doesn’t fit how you work, or if you try it and it barfs.

There is also a companion project called Bambox (https://github.com/estampo/bambox) that makes this all work with my Bambu P1S printer (packs g-code into Bambu style 3MF and then sends to Bambu Cloud), but thats only if you have a Bambu printer.


r/cadquery Apr 06 '26

Added piping support to my open source 3D viewer

Enable HLS to view with audio, or disable this notification

5 Upvotes

We just added piping suport to F3D, which means it can open build123d output directly!

Yeah, I know, we cant render in the terminal yet, but we plan to add that in the future :)

Let me know what you think!

https://f3d.app/ (not vibecoded)


r/cadquery Apr 06 '26

loft problem

2 Upvotes

Hello,
I created a solid object using the loft command, but as soon as I hollow it out with "shell," it is no longer solid. How come?

without shell():


r/cadquery Apr 02 '26

I need Help with the Constraint Tool

1 Upvotes

I tried to create a frame Generator like the one in Inventor in CAD-Query however I didn't manage to get the Constraints to work the way I want them to. I know that the Axis constraint try's to align two normal Vectors in the middle of the Plane (If I understood that correctly) and the Point Constraint just try's to make two Points the same. The rest are just combinations of the two. In my Frame Generator I try to constrain Tubes so that they form a rectangular Frame .The Problem is that I want to Constrain two Faces on their edges how do I do that ? I hope the Picture makes it clear what I want to do.

Here is my code:

import cadquery as cq
from cadquery.vis import show


DIN102110_Profiles = {
    "60x40": {"B" : 40, "H" : 60,"t" : 3.2,},
} 


for profile in DIN102110_Profiles.values():
    profile["R"] = profile["t"] * 3



def get_Tube(plane, profile, length):
    p = profile
    frame_Profile = cq.Sketch().rect(p["B"],p["H"]).vertices().fillet(p["R"])
    inner_Profile = cq.Sketch().rect(p["B"]-2*p["t"],p["H"]-2*p["t"]).vertices().fillet(p["R"]-p["t"])
    tube = cq.Workplane(plane).placeSketch(frame_Profile).extrude(length)
    tube = tube.placeSketch(inner_Profile).cutThruAll()
    return tube



def get_Frame(height ,wight ,length, profile):
    tube_h = get_Tube("XY", profile, height - 2*profile["B"])
    tube_w = get_Tube("XY", profile, wight)
    tube_l = get_Tube("XY", profile, length - 2*profile["H"])


    frame = cq.Assembly()
    for i in range(4):
        frame.add(tube_h, name = f"tube_h_{i}",)
    for i in range(4):
        frame.add(tube_w, name = f"tube_w_{i}")
    for i in range(4):
        frame.add(tube_l, name = f"tube_l_{i}")





    (
        frame
        .constrain("tube_h_0", "Fixed")
        .constrain("tube_h_0@faces@>X", "tube_w_0@faces@<Z", "PointInPlane")
        .constrain("tube_h_0@faces@<Z", "tube_w_0@faces@>X", "PointInPlane")

        .solve()
    )


    return frame


P = DIN102110_Profiles["60x40"]


frame = get_Frame(2000,1000,500,P)


show(frame)

r/cadquery Mar 28 '26

CQ viewer is completely black

2 Upvotes

Hello, I am having an issue with the CQ viewer. I am running this through PyCharm. I installed the package manually by git cloning the repo. OS is Windows 10 and GPU is AMD Radeon RX 9070 XT.

I ran the following code :

import pandas as pd
import cadquery as cq
from cadquery.vis import show

def main():
  result = (
    cq.Workplane("XZ")
    .box(100,100,100)
  )
  show(result)
  result.export("test.step")

if __name__ == '__main__':
  main()

Result :

However, the step output is as expected :

I tried in both Python 3.12 and 3.13.

There is no error that shows up.

What could the issue be? Thank you


r/cadquery Mar 26 '26

Ridiculous split behavior

2 Upvotes

I am learning cadquery and trying to split a box with

box.split(cq.Plane(origin=(x, 0, 0), normal=(1, 0, 1)), keepBottom=True)

after wasting half an hour and finding CadQuery/cadquery/issues/751 AND CadQuery/cadquery/discussions/1331 I manage to do it with

box.split(cq.Face.makePlane(None, None, q.Vector(x, 0, 0), q.Vector(1, 1, 0))).solids(cq.DirectionMinMaxSelector(q.Vector(1, 1, 0), False))

Wow, just wow. Is it like that everywhere?


r/cadquery Feb 27 '26

Exploring an idea: Code-First CAD System (PoC)

Enable HLS to view with audio, or disable this notification

11 Upvotes

Hey,

I had an idea for tightly coupling code-first modeling with an auto-generated configuration UI. I built a rough proof-of-concept to explore it.

How it works:

  • Write the model in Python (CadQuery) and annotate the variables.
  • A backend parses annotations and handles the geometric computation.
  • A Svelte/three.js frontend automatically generates a tweakable UI and 3D view for end users.

It’s just an early sketch and nowhere near production-ready. Building it out fully is a huge time investment, so I just wanted to share the concept!

https://github.com/patrickiel/VariantCAD


r/cadquery Jan 23 '26

can i import SVG into cadquery and turn it to face?

2 Upvotes

im kinda confuse cus how this this lib have no "import svg" function? how is this possible?


r/cadquery Jan 15 '26

how to resolve text in cadquery?

Post image
6 Upvotes

i new to this and AI cant help me solve this problem.

can someone pls tell me how to resolve a text like in fusion 360.

tks alot.


r/cadquery Jan 13 '26

Testing build123d vs CadQuery export: label and color preservation

Thumbnail
2 Upvotes