yapCAD 0.5.0__tar.gz → 0.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- yapcad-0.5.1/.github/workflows/python-package.yml +42 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/.gitignore +20 -2
- {yapcad-0.5.0 → yapcad-0.5.1}/CHANGELOG.rst +45 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/PKG-INFO +60 -14
- {yapcad-0.5.0 → yapcad-0.5.1}/README.md +50 -13
- {yapcad-0.5.0 → yapcad-0.5.1}/README.rst +56 -13
- {yapcad-0.5.0 → yapcad-0.5.1}/docs/README.rst +56 -13
- yapcad-0.5.1/docs/images/RocketCutawaySTEP.png +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/docs/index.rst +23 -13
- yapcad-0.5.1/docs/mesh_validation.md +66 -0
- yapcad-0.5.1/docs/solid_boolean_roadmap.md +73 -0
- yapcad-0.5.1/examples/rocket_cutaway_internal.py +190 -0
- yapcad-0.5.1/examples/rocket_grid_demo.py +177 -0
- yapcad-0.5.1/examples/solid_boolean_demo.py +103 -0
- yapcad-0.5.1/examples/topology_demo.py +180 -0
- yapcad-0.5.1/images/RocketCutawaySTEP.png +0 -0
- yapcad-0.5.1/pyocc-validate.py +60 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/pyproject.toml +5 -1
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapCAD.egg-info/PKG-INFO +60 -14
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapCAD.egg-info/SOURCES.txt +29 -1
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapCAD.egg-info/requires.txt +4 -0
- yapcad-0.5.1/src/yapcad/boolean/__init__.py +21 -0
- yapcad-0.5.1/src/yapcad/boolean/native.py +1012 -0
- yapcad-0.5.1/src/yapcad/boolean/trimesh_engine.py +155 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/combine.py +52 -14
- yapcad-0.5.1/src/yapcad/drawable.py +1062 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/geom.py +116 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/geom3d.py +237 -7
- yapcad-0.5.1/src/yapcad/geom3d_util.py +997 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/geom_util.py +160 -61
- yapcad-0.5.1/src/yapcad/io/__init__.py +6 -0
- yapcad-0.5.1/src/yapcad/io/step.py +323 -0
- yapcad-0.5.1/src/yapcad/spline.py +232 -0
- yapcad-0.5.1/tests/test_boolean_2d.py +240 -0
- yapcad-0.5.1/tests/test_boolean_regression.py +89 -0
- yapcad-0.5.1/tests/test_extrusion.py +100 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/tests/test_geom.py +2 -1
- {yapcad-0.5.0 → yapcad-0.5.1}/tests/test_geom3d.py +296 -2
- yapcad-0.5.1/tests/test_geom3d_primitives.py +116 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/tests/test_geom_util.py +3 -2
- {yapcad-0.5.0 → yapcad-0.5.1}/tests/test_geometry.py +2 -3
- yapcad-0.5.1/tests/test_io_step.py +71 -0
- yapcad-0.5.1/tests/test_mesh_view.py +201 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/tests/test_octtree.py +2 -1
- yapcad-0.5.1/tests/test_poly2surface_orientation.py +177 -0
- yapcad-0.5.1/tests/test_solid_spatial.py +170 -0
- yapcad-0.5.1/tests/test_splines.py +138 -0
- yapcad-0.5.1/tools/analyze_vertices.py +231 -0
- yapcad-0.5.1/tools/diagnose_boolean.py +66 -0
- yapcad-0.5.1/tools/diagnose_primitive.py +82 -0
- yapcad-0.5.1/tools/find_func.py +42 -0
- yapcad-0.5.1/tools/mesh_diagnostics.py +107 -0
- yapcad-0.5.1/tools/validate_mesh.py +353 -0
- yapcad-0.5.0/src/yapcad/drawable.py +0 -684
- yapcad-0.5.0/src/yapcad/geom3d_util.py +0 -541
- yapcad-0.5.0/src/yapcad/io/__init__.py +0 -5
- yapcad-0.5.0/tests/test_mesh_view.py +0 -122
- yapcad-0.5.0/tests/test_poly2surface_orientation.py +0 -83
- {yapcad-0.5.0 → yapcad-0.5.1}/.coveragerc +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/.readthedocs.yml +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/AUTHORS.rst +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/LICENSE +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/LICENSE.txt +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/docs/Makefile +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/docs/_static/.gitignore +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/docs/authors.rst +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/docs/changelog.rst +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/docs/conf.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/docs/images/RocketDemoScreenshot.png +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/docs/images/laserbox.jpg +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/docs/images/yapCadSplash.png +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/docs/license.rst +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/docs/requirements.txt +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/docs/yapCADfoundations.md +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/docs/yapCADone.md +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/dxf/README.md +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/dxf/README.rst +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/dxf/boxout.dxf +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/dxf/example1-out.dxf +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/dxf/example10-out.dxf +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/dxf/example3-out.dxf +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/dxf/example4-out.dxf +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/dxf/example5-out.dxf +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/dxf/example6-out.dxf +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/dxf/example7-out.dxf +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/dxf/example8-out.dxf +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/README.md +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/README.rst +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/boxcut/README.md +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/boxcut/README.rst +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/boxcut/boxcut.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/example1.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/example10.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/example11.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/example12.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/example13.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/example2.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/example3.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/example4.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/example5.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/example6.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/example7.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/example8-gl.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/example8.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/example9.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/examples/rocket_demo.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/images/README.md +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/images/README.rst +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/images/RocketDemoScreenshot.png +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/images/example6-out.png +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/images/example8-out.png +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/images/yapCAD01.png +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/images/yapCAD02.png +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/images/yapCadSplash.png +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/pytest.ini +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/requirements.txt +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/run_visual_tests.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/run_visual_tests_venv.sh +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/setup.cfg +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/setup.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapCAD.egg-info/dependency_links.txt +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapCAD.egg-info/not-zip-safe +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapCAD.egg-info/top_level.txt +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/__init__.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/ezdxf_drawable.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/geometry.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/geometry_checks.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/geometry_utils.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/io/stl.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/mesh.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/metadata.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/octtree.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/poly.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/pyglet_drawable.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/triangulator.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/src/yapcad/xform.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/tests/conftest.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/tests/test_geometry_checks.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/tests/test_geometry_utils.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/tests/test_geomlist_snap.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/tests/test_io_stl.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/tests/test_metadata_utils.py +0 -0
- {yapcad-0.5.0 → yapcad-0.5.1}/tests/test_xform.py +0 -0
@@ -0,0 +1,42 @@
|
|
1
|
+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
2
|
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
3
|
+
|
4
|
+
name: Python package
|
5
|
+
|
6
|
+
on:
|
7
|
+
push:
|
8
|
+
branches: [ "main" ]
|
9
|
+
pull_request:
|
10
|
+
branches: [ "main" ]
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
build:
|
14
|
+
|
15
|
+
runs-on: ubuntu-latest
|
16
|
+
strategy:
|
17
|
+
fail-fast: false
|
18
|
+
matrix:
|
19
|
+
python-version: ["3.10", "3.11", "3.12"]
|
20
|
+
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v4
|
23
|
+
- name: Set up Python ${{ matrix.python-version }}
|
24
|
+
uses: actions/setup-python@v3
|
25
|
+
with:
|
26
|
+
python-version: ${{ matrix.python-version }}
|
27
|
+
- name: Install OpenGL (GLU)
|
28
|
+
run: sudo apt-get update && sudo apt-get install -y libglu1-mesa libglu1-mesa-dev
|
29
|
+
- name: Install dependencies
|
30
|
+
run: |
|
31
|
+
python -m pip install --upgrade pip
|
32
|
+
python -m pip install flake8 pytest pytest-cov
|
33
|
+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
34
|
+
- name: Lint with flake8
|
35
|
+
run: |
|
36
|
+
# stop the build if there are Python syntax errors or undefined names
|
37
|
+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
38
|
+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
39
|
+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
40
|
+
- name: Test with pytest
|
41
|
+
run: |
|
42
|
+
VISUALTEST=false PYTHONPATH=${PWD}/src:$PYTHONPATH pytest tests/ -m "not visual"
|
@@ -54,5 +54,23 @@ v_*/
|
|
54
54
|
#cached python version for pyenv
|
55
55
|
.python-version
|
56
56
|
|
57
|
-
|
58
|
-
|
57
|
+
|
58
|
+
|
59
|
+
# generated DXF files
|
60
|
+
*.dxf
|
61
|
+
# but include documentation DXF files
|
62
|
+
!docs/*.dxf
|
63
|
+
|
64
|
+
# generated stl files
|
65
|
+
*.stl
|
66
|
+
# but include documentation stl files
|
67
|
+
!docs/*.stl
|
68
|
+
|
69
|
+
# generated step files
|
70
|
+
*.step
|
71
|
+
# but include documentation step files
|
72
|
+
!docs/*.step
|
73
|
+
|
74
|
+
# ignore test python scripts in root
|
75
|
+
/*.py
|
76
|
+
|
@@ -2,6 +2,51 @@
|
|
2
2
|
Changelog
|
3
3
|
=========
|
4
4
|
|
5
|
+
Version 0.5.1 (2025-10-14)
|
6
|
+
==========================
|
7
|
+
|
8
|
+
what's new:
|
9
|
+
-----------
|
10
|
+
|
11
|
+
- **3D Boolean Operations Fixes**: Complete overhaul of solid boolean operations
|
12
|
+
with robust normal orientation and interior triangle filtering.
|
13
|
+
|
14
|
+
- Fixed sphere union normal orientation issues by filtering interior overlap triangles
|
15
|
+
- Added quality-based filtering for degenerate sliver triangles (aspect ratio checks)
|
16
|
+
- Implemented containment-based filtering to remove artifacts in overlap regions
|
17
|
+
- All primitive tests now pass with correct watertight geometry
|
18
|
+
|
19
|
+
- **2D Boolean Operations Fixes**: Resolved crash when performing boolean operations
|
20
|
+
on ``Circle`` and other single-geometry primitives.
|
21
|
+
|
22
|
+
- Fixed geometry wrapping in ``Boolean._prepare_geom()`` to handle unwrapped arc format
|
23
|
+
- Added comprehensive regression tests for 2D boolean operations
|
24
|
+
|
25
|
+
- **Primitive Improvements**: Enhanced reliability of 3D geometric primitives.
|
26
|
+
|
27
|
+
- Fixed ``conic()`` primitive to generate proper watertight solids
|
28
|
+
- Fixed ``tube()`` primitive normal orientation and end cap connectivity
|
29
|
+
- All 9 core primitives (box, sphere, cylinder, cone, tube, etc.) validated as watertight
|
30
|
+
|
31
|
+
- **Modular Boolean Engine Architecture**: Separated boolean operations into
|
32
|
+
``yapcad.boolean.native`` module for better maintainability.
|
33
|
+
|
34
|
+
- Support for multiple boolean engine backends (native, trimesh:manifold, trimesh:blender)
|
35
|
+
- Engine selection via ``solid_boolean(..., engine='native')`` parameter
|
36
|
+
- Environment variable support (``YAPCAD_BOOLEAN_ENGINE``, ``YAPCAD_TRIMESH_BACKEND``)
|
37
|
+
|
38
|
+
- **Test Suite Improvements**: Enhanced test coverage and reliability.
|
39
|
+
|
40
|
+
- 106 tests passing (up from 99 in v0.5.0)
|
41
|
+
- Added boolean regression test suite
|
42
|
+
- Improved solid topology tests with better error reporting
|
43
|
+
|
44
|
+
Known problems
|
45
|
+
--------------
|
46
|
+
|
47
|
+
- Incomplete documentation for some advanced 3D features.
|
48
|
+
- STEP export currently supports tessellated geometry; analytical BREP support planned for 1.0.
|
49
|
+
|
5
50
|
Version 0.5.0 (2024-09-30)
|
6
51
|
==========================
|
7
52
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: yapCAD
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.1
|
4
4
|
Summary: yet another procedural CAD and computational geometry system
|
5
5
|
Author-email: Richard DeVaul <richard.devaul@gmail.com>
|
6
6
|
Project-URL: Homepage, https://github.com/rdevaul/yapCAD/
|
@@ -24,6 +24,9 @@ Requires-Dist: pyobjc-framework-Quartz; platform_system == "Darwin"
|
|
24
24
|
Provides-Extra: tests
|
25
25
|
Requires-Dist: pytest; extra == "tests"
|
26
26
|
Requires-Dist: pytest-cov; extra == "tests"
|
27
|
+
Provides-Extra: meshcheck
|
28
|
+
Requires-Dist: trimesh>=4.0; extra == "meshcheck"
|
29
|
+
Requires-Dist: pymeshfix>=0.16; extra == "meshcheck"
|
27
30
|
Dynamic: license-file
|
28
31
|
|
29
32
|
**yapCAD**
|
@@ -37,6 +40,24 @@ python 3, now with a growing focus on 3D generative design and STL export
|
|
37
40
|
|
38
41
|
**yapCAD** rocket example
|
39
42
|
|
43
|
+
.. note::
|
44
|
+
|
45
|
+
The 3D rocket demo above was produced in a single shot by
|
46
|
+
``gpt-5-codex`` from the prompt::
|
47
|
+
|
48
|
+
Using what you know about yapCAD, I'd like you to create a demo that
|
49
|
+
builds a simple 3D model of a rocket, visualizes it using pyglet, and
|
50
|
+
then writes out the STL file. I'd like the rocket to have a cluster of
|
51
|
+
five engines, guidance fins, a cylindrical body with at least one
|
52
|
+
diameter transition before the payload fairing, and an aerodynamic
|
53
|
+
fairing. Can you do this for me?
|
54
|
+
|
55
|
+
.. figure:: images/RocketCutawaySTEP.png
|
56
|
+
:alt: **yapCAD** rocket cutaway STEP export
|
57
|
+
|
58
|
+
Internal layout generated with ``examples/rocket_cutaway_internal.py`` and
|
59
|
+
rendered from the exported STEP file in FreeCAD.
|
60
|
+
|
40
61
|
what’s **yapCAD** for?
|
41
62
|
----------------------
|
42
63
|
|
@@ -52,10 +73,14 @@ geometry experiments.
|
|
52
73
|
software status
|
53
74
|
---------------
|
54
75
|
|
55
|
-
**yapCAD** is
|
56
|
-
|
57
|
-
|
58
|
-
|
76
|
+
**yapCAD** is in **active development** and is already being used for
|
77
|
+
professional engineering purposes. Recent improvements include robust 3D
|
78
|
+
boolean operations (union, intersection, difference) with proper normal
|
79
|
+
orientation and degenerate triangle filtering. The 0.5.x series focuses on
|
80
|
+
production-ready 3D workflows with validated STL and STEP export.
|
81
|
+
|
82
|
+
If you are using **yapCAD** in interesting ways, feel free to let us know in the
|
83
|
+
`yapCAD discussions <https://github.com/rdevaul/yapCAD/discussions>`__ forum
|
59
84
|
|
60
85
|
**yapCAD** installation, documentation, and examples
|
61
86
|
----------------------------------------------------
|
@@ -89,8 +114,10 @@ PYTHONPATH includes the cloned top-level ``yapCAD`` directory. You will
|
|
89
114
|
find the examples in the ``yapCAD/examples`` directory.
|
90
115
|
|
91
116
|
For a fully worked 2D parametric design system, see the ``boxcut`` example.
|
92
|
-
For a 3D generative example that builds a multi-stage rocket, visualises
|
93
|
-
|
117
|
+
For a 3D generative example that builds a multi-stage rocket, visualises it,
|
118
|
+
and exports STL, see ``examples/rocket_demo.py``. To explore the new stacking
|
119
|
+
and cutaway helpers while exporting STEP, run
|
120
|
+
``examples/rocket_cutaway_internal.py`` whose output is shown above.
|
94
121
|
|
95
122
|
documentation
|
96
123
|
~~~~~~~~~~~~~
|
@@ -99,7 +126,18 @@ Online **yapCAD** documentation can be found here:
|
|
99
126
|
https://yapcad.readthedocs.io/en/latest/ — some module references lag
|
100
127
|
behind the latest 3D-focused APIs, so you may want to build a local copy
|
101
128
|
as described below to explore ``geometry_utils``, ``geometry_checks``,
|
102
|
-
``metadata``, and ``io.
|
129
|
+
``metadata``, and the ``yapcad.io`` exporters. Highlights from the most
|
130
|
+
recent updates include:
|
131
|
+
|
132
|
+
* ``yapcad.geometry_utils`` and ``yapcad.triangulator`` – triangle helpers
|
133
|
+
backing the ear-cut tessellator and faceted exporters.
|
134
|
+
* ``yapcad.geom3d_util.stack_solids`` – quickly pack solids along an axis
|
135
|
+
using bounding boxes and optional ``space:<distance>`` directives.
|
136
|
+
* ``yapcad.geom3d_util.cutaway_solid_x`` – trim solids against a plane to
|
137
|
+
create sectional visualisations.
|
138
|
+
* ``yapcad.io.step``/``yapcad.io.stl`` – production-ready faceted exporters
|
139
|
+
suitable for interchange with FreeCAD, slicers, and other simulation tools.
|
140
|
+
STEP export supports multi-component assemblies with proper face orientation.
|
103
141
|
|
104
142
|
To build the HTML **yapCAD** documentation locally, install the
|
105
143
|
documentation dependencies and run Sphinx from the project root::
|
@@ -179,14 +217,18 @@ drawing file format. At present, **yapCAD** supports:
|
|
179
217
|
|
180
218
|
* AutoCAD DXF output for two-dimensional drawings (via
|
181
219
|
`ezdxf <https://github.com/mozman/ezdxf>`__).
|
182
|
-
* STL export for 3D solids (via
|
220
|
+
* STL and STEP export for 3D solids (via ``yapcad.io.stl`` and
|
221
|
+
``yapcad.io.step`` modules).
|
183
222
|
* OpenGL visualisation for 2D/3D geometries using
|
184
223
|
`pyglet <https://github.com/pyglet/pyglet>`__.
|
224
|
+
* Modular 3D boolean operations supporting both native and external engines
|
225
|
+
(trimesh with Manifold/Blender backends).
|
185
226
|
|
186
|
-
The 0.5.
|
187
|
-
|
188
|
-
|
189
|
-
|
227
|
+
The 0.5.x series delivers robust 3D boolean operations, validated primitive
|
228
|
+
generation (sphere, cylinder, cone, tube, etc.), comprehensive mesh validation
|
229
|
+
tools, and production-ready export capabilities. These foundations pave the way
|
230
|
+
toward enhanced STEP support and a packaged, provenance-aware project model
|
231
|
+
targeted for the forthcoming 1.0 release.
|
190
232
|
|
191
233
|
The foundations of **yapCAD** are grounded in decades of the author’s
|
192
234
|
experience with graphics system programming, 3D CAD and simulation.
|
@@ -242,13 +284,17 @@ is a DXF example:
|
|
242
284
|
dd.display()
|
243
285
|
|
244
286
|
For a 3D example that generates a complete rocket assembly and exports
|
245
|
-
STL::
|
287
|
+
STL and STEP::
|
246
288
|
|
247
289
|
from pathlib import Path
|
248
290
|
from examples.rocket_demo import build_rocket, export_stl
|
291
|
+
from yapcad.io.step import write_step
|
249
292
|
|
250
293
|
components, assembly = build_rocket()
|
251
294
|
export_stl(assembly, Path("rocket_demo.stl"))
|
295
|
+
write_step(assembly, Path("rocket_demo.step"))
|
296
|
+
|
297
|
+
There is also an advanced ``rocket_grid_demo.py`` example featuring grid fins, a linear exploded view, and simultaneous STL/STEP export.
|
252
298
|
|
253
299
|
The **yapCAD** system isn’t just about rendering, of course, it’s about
|
254
300
|
computational geometry. For example, if you want to calculate the
|
@@ -18,9 +18,13 @@ design.
|
|
18
18
|
|
19
19
|
## software status
|
20
20
|
|
21
|
-
**yapCAD** is
|
22
|
-
|
23
|
-
|
21
|
+
**yapCAD** is in **active development** and is already being used for
|
22
|
+
professional engineering purposes. Recent improvements include robust 3D
|
23
|
+
boolean operations (union, intersection, difference) with proper normal
|
24
|
+
orientation and degenerate triangle filtering. The 0.5.x series focuses on
|
25
|
+
production-ready 3D workflows with validated STL and STEP export.
|
26
|
+
|
27
|
+
If you are using **yapCAD** in interesting ways, feel free to let us know in the
|
24
28
|
[**yapCAD** discussions](https://github.com/rdevaul/yapCAD/discussions)
|
25
29
|
forum
|
26
30
|
|
@@ -47,9 +51,19 @@ examples, clone the github repository as shown above, and make sure
|
|
47
51
|
that your PYTHONPATH includes the cloned top-level `yapCAD` directory.
|
48
52
|
You will find the examples in the `yapCAD/examples` directory.
|
49
53
|
|
50
|
-
For a fully worked 2D parametric design system, see the `boxcut`
|
51
|
-
|
52
|
-
|
54
|
+
For a fully worked 2D parametric design system, see the `boxcut` example. For a
|
55
|
+
3D generative example that builds a multi-stage rocket, visualises it, and
|
56
|
+
exports STL, see `examples/rocket_demo.py`. **NOTE** The 3D rocket example code
|
57
|
+
was generated in one shot by `gpt-5-codex` from the following prompt:
|
58
|
+
|
59
|
+
Using what you know about yapCAD, I'd like you to create a demo that builds a simple 3D model of a rocket, visualizes it using pyglet, and then writes out the STL file. I'd like the rocket to have a cluster of five engines, guidance fins, a cylindrical body with at least one diameter transition before the payload fairing, and an aerodynamic fairing. Can you do this for me?
|
60
|
+
|
61
|
+

|
62
|
+
|
63
|
+
To see how the newer helper utilities can be combined to lay out internal
|
64
|
+
subsystems and export STEP, try `examples/rocket_cutaway_internal.py` — the
|
65
|
+
screenshot above shows its STEP output rendered in FreeCAD.
|
66
|
+
|
53
67
|
|
54
68
|
### documentation
|
55
69
|
|
@@ -57,7 +71,22 @@ Online **yapCAD** documentation can be found here:
|
|
57
71
|
https://yapcad.readthedocs.io/en/latest/ — some module references
|
58
72
|
lag behind the current 3D-focused APIs, so you may want to build a
|
59
73
|
local copy (see below) to explore the latest `geometry_utils`,
|
60
|
-
`
|
74
|
+
`geometry_checks`, `metadata`, and `io` modules. Recent additions worth
|
75
|
+
calling out include:
|
76
|
+
|
77
|
+
- `yapcad.geometry_utils` & `yapcad.triangulator` – robust triangle
|
78
|
+
utilities used by the ear-cut tessellator and STEP exporter.
|
79
|
+
- `yapcad.geom3d_util.stack_solids` – a convenience routine that packs
|
80
|
+
solids along an axis using bounding boxes and optional spacing
|
81
|
+
directives (used by the rocket cutaway demo).
|
82
|
+
- `yapcad.geom3d_util.cutaway_solid_x` – simple clipping helper for
|
83
|
+
creating sectional views of assemblies.
|
84
|
+
- `yapcad.io.step`/`yapcad.io.stl` – production-ready faceted exporters suitable for
|
85
|
+
interchange with FreeCAD, slicers, and other simulation tools. STEP export supports
|
86
|
+
multi-component assemblies with proper face orientation.
|
87
|
+
- `tools/validate_mesh.py` – CLI helper that runs `admesh`, `meshfix`, and an
|
88
|
+
optional slicer to gauge whether STL output is robust enough for CAM; see
|
89
|
+
`docs/mesh_validation.md` for usage.
|
61
90
|
|
62
91
|
To build the HTML **yapCAD** documentation locally, install the
|
63
92
|
documentation dependencies and run Sphinx from the project root:
|
@@ -142,14 +171,17 @@ add support for a cad or drawing file format. At present,
|
|
142
171
|
|
143
172
|
- AutoCAD DXF output for two-dimensional drawings (via
|
144
173
|
[ezdxf](https://github.com/mozman/ezdxf)).
|
145
|
-
- STL export for 3D solids (via
|
174
|
+
- STL and STEP export for 3D solids (via `yapcad.io.stl` and `yapcad.io.step` modules).
|
146
175
|
- OpenGL visualisation for 2D/3D geometries using
|
147
176
|
[pyglet](https://github.com/pyglet/pyglet).
|
177
|
+
- Modular 3D boolean operations supporting both native and external engines
|
178
|
+
(trimesh with Manifold/Blender backends).
|
148
179
|
|
149
|
-
The 0.5.
|
150
|
-
|
151
|
-
|
152
|
-
|
180
|
+
The 0.5.x series delivers robust 3D boolean operations, validated primitive
|
181
|
+
generation (sphere, cylinder, cone, tube, etc.), comprehensive mesh validation
|
182
|
+
tools, and production-ready export capabilities. These foundations pave the way
|
183
|
+
toward enhanced STEP support and a packaged, provenance-aware project model
|
184
|
+
targeted for the forthcoming 1.0 release.
|
153
185
|
|
154
186
|
The foundations of **yapCAD** are grounded in decades of the author's
|
155
187
|
experience with graphics system programming, 3D CAD and
|
@@ -202,16 +234,21 @@ is a DXF example:
|
|
202
234
|
# write out the geometry as example1-out.dxf
|
203
235
|
dd.display()
|
204
236
|
|
205
|
-
For a 3D example that generates a complete rocket assembly and exports STL:
|
237
|
+
For a 3D example that generates a complete rocket assembly and exports STL and STEP:
|
206
238
|
|
207
239
|
```python
|
208
240
|
from pathlib import Path
|
209
241
|
from examples.rocket_demo import build_rocket, export_stl
|
242
|
+
from yapcad.io.step import write_step
|
210
243
|
|
211
244
|
components, assembly = build_rocket()
|
212
245
|
export_stl(assembly, Path("rocket_demo.stl"))
|
246
|
+
write_step(assembly, Path("rocket_demo.step"))
|
213
247
|
```
|
214
248
|
|
249
|
+
There is also an advanced `rocket_grid_demo.py` example featuring grid fins,
|
250
|
+
a linear exploded view, and simultaneous STL/STEP export.
|
251
|
+
|
215
252
|
The **yapCAD** system isn't just about rendering, of course, it's
|
216
253
|
about computational geometry. For example, if you want to calculate
|
217
254
|
the intersection of lines and arcs in a plane, we have you covered:
|
@@ -9,6 +9,24 @@ python 3, now with a growing focus on 3D generative design and STL export
|
|
9
9
|
|
10
10
|
**yapCAD** rocket example
|
11
11
|
|
12
|
+
.. note::
|
13
|
+
|
14
|
+
The 3D rocket demo above was produced in a single shot by
|
15
|
+
``gpt-5-codex`` from the prompt::
|
16
|
+
|
17
|
+
Using what you know about yapCAD, I'd like you to create a demo that
|
18
|
+
builds a simple 3D model of a rocket, visualizes it using pyglet, and
|
19
|
+
then writes out the STL file. I'd like the rocket to have a cluster of
|
20
|
+
five engines, guidance fins, a cylindrical body with at least one
|
21
|
+
diameter transition before the payload fairing, and an aerodynamic
|
22
|
+
fairing. Can you do this for me?
|
23
|
+
|
24
|
+
.. figure:: images/RocketCutawaySTEP.png
|
25
|
+
:alt: **yapCAD** rocket cutaway STEP export
|
26
|
+
|
27
|
+
Internal layout generated with ``examples/rocket_cutaway_internal.py`` and
|
28
|
+
rendered from the exported STEP file in FreeCAD.
|
29
|
+
|
12
30
|
what’s **yapCAD** for?
|
13
31
|
----------------------
|
14
32
|
|
@@ -24,10 +42,14 @@ geometry experiments.
|
|
24
42
|
software status
|
25
43
|
---------------
|
26
44
|
|
27
|
-
**yapCAD** is
|
28
|
-
|
29
|
-
|
30
|
-
|
45
|
+
**yapCAD** is in **active development** and is already being used for
|
46
|
+
professional engineering purposes. Recent improvements include robust 3D
|
47
|
+
boolean operations (union, intersection, difference) with proper normal
|
48
|
+
orientation and degenerate triangle filtering. The 0.5.x series focuses on
|
49
|
+
production-ready 3D workflows with validated STL and STEP export.
|
50
|
+
|
51
|
+
If you are using **yapCAD** in interesting ways, feel free to let us know in the
|
52
|
+
`yapCAD discussions <https://github.com/rdevaul/yapCAD/discussions>`__ forum
|
31
53
|
|
32
54
|
**yapCAD** installation, documentation, and examples
|
33
55
|
----------------------------------------------------
|
@@ -61,8 +83,10 @@ PYTHONPATH includes the cloned top-level ``yapCAD`` directory. You will
|
|
61
83
|
find the examples in the ``yapCAD/examples`` directory.
|
62
84
|
|
63
85
|
For a fully worked 2D parametric design system, see the ``boxcut`` example.
|
64
|
-
For a 3D generative example that builds a multi-stage rocket, visualises
|
65
|
-
|
86
|
+
For a 3D generative example that builds a multi-stage rocket, visualises it,
|
87
|
+
and exports STL, see ``examples/rocket_demo.py``. To explore the new stacking
|
88
|
+
and cutaway helpers while exporting STEP, run
|
89
|
+
``examples/rocket_cutaway_internal.py`` whose output is shown above.
|
66
90
|
|
67
91
|
documentation
|
68
92
|
~~~~~~~~~~~~~
|
@@ -71,7 +95,18 @@ Online **yapCAD** documentation can be found here:
|
|
71
95
|
https://yapcad.readthedocs.io/en/latest/ — some module references lag
|
72
96
|
behind the latest 3D-focused APIs, so you may want to build a local copy
|
73
97
|
as described below to explore ``geometry_utils``, ``geometry_checks``,
|
74
|
-
``metadata``, and ``io.
|
98
|
+
``metadata``, and the ``yapcad.io`` exporters. Highlights from the most
|
99
|
+
recent updates include:
|
100
|
+
|
101
|
+
* ``yapcad.geometry_utils`` and ``yapcad.triangulator`` – triangle helpers
|
102
|
+
backing the ear-cut tessellator and faceted exporters.
|
103
|
+
* ``yapcad.geom3d_util.stack_solids`` – quickly pack solids along an axis
|
104
|
+
using bounding boxes and optional ``space:<distance>`` directives.
|
105
|
+
* ``yapcad.geom3d_util.cutaway_solid_x`` – trim solids against a plane to
|
106
|
+
create sectional visualisations.
|
107
|
+
* ``yapcad.io.step``/``yapcad.io.stl`` – production-ready faceted exporters
|
108
|
+
suitable for interchange with FreeCAD, slicers, and other simulation tools.
|
109
|
+
STEP export supports multi-component assemblies with proper face orientation.
|
75
110
|
|
76
111
|
To build the HTML **yapCAD** documentation locally, install the
|
77
112
|
documentation dependencies and run Sphinx from the project root::
|
@@ -151,14 +186,18 @@ drawing file format. At present, **yapCAD** supports:
|
|
151
186
|
|
152
187
|
* AutoCAD DXF output for two-dimensional drawings (via
|
153
188
|
`ezdxf <https://github.com/mozman/ezdxf>`__).
|
154
|
-
* STL export for 3D solids (via
|
189
|
+
* STL and STEP export for 3D solids (via ``yapcad.io.stl`` and
|
190
|
+
``yapcad.io.step`` modules).
|
155
191
|
* OpenGL visualisation for 2D/3D geometries using
|
156
192
|
`pyglet <https://github.com/pyglet/pyglet>`__.
|
193
|
+
* Modular 3D boolean operations supporting both native and external engines
|
194
|
+
(trimesh with Manifold/Blender backends).
|
157
195
|
|
158
|
-
The 0.5.
|
159
|
-
|
160
|
-
|
161
|
-
|
196
|
+
The 0.5.x series delivers robust 3D boolean operations, validated primitive
|
197
|
+
generation (sphere, cylinder, cone, tube, etc.), comprehensive mesh validation
|
198
|
+
tools, and production-ready export capabilities. These foundations pave the way
|
199
|
+
toward enhanced STEP support and a packaged, provenance-aware project model
|
200
|
+
targeted for the forthcoming 1.0 release.
|
162
201
|
|
163
202
|
The foundations of **yapCAD** are grounded in decades of the author’s
|
164
203
|
experience with graphics system programming, 3D CAD and simulation.
|
@@ -214,13 +253,17 @@ is a DXF example:
|
|
214
253
|
dd.display()
|
215
254
|
|
216
255
|
For a 3D example that generates a complete rocket assembly and exports
|
217
|
-
STL::
|
256
|
+
STL and STEP::
|
218
257
|
|
219
258
|
from pathlib import Path
|
220
259
|
from examples.rocket_demo import build_rocket, export_stl
|
260
|
+
from yapcad.io.step import write_step
|
221
261
|
|
222
262
|
components, assembly = build_rocket()
|
223
263
|
export_stl(assembly, Path("rocket_demo.stl"))
|
264
|
+
write_step(assembly, Path("rocket_demo.step"))
|
265
|
+
|
266
|
+
There is also an advanced ``rocket_grid_demo.py`` example featuring grid fins, a linear exploded view, and simultaneous STL/STEP export.
|
224
267
|
|
225
268
|
The **yapCAD** system isn’t just about rendering, of course, it’s about
|
226
269
|
computational geometry. For example, if you want to calculate the
|
@@ -9,6 +9,24 @@ python 3, now with a growing focus on 3D generative design and STL export
|
|
9
9
|
|
10
10
|
**yapCAD** rocket example
|
11
11
|
|
12
|
+
.. note::
|
13
|
+
|
14
|
+
The 3D rocket demo above was produced in a single shot by
|
15
|
+
``gpt-5-codex`` from the prompt::
|
16
|
+
|
17
|
+
Using what you know about yapCAD, I'd like you to create a demo that
|
18
|
+
builds a simple 3D model of a rocket, visualizes it using pyglet, and
|
19
|
+
then writes out the STL file. I'd like the rocket to have a cluster of
|
20
|
+
five engines, guidance fins, a cylindrical body with at least one
|
21
|
+
diameter transition before the payload fairing, and an aerodynamic
|
22
|
+
fairing. Can you do this for me?
|
23
|
+
|
24
|
+
.. figure:: images/RocketCutawaySTEP.png
|
25
|
+
:alt: **yapCAD** rocket cutaway STEP export
|
26
|
+
|
27
|
+
Internal layout generated with ``examples/rocket_cutaway_internal.py`` and
|
28
|
+
rendered from the exported STEP file in FreeCAD.
|
29
|
+
|
12
30
|
what’s **yapCAD** for?
|
13
31
|
----------------------
|
14
32
|
|
@@ -24,10 +42,14 @@ geometry experiments.
|
|
24
42
|
software status
|
25
43
|
---------------
|
26
44
|
|
27
|
-
**yapCAD** is
|
28
|
-
|
29
|
-
|
30
|
-
|
45
|
+
**yapCAD** is in **active development** and is already being used for
|
46
|
+
professional engineering purposes. Recent improvements include robust 3D
|
47
|
+
boolean operations (union, intersection, difference) with proper normal
|
48
|
+
orientation and degenerate triangle filtering. The 0.5.x series focuses on
|
49
|
+
production-ready 3D workflows with validated STL and STEP export.
|
50
|
+
|
51
|
+
If you are using **yapCAD** in interesting ways, feel free to let us know in the
|
52
|
+
`yapCAD discussions <https://github.com/rdevaul/yapCAD/discussions>`__ forum
|
31
53
|
|
32
54
|
**yapCAD** installation, documentation, and examples
|
33
55
|
----------------------------------------------------
|
@@ -61,8 +83,10 @@ PYTHONPATH includes the cloned top-level ``yapCAD`` directory. You will
|
|
61
83
|
find the examples in the ``yapCAD/examples`` directory.
|
62
84
|
|
63
85
|
For a fully worked 2D parametric design system, see the ``boxcut`` example.
|
64
|
-
For a 3D generative example that builds a multi-stage rocket, visualises
|
65
|
-
|
86
|
+
For a 3D generative example that builds a multi-stage rocket, visualises it,
|
87
|
+
and exports STL, see ``examples/rocket_demo.py``. To explore the new stacking
|
88
|
+
and cutaway helpers while exporting STEP, run
|
89
|
+
``examples/rocket_cutaway_internal.py`` whose output is shown above.
|
66
90
|
|
67
91
|
documentation
|
68
92
|
~~~~~~~~~~~~~
|
@@ -71,7 +95,18 @@ Online **yapCAD** documentation can be found here:
|
|
71
95
|
https://yapcad.readthedocs.io/en/latest/ — some module references lag
|
72
96
|
behind the latest 3D-focused APIs, so you may want to build a local copy
|
73
97
|
as described below to explore ``geometry_utils``, ``geometry_checks``,
|
74
|
-
``metadata``, and ``io.
|
98
|
+
``metadata``, and the ``yapcad.io`` exporters. Highlights from the most
|
99
|
+
recent updates include:
|
100
|
+
|
101
|
+
* ``yapcad.geometry_utils`` and ``yapcad.triangulator`` – triangle helpers
|
102
|
+
backing the ear-cut tessellator and faceted exporters.
|
103
|
+
* ``yapcad.geom3d_util.stack_solids`` – quickly pack solids along an axis
|
104
|
+
using bounding boxes and optional ``space:<distance>`` directives.
|
105
|
+
* ``yapcad.geom3d_util.cutaway_solid_x`` – trim solids against a plane to
|
106
|
+
create sectional visualisations.
|
107
|
+
* ``yapcad.io.step``/``yapcad.io.stl`` – production-ready faceted exporters
|
108
|
+
suitable for interchange with FreeCAD, slicers, and other simulation tools.
|
109
|
+
STEP export supports multi-component assemblies with proper face orientation.
|
75
110
|
|
76
111
|
To build the HTML **yapCAD** documentation locally, install the
|
77
112
|
documentation dependencies and run Sphinx from the project root::
|
@@ -151,14 +186,18 @@ drawing file format. At present, **yapCAD** supports:
|
|
151
186
|
|
152
187
|
* AutoCAD DXF output for two-dimensional drawings (via
|
153
188
|
`ezdxf <https://github.com/mozman/ezdxf>`__).
|
154
|
-
* STL export for 3D solids (via
|
189
|
+
* STL and STEP export for 3D solids (via ``yapcad.io.stl`` and
|
190
|
+
``yapcad.io.step`` modules).
|
155
191
|
* OpenGL visualisation for 2D/3D geometries using
|
156
192
|
`pyglet <https://github.com/pyglet/pyglet>`__.
|
193
|
+
* Modular 3D boolean operations supporting both native and external engines
|
194
|
+
(trimesh with Manifold/Blender backends).
|
157
195
|
|
158
|
-
The 0.5.
|
159
|
-
|
160
|
-
|
161
|
-
|
196
|
+
The 0.5.x series delivers robust 3D boolean operations, validated primitive
|
197
|
+
generation (sphere, cylinder, cone, tube, etc.), comprehensive mesh validation
|
198
|
+
tools, and production-ready export capabilities. These foundations pave the way
|
199
|
+
toward enhanced STEP support and a packaged, provenance-aware project model
|
200
|
+
targeted for the forthcoming 1.0 release.
|
162
201
|
|
163
202
|
The foundations of **yapCAD** are grounded in decades of the author’s
|
164
203
|
experience with graphics system programming, 3D CAD and simulation.
|
@@ -214,13 +253,17 @@ is a DXF example:
|
|
214
253
|
dd.display()
|
215
254
|
|
216
255
|
For a 3D example that generates a complete rocket assembly and exports
|
217
|
-
STL::
|
256
|
+
STL and STEP::
|
218
257
|
|
219
258
|
from pathlib import Path
|
220
259
|
from examples.rocket_demo import build_rocket, export_stl
|
260
|
+
from yapcad.io.step import write_step
|
221
261
|
|
222
262
|
components, assembly = build_rocket()
|
223
263
|
export_stl(assembly, Path("rocket_demo.stl"))
|
264
|
+
write_step(assembly, Path("rocket_demo.step"))
|
265
|
+
|
266
|
+
There is also an advanced ``rocket_grid_demo.py`` example featuring grid fins, a linear exploded view, and simultaneous STL/STEP export.
|
224
267
|
|
225
268
|
The **yapCAD** system isn’t just about rendering, of course, it’s about
|
226
269
|
computational geometry. For example, if you want to calculate the
|
Binary file
|