Can text-to-cad Handle Complex Geometries? A Technical Analysis of the Cadgen Kernel

Yes, text-to-cad handles complex geometries through its cadgen distribution, which leverages the build123d API for constructive solid geometry operations, parallel build stores for large assemblies, and scalable rendering profiles up to assembly-large sizes.

text-to-cad is an open-source CAD generation framework built on the cadgen distribution, providing a full-featured kernel capable of producing intricate mechanical designs from Python scripts. Whether you need multi-body assemblies with Boolean operations or topologically dense single parts, the earthtojake/text-to-cad architecture supports arbitrarily complex geometries as long as they can be expressed as build123d.Shape objects according to the source code in skills/cad/SKILL.md.

How text-to-cad Processes Complex Geometries Through CSG

The core CAD skill in skills/cad/SKILL.md explains that text-to-cad generates geometry using constructive solid geometry (CSG) primitives and Boolean operations. Because the kernel works on these foundational operations, arbitrarily complex parts—such as multi-body assemblies, intricate fillets, and mirrored components—are fully supported.

The cadgen runtime enforces a "no-parameter" model API, meaning geometry is entirely defined by the Python script itself. As documented in lines 29-34 of the CAD skill definition, any solid or assembly can be emitted regardless of size or topological complexity, provided the final output is a valid build123d.Shape object.


# models/complex_gear/src/gear.py

from cadgen import build123d as bd

# a parametric involute gear with many teeth

@bd.step
def gear():
    # base cylinder

    base = bd.Cylinder(r=20, h=5)

    # create a gear tooth profile (simple rectangle for demo)

    tooth = bd.Box(5, 2, 5)

    # array the teeth around the cylinder

    teeth = bd.Lattice(
        pattern=bd.PolarArray(count=36, radius=20),
        element=tooth,
    )

    # union base and teeth – a complex Boolean assembly

    return base + teeth

This example demonstrates how text-to-cad handles 36 simultaneous Boolean operations to create a complex gear geometry, with the bd.step decorator managing the build process.

Scaling to Large Assemblies with AssemblyHelper

For very large or topologically intricate models, the documentation in skills/cad/SKILL.md (lines 60-73) recommends using the AssemblyHelper class from cadgen.assembly. This utility records child-parent relationships and drives parallel builds, preventing the "one-process-per-model" bottleneck that often limits traditional CAD pipelines.

The AssemblyHelper enables composition workflows where complex products—such as the engine powertrain demonstrated in models/hypercar/src/powertrain.py—can be broken into discrete components, built in parallel, and assembled into a single coherent STEP file.


# Build the STEP file (parallel workers handle the Boolean operations)

python models/complex_gear/src/gear.py   # writes gear.step

Rendering and Inspection of Complex Models

The cadgen distribution provides specialized tools for validating and visualizing complex geometry. According to lines 52-57 of the CAD skill documentation, the system supports large models with dedicated rendering profiles including assembly-large for complex assemblies.

The inspection and snapshot capabilities handle complex geometry without topological limitations, with trade-offs limited strictly to compute time:


# Inspect key metrics (e.g., volume, bounding box)

cadgen step inspect gear.step --facts volume bbox

# Render a high-resolution snapshot for review of dense geometry

cadgen step snapshot gear.step --sizeProfile assembly-large --theme workbench-light

Optimizing Performance with the Warm-Worker Daemon

Compute time for complex geometries is mitigated by the warm-worker daemon (cadgen daemon), which caches intermediate results as documented in lines 70-78 of skills/cad/SKILL.md. This background process maintains a ready pool of build workers, ensuring that subsequent modifications to complex assemblies—such as the multi-part stepped shaft demonstrated in models/examples/src/stepped_shaft_keyway.py—rebuild only changed components rather than reprocessing the entire topological tree.

Summary

  • text-to-cad supports arbitrarily complex geometries through CSG primitives and Boolean operations implemented in the cadgen distribution's build123d API.
  • Complex assemblies benefit from the AssemblyHelper class, which manages child-parent relationships and enables parallel builds for large models.
  • The system defaults to STEP file output but imposes no topological complexity limits on solids or assemblies expressible as build123d.Shape objects.
  • Inspection tools (cadgen step inspect) and snapshot rendering (cadgen step snapshot) support complex geometry with assembly-large size profiles.
  • Performance optimization comes from the warm-worker daemon, which caches intermediate results and reduces rebuild times for iterative design changes.

Frequently Asked Questions

What file format does text-to-cad use for complex geometries?

text-to-cad defaults to STEP files for all output, regardless of geometric complexity. As defined in skills/cad/SKILL.md, the format supports both single solids and complex assemblies without topological constraints, making it compatible with downstream manufacturing and analysis tools.

How does text-to-cad prevent performance bottlenecks with large assemblies?

The system utilizes the AssemblyHelper class from cadgen.assembly to record component relationships and distribute builds across parallel workers. Additionally, the cadgen daemon warm-worker process caches intermediate build states, ensuring that modifications to large assemblies—like those in models/hypercar/src/powertrain.py—do not trigger full rebuilds.

Can text-to-cad handle parametric modifications to complex parts?

Yes, through the no-parameter model API enforced by the cadgen runtime. While the API itself is "no-parameter" at the runtime level, Python scripts define geometry parametrically using the build123d library. Changes to script variables regenerate the entire CSG tree, producing updated STEP files with new Boolean operations and topological relationships.

Are there rendering limitations for very complex geometries in text-to-cad?

The only limitation is compute time, not topological complexity. The system provides scalable rendering profiles including assembly-large for dense geometries, and the snapshot command supports high-resolution output. Resource requirements scale with model intricacy, but the architecture imposes no hard caps on vertex counts or Boolean operation depth.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →