yapCAD 0.3.0__tar.gz → 0.5.0__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.
Files changed (117) hide show
  1. {yapcad-0.3.0 → yapcad-0.5.0}/.readthedocs.yml +10 -1
  2. {yapcad-0.3.0 → yapcad-0.5.0}/CHANGELOG.rst +84 -22
  3. {yapcad-0.3.0 → yapcad-0.5.0}/PKG-INFO +94 -38
  4. {yapcad-0.3.0 → yapcad-0.5.0}/README.md +95 -31
  5. {yapcad-0.3.0 → yapcad-0.5.0}/README.rst +91 -37
  6. {yapcad-0.3.0 → yapcad-0.5.0}/docs/README.rst +91 -37
  7. yapcad-0.5.0/docs/images/RocketDemoScreenshot.png +0 -0
  8. yapcad-0.5.0/docs/images/yapCadSplash.png +0 -0
  9. {yapcad-0.3.0 → yapcad-0.5.0}/docs/index.rst +43 -13
  10. yapcad-0.5.0/docs/requirements.txt +2 -0
  11. yapcad-0.5.0/docs/yapCADfoundations.md +44 -0
  12. yapcad-0.5.0/docs/yapCADone.md +92 -0
  13. {yapcad-0.3.0 → yapcad-0.5.0}/examples/boxcut/boxcut.py +134 -103
  14. {yapcad-0.3.0 → yapcad-0.5.0}/examples/example10.py +3 -62
  15. {yapcad-0.3.0 → yapcad-0.5.0}/examples/example11.py +4 -4
  16. {yapcad-0.3.0 → yapcad-0.5.0}/examples/example12.py +34 -21
  17. yapcad-0.5.0/examples/example13.py +107 -0
  18. {yapcad-0.3.0 → yapcad-0.5.0}/examples/example4.py +2 -2
  19. {yapcad-0.3.0 → yapcad-0.5.0}/examples/example6.py +3 -3
  20. {yapcad-0.3.0 → yapcad-0.5.0}/examples/example8.py +4 -4
  21. yapcad-0.5.0/examples/example9.py +105 -0
  22. yapcad-0.5.0/examples/rocket_demo.py +121 -0
  23. yapcad-0.5.0/images/RocketDemoScreenshot.png +0 -0
  24. yapcad-0.5.0/images/yapCadSplash.png +0 -0
  25. {yapcad-0.3.0 → yapcad-0.5.0}/pyproject.toml +3 -1
  26. yapcad-0.5.0/pytest.ini +4 -0
  27. {yapcad-0.3.0 → yapcad-0.5.0}/requirements.txt +2 -0
  28. yapcad-0.5.0/run_visual_tests.py +313 -0
  29. yapcad-0.5.0/run_visual_tests_venv.sh +19 -0
  30. {yapcad-0.3.0 → yapcad-0.5.0}/setup.cfg +2 -0
  31. {yapcad-0.3.0 → yapcad-0.5.0}/src/yapCAD.egg-info/PKG-INFO +94 -38
  32. {yapcad-0.3.0 → yapcad-0.5.0}/src/yapCAD.egg-info/SOURCES.txt +31 -0
  33. {yapcad-0.3.0 → yapcad-0.5.0}/src/yapCAD.egg-info/requires.txt +2 -0
  34. yapcad-0.5.0/src/yapcad/combine.py +98 -0
  35. {yapcad-0.3.0 → yapcad-0.5.0}/src/yapcad/drawable.py +44 -3
  36. {yapcad-0.3.0 → yapcad-0.5.0}/src/yapcad/ezdxf_drawable.py +1 -1
  37. {yapcad-0.3.0 → yapcad-0.5.0}/src/yapcad/geom.py +204 -264
  38. yapcad-0.5.0/src/yapcad/geom3d.py +982 -0
  39. yapcad-0.5.0/src/yapcad/geom3d_util.py +541 -0
  40. yapcad-0.5.0/src/yapcad/geom_util.py +817 -0
  41. yapcad-0.5.0/src/yapcad/geometry.py +473 -0
  42. yapcad-0.5.0/src/yapcad/geometry_checks.py +112 -0
  43. yapcad-0.5.0/src/yapcad/geometry_utils.py +115 -0
  44. yapcad-0.5.0/src/yapcad/io/__init__.py +5 -0
  45. yapcad-0.5.0/src/yapcad/io/stl.py +83 -0
  46. yapcad-0.5.0/src/yapcad/mesh.py +46 -0
  47. yapcad-0.5.0/src/yapcad/metadata.py +109 -0
  48. yapcad-0.5.0/src/yapcad/octtree.py +627 -0
  49. {yapcad-0.3.0 → yapcad-0.5.0}/src/yapcad/poly.py +153 -299
  50. yapcad-0.5.0/src/yapcad/pyglet_drawable.py +1035 -0
  51. yapcad-0.5.0/src/yapcad/triangulator.py +103 -0
  52. {yapcad-0.3.0 → yapcad-0.5.0}/src/yapcad/xform.py +0 -1
  53. {yapcad-0.3.0 → yapcad-0.5.0}/tests/test_geom.py +131 -13
  54. yapcad-0.5.0/tests/test_geom3d.py +711 -0
  55. yapcad-0.5.0/tests/test_geom_util.py +38 -0
  56. yapcad-0.5.0/tests/test_geometry.py +246 -0
  57. yapcad-0.5.0/tests/test_geometry_checks.py +91 -0
  58. yapcad-0.5.0/tests/test_geometry_utils.py +75 -0
  59. yapcad-0.5.0/tests/test_geomlist_snap.py +10 -0
  60. yapcad-0.5.0/tests/test_io_stl.py +41 -0
  61. yapcad-0.5.0/tests/test_mesh_view.py +122 -0
  62. yapcad-0.5.0/tests/test_metadata_utils.py +78 -0
  63. yapcad-0.5.0/tests/test_octtree.py +393 -0
  64. yapcad-0.5.0/tests/test_poly2surface_orientation.py +83 -0
  65. yapcad-0.3.0/docs/images/yapCadSplash.png +0 -0
  66. yapcad-0.3.0/examples/example9.py +0 -156
  67. yapcad-0.3.0/images/yapCadSplash.png +0 -0
  68. yapcad-0.3.0/src/yapcad/combine.py +0 -392
  69. yapcad-0.3.0/src/yapcad/geom3d.py +0 -62
  70. yapcad-0.3.0/src/yapcad/geometry.py +0 -81
  71. yapcad-0.3.0/src/yapcad/pyglet_drawable.py +0 -499
  72. {yapcad-0.3.0 → yapcad-0.5.0}/.coveragerc +0 -0
  73. {yapcad-0.3.0 → yapcad-0.5.0}/.gitignore +0 -0
  74. {yapcad-0.3.0 → yapcad-0.5.0}/AUTHORS.rst +0 -0
  75. {yapcad-0.3.0 → yapcad-0.5.0}/LICENSE +0 -0
  76. {yapcad-0.3.0 → yapcad-0.5.0}/LICENSE.txt +0 -0
  77. {yapcad-0.3.0 → yapcad-0.5.0}/docs/Makefile +0 -0
  78. {yapcad-0.3.0 → yapcad-0.5.0}/docs/_static/.gitignore +0 -0
  79. {yapcad-0.3.0 → yapcad-0.5.0}/docs/authors.rst +0 -0
  80. {yapcad-0.3.0 → yapcad-0.5.0}/docs/changelog.rst +0 -0
  81. {yapcad-0.3.0 → yapcad-0.5.0}/docs/conf.py +0 -0
  82. {yapcad-0.3.0 → yapcad-0.5.0}/docs/images/laserbox.jpg +0 -0
  83. {yapcad-0.3.0 → yapcad-0.5.0}/docs/license.rst +0 -0
  84. {yapcad-0.3.0 → yapcad-0.5.0}/dxf/README.md +0 -0
  85. {yapcad-0.3.0 → yapcad-0.5.0}/dxf/README.rst +0 -0
  86. {yapcad-0.3.0 → yapcad-0.5.0}/dxf/boxout.dxf +0 -0
  87. {yapcad-0.3.0 → yapcad-0.5.0}/dxf/example1-out.dxf +0 -0
  88. {yapcad-0.3.0 → yapcad-0.5.0}/dxf/example10-out.dxf +0 -0
  89. {yapcad-0.3.0 → yapcad-0.5.0}/dxf/example3-out.dxf +0 -0
  90. {yapcad-0.3.0 → yapcad-0.5.0}/dxf/example4-out.dxf +0 -0
  91. {yapcad-0.3.0 → yapcad-0.5.0}/dxf/example5-out.dxf +0 -0
  92. {yapcad-0.3.0 → yapcad-0.5.0}/dxf/example6-out.dxf +0 -0
  93. {yapcad-0.3.0 → yapcad-0.5.0}/dxf/example7-out.dxf +0 -0
  94. {yapcad-0.3.0 → yapcad-0.5.0}/dxf/example8-out.dxf +0 -0
  95. {yapcad-0.3.0 → yapcad-0.5.0}/examples/README.md +0 -0
  96. {yapcad-0.3.0 → yapcad-0.5.0}/examples/README.rst +0 -0
  97. {yapcad-0.3.0 → yapcad-0.5.0}/examples/boxcut/README.md +0 -0
  98. {yapcad-0.3.0 → yapcad-0.5.0}/examples/boxcut/README.rst +0 -0
  99. {yapcad-0.3.0 → yapcad-0.5.0}/examples/example1.py +0 -0
  100. {yapcad-0.3.0 → yapcad-0.5.0}/examples/example2.py +0 -0
  101. {yapcad-0.3.0 → yapcad-0.5.0}/examples/example3.py +0 -0
  102. {yapcad-0.3.0 → yapcad-0.5.0}/examples/example5.py +0 -0
  103. {yapcad-0.3.0 → yapcad-0.5.0}/examples/example7.py +0 -0
  104. {yapcad-0.3.0 → yapcad-0.5.0}/examples/example8-gl.py +0 -0
  105. {yapcad-0.3.0 → yapcad-0.5.0}/images/README.md +0 -0
  106. {yapcad-0.3.0 → yapcad-0.5.0}/images/README.rst +0 -0
  107. {yapcad-0.3.0 → yapcad-0.5.0}/images/example6-out.png +0 -0
  108. {yapcad-0.3.0 → yapcad-0.5.0}/images/example8-out.png +0 -0
  109. {yapcad-0.3.0 → yapcad-0.5.0}/images/yapCAD01.png +0 -0
  110. {yapcad-0.3.0 → yapcad-0.5.0}/images/yapCAD02.png +0 -0
  111. {yapcad-0.3.0 → yapcad-0.5.0}/setup.py +0 -0
  112. {yapcad-0.3.0 → yapcad-0.5.0}/src/yapCAD.egg-info/dependency_links.txt +0 -0
  113. {yapcad-0.3.0 → yapcad-0.5.0}/src/yapCAD.egg-info/not-zip-safe +0 -0
  114. {yapcad-0.3.0 → yapcad-0.5.0}/src/yapCAD.egg-info/top_level.txt +0 -0
  115. {yapcad-0.3.0 → yapcad-0.5.0}/src/yapcad/__init__.py +0 -0
  116. {yapcad-0.3.0 → yapcad-0.5.0}/tests/conftest.py +0 -0
  117. {yapcad-0.3.0 → yapcad-0.5.0}/tests/test_xform.py +0 -0
@@ -5,14 +5,23 @@
5
5
  # Required
6
6
  version: 2
7
7
 
8
+ build:
9
+ os: ubuntu-22.04
10
+ tools:
11
+ python: "3.12"
12
+
8
13
  # Build documentation in the docs/ directory with Sphinx
9
14
  sphinx:
10
15
  configuration: docs/conf.py
11
16
 
17
+ python:
18
+ install:
19
+ - requirements: docs/requirements.txt
20
+
12
21
  # Optionally build your docs in additional formats such as PDF
13
22
  formats:
14
23
  - pdf
15
24
 
16
25
  submodules:
17
26
  include: all
18
- recursive: true
27
+ recursive: true
@@ -2,19 +2,41 @@
2
2
  Changelog
3
3
  =========
4
4
 
5
- Version 0.3.0
6
- =============
5
+ Version 0.5.0 (2024-09-30)
6
+ ==========================
7
7
 
8
8
  what's new:
9
9
  -----------
10
10
 
11
- - Require Python 3.10+ and align dependency metadata with current
12
- interpreter and library versions.
13
- - Pin pyglet to 1.x rendering backend and add fallback
14
- guards to every OpenGL-enabled example so they degrade gracefully on
15
- systems without a working pyglet/Cocoa stack.
16
- - Sphinx documentation now builds even when optional themes are
17
- missing, and `sphinx-apidoc` no longer depends on ``pkg_resources``.
11
+ - Adds shared geometry utilities and metadata helpers.
12
+ - Introduces STL export (`yapcad.io.stl`) plus tests.
13
+ - Provides `examples/rocket_demo.py` showing a full 3D workflow.
14
+ - Updates documentation with 3D-focused imagery and instructions.
15
+
16
+ Known problems
17
+ --------------
18
+
19
+ - Incomplete documentation, though this is improving.
20
+
21
+ Version 0.4.0 (Development)
22
+ ============================
23
+
24
+ what's new:
25
+ -----------
26
+
27
+ - **Testing Infrastructure Overhaul**: Completely redesigned test execution system
28
+ to properly support both automated and interactive visual tests.
29
+
30
+ - Added comprehensive pytest markers: ``@pytest.mark.visual`` for interactive tests
31
+ - Created ``run_visual_tests.py`` and ``run_visual_tests_venv.sh`` for isolated
32
+ visual test execution using subprocess isolation
33
+ - Enhanced test discovery using AST parsing to automatically find decorated visual tests
34
+ - Fixed visual test termination issues that were causing pytest to exit prematurely
35
+ - Updated all test documentation with clear separation between non-visual and visual testing
36
+
37
+ - **3D Geometry Enhancements**: Merged advanced 3D surface representation and
38
+ geometry system improvements from development branch, including enhanced
39
+ ``Geometry`` class architecture and improved computational geometry operations.
18
40
 
19
41
  Known problems
20
42
  --------------
@@ -23,31 +45,45 @@ Known problems
23
45
  - Occasional problems with complex boolean operations.
24
46
  - Incomplete functionality around 3D modeling.
25
47
 
26
- Version 0.1.5
48
+ Version 0.3.1
27
49
  =============
28
50
 
29
51
  what's new:
30
52
  -----------
31
53
 
32
- - Pre-release, heading towards V0.2.x
54
+ - Added Read the Docs configuration and ``docs/requirements.txt`` so hosted
55
+ builds use a consistent environment.
56
+ - Updated README instructions for building documentation and running tests.
57
+ - Follow-up to 0.3.0 (no functional code changes).
33
58
 
34
- - Restructuring for package release
59
+ Known problems
60
+ --------------
35
61
 
36
- - Lots more documentation (still incomplete)
62
+ - Incomplete documentation, especially outside the ``yapcad.geom`` module.
63
+ - Occasional problems with complex boolean operations.
64
+ - Incomplete functionality around 3D modeling.
37
65
 
38
- - Fixes to package configuration
66
+ Version 0.3.0
67
+ =============
68
+
69
+ what's new:
70
+ -----------
71
+
72
+ - Require Python 3.10+ and align dependency metadata with current
73
+ interpreter and library versions.
74
+ - Pin pyglet to 1.x rendering backend and add fallback
75
+ guards to every OpenGL-enabled example so they degrade gracefully on
76
+ systems without a working pyglet/Cocoa stack.
77
+ - Sphinx documentation now builds even when optional themes are
78
+ missing, and `sphinx-apidoc` no longer depends on ``pkg_resources``.
39
79
 
40
80
  Known problems
41
81
  --------------
42
82
 
43
83
  - Incomplete documentation, especially outside the ``yapcad.geom`` module.
84
+ - Occasional problems with complex boolean operations.
85
+ - Incomplete functionality around 3D modeling.
44
86
 
45
- - Occasional problems with complex boolean operations
46
-
47
- - Incomplete functionality around 3D modeling
48
-
49
- - Inconsistent inclusion of licensing boilerplate
50
-
51
87
  Version 0.2.0
52
88
  =============
53
89
 
@@ -69,8 +105,8 @@ Known problems
69
105
  **yapCAD**'s documentation is in the form of docstrings in the
70
106
  source. I'm working on getting this sorted out. In the mean time,
71
107
  you may want to build a local copy of the documentation as described
72
- in the main ``README`` file. Or, checkout and read the source.
73
-
108
+ in the main ``README`` file. Or, checkout and read the source.
109
+
74
110
  - Incomplete documentation, especially outside the ``yapcad.geom`` module.
75
111
 
76
112
  - Occasional problems with complex boolean operations. A bug in the
@@ -81,4 +117,30 @@ Known problems
81
117
  - Inconsistent inclusion of licensing boilerplate, other minor
82
118
  formatting issues.
83
119
 
120
+ Version 0.1.5
121
+ =============
122
+
123
+ what's new:
124
+ -----------
125
+
126
+ - Pre-release, heading towards V0.2.x
127
+
128
+ - Restructuring for package release
129
+
130
+ - Lots more documentation (still incomplete)
131
+
132
+ - Fixes to package configuration
133
+
134
+ Known problems
135
+ --------------
136
+
137
+ - Incomplete documentation, especially outside the ``yapcad.geom`` module.
138
+
139
+ - Occasional problems with complex boolean operations
140
+
141
+ - Incomplete functionality around 3D modeling
142
+
143
+ - Inconsistent inclusion of licensing boilerplate
144
+
145
+
84
146
  .. _yapCAD readthedocs: https://yapcad.readthedocs.io/en/latest/index.html
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yapCAD
3
- Version: 0.3.0
3
+ Version: 0.5.0
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/
@@ -16,6 +16,8 @@ License-File: AUTHORS.rst
16
16
  Requires-Dist: ezdxf>=1.1
17
17
  Requires-Dist: pyglet<2,>=1.5
18
18
  Requires-Dist: mpmath>=1.2
19
+ Requires-Dist: numpy>=1.22
20
+ Requires-Dist: mapbox-earcut>=1.0.3
19
21
  Requires-Dist: pyobjc-core; platform_system == "Darwin"
20
22
  Requires-Dist: pyobjc-framework-Cocoa; platform_system == "Darwin"
21
23
  Requires-Dist: pyobjc-framework-Quartz; platform_system == "Darwin"
@@ -28,12 +30,12 @@ Dynamic: license-file
28
30
  ==========
29
31
 
30
32
  yet another procedural CAD and computational geometry system written in
31
- python 3
33
+ python 3, now with a growing focus on 3D generative design and STL export
32
34
 
33
- .. figure:: images/yapCadSplash.png
34
- :alt: **yapCAD** image
35
+ .. figure:: images/RocketDemoScreenshot.png
36
+ :alt: **yapCAD** rocket example
35
37
 
36
- **yapCAD** image
38
+ **yapCAD** rocket example
37
39
 
38
40
  what’s **yapCAD** for?
39
41
  ----------------------
@@ -42,8 +44,10 @@ First and foremost, **yapCAD** is a framework for creating
42
44
  `parametric <https://en.wikipedia.org/wiki/Parametric_design>`__,
43
45
  procedural, and
44
46
  `generative <https://en.wikipedia.org/wiki/Parametric_design>`__ design
45
- systems. You can also use **yapCAD** for other CAD, CAM, and
46
- computational geometry purposes.
47
+ systems. Starting with the 0.5 release, the emphasis has shifted toward
48
+ 3D solid workflows, including STL export for downstream slicing and
49
+ simulation, while retaining support for DXF generation and computational
50
+ geometry experiments.
47
51
 
48
52
  software status
49
53
  ---------------
@@ -84,28 +88,23 @@ clone the github repository as shown above, and make sure that your
84
88
  PYTHONPATH includes the cloned top-level ``yapCAD`` directory. You will
85
89
  find the examples in the ``yapCAD/examples`` directory.
86
90
 
87
- For a fully worked parametric design system, see the ``boxcut`` example.
91
+ 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
+ it, and exports STL, see ``examples/rocket_demo.py``.
88
94
 
89
95
  documentation
90
96
  ~~~~~~~~~~~~~
91
97
 
92
98
  Online **yapCAD** documentation can be found here:
93
- https://yapcad.readthedocs.io/en/latest/ — for some reason
94
- ``readthedocs.io`` isn’t generating the full module documentation, so
95
- you might want to build a local copy, as described below.
99
+ https://yapcad.readthedocs.io/en/latest/ — some module references lag
100
+ behind the latest 3D-focused APIs, so you may want to build a local copy
101
+ as described below to explore ``geometry_utils``, ``geometry_checks``,
102
+ ``metadata``, and ``io.stl``.
96
103
 
97
- To build the HTML **yapCAD** documentation locally, first make sure you
98
- have the sphinx package installed:
99
-
100
- ::
101
-
102
- pip install sphinx --user
103
-
104
- Then clone the github repository as shown above, ``cd`` to the
105
- ``yapCAD`` directory, and type
106
-
107
- ::
104
+ To build the HTML **yapCAD** documentation locally, install the
105
+ documentation dependencies and run Sphinx from the project root::
108
106
 
107
+ python3 -m pip install -r docs/requirements.txt
109
108
  make -C docs html
110
109
 
111
110
  This will build the HTML documents in the ``build/sphinx/html``
@@ -117,29 +116,77 @@ information.
117
116
  running tests
118
117
  ~~~~~~~~~~~~~
119
118
 
120
- The repository includes a small pytest suite that exercises the core
121
- geometry primitives. Install the testing dependencies and run pytest
122
- from the project root with the source tree on ``PYTHONPATH``::
119
+ The repository includes a comprehensive pytest suite that exercises both core
120
+ geometry primitives and visual rendering capabilities. First, set up the
121
+ testing environment::
123
122
 
124
- python3 -m pip install pytest pytest-cov
125
- PYTHONPATH=./src python3 -m pytest
123
+ # Create and activate virtual environment
124
+ pyenv local 3.12 # or use python3.12 directly
125
+ python3 -m venv v_312
126
+ source v_312/bin/activate
126
127
 
127
- The default configuration enables coverage reporting via
128
- ``pytest-cov``. If you prefer to skip coverage, you can override the
129
- options::
128
+ # Install dependencies
129
+ pip install -r requirements.txt
130
+ pip install pytest pytest-cov
130
131
 
131
- PYTHONPATH=./src python3 -m pytest --override-ini addopts=
132
+ Non-Visual Tests (Automated/CI-friendly)
133
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
134
+
135
+ Run the core computational geometry tests (including triangle, metadata,
136
+ validation, and STL exporter checks) without interactive displays::
137
+
138
+ # Run all non-visual tests
139
+ PYTHONPATH=./src pytest tests/ -m "not visual"
140
+
141
+ # With coverage reporting (default)
142
+ PYTHONPATH=./src pytest tests/ -m "not visual" --cov=src
143
+
144
+ # Skip coverage for faster execution
145
+ PYTHONPATH=./src pytest tests/ -m "not visual" --override-ini addopts=
146
+
147
+ Visual Tests (Interactive)
148
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
149
+
150
+ yapCAD includes visual tests that create interactive 3D renderings to verify
151
+ geometry generation and display functionality (for example,
152
+ ``tests/test_mesh_view.py::test_mesh_view_visual_normals``). These require a
153
+ display and user interaction::
154
+
155
+ # Run all visual tests (opens interactive windows)
156
+ ./run_visual_tests_venv.sh
157
+
158
+ # Run specific visual tests by pattern
159
+ ./run_visual_tests_venv.sh test_geom # Only test_geom* visual tests
160
+ ./run_visual_tests_venv.sh surface # Tests matching "surface"
161
+ ./run_visual_tests_venv.sh Face # Face-related tests
162
+
163
+ # Alternative: Manual pytest execution
164
+ VISUALTEST=true PYTHONPATH=./src pytest tests/ -m visual
165
+
166
+ # Or run individual visual tests
167
+ VISUALTEST=true PYTHONPATH=./src pytest tests/test_geom3d.py::TestSurface::test_surface -s
168
+
169
+ **Note:** Visual tests require closing each interactive window to proceed to the next test. Use the dedicated ``run_visual_tests_venv.sh`` script for the best experience, as it runs each test in an isolated subprocess to prevent early termination.
132
170
 
133
171
  **yapCAD** goals
134
172
  ----------------
135
173
 
136
174
  The purpose of **yapCAD** is to support 2D and 3D computational geometry
137
175
  and parametric, procedural, and generative design projects in python3.
138
- **yapCAD** is designed to support multiple rendering back-ends, such
139
- that a relatively small amount of code is necessary to add support for a
140
- 2D or 3D cad or drawing file format. At present, **yapCAD** supports the
141
- AutoCad DXF file format for creating two-dimensional drawings and OpenGL
142
- for creating interactive 2D and 3D renderings.
176
+ **yapCAD** is designed to support multiple rendering back-ends, such that
177
+ only a small amount of code is necessary to add support for a CAD or
178
+ drawing file format. At present, **yapCAD** supports:
179
+
180
+ * AutoCAD DXF output for two-dimensional drawings (via
181
+ `ezdxf <https://github.com/mozman/ezdxf>`__).
182
+ * STL export for 3D solids (via the new ``yapcad.io.stl`` module).
183
+ * OpenGL visualisation for 2D/3D geometries using
184
+ `pyglet <https://github.com/pyglet/pyglet>`__.
185
+
186
+ The 0.5.0 release lays the shared foundations (triangle utilities,
187
+ metadata, validation checks, and STL export) that pave the way toward STEP
188
+ support and a packaged, provenance-aware project model targeted for the
189
+ forthcoming 1.0 release.
143
190
 
144
191
  The foundations of **yapCAD** are grounded in decades of the author’s
145
192
  experience with graphics system programming, 3D CAD and simulation.
@@ -158,8 +205,8 @@ package, and interactive OpenGL visualization using the amazing
158
205
 
159
206
  (for a more complete list, see the `examples folder <./examples/>`__)
160
207
 
161
- It’s pretty easy to make a DXF drawing with **yapCAD**. Here is an
162
- example:
208
+ It’s pretty easy to make a DXF drawing or a 3D model with **yapCAD**. Here
209
+ is a DXF example:
163
210
 
164
211
  ::
165
212
 
@@ -194,6 +241,15 @@ example:
194
241
  # write out the geometry as example1-out.dxf
195
242
  dd.display()
196
243
 
244
+ For a 3D example that generates a complete rocket assembly and exports
245
+ STL::
246
+
247
+ from pathlib import Path
248
+ from examples.rocket_demo import build_rocket, export_stl
249
+
250
+ components, assembly = build_rocket()
251
+ export_stl(assembly, Path("rocket_demo.stl"))
252
+
197
253
  The **yapCAD** system isn’t just about rendering, of course, it’s about
198
254
  computational geometry. For example, if you want to calculate the
199
255
  intersection of lines and arcs in a plane, we have you covered:
@@ -1,7 +1,7 @@
1
1
  # **yapCAD**
2
- yet another procedural CAD and computational geometry system written in python 3
2
+ yet another procedural CAD and computational geometry system written in python 3, now with a growing focus on 3D generative design and STL export
3
3
 
4
- ![**yapCAD** image](images/yapCadSplash.png)
4
+ ![**yapCAD** 3D rocket example](images/RocketDemoScreenshot.png)
5
5
 
6
6
  ## what's **yapCAD** for?
7
7
 
@@ -9,8 +9,12 @@ First and foremost, **yapCAD** is a framework for creating
9
9
  [parametric](https://en.wikipedia.org/wiki/Parametric_design),
10
10
  procedural, and
11
11
  [generative](https://en.wikipedia.org/wiki/Parametric_design) design
12
- systems. You can also use **yapCAD** for other CAD, CAM, and
13
- computational geometry purposes.
12
+ systems. With the 0.5.0 release the emphasis has shifted toward 3D
13
+ geometry workflows, including solids that can be exported directly to
14
+ STL for downstream slicing and simulation. You can still use
15
+ **yapCAD** for DXF generation, CAM, and computational geometry
16
+ experiments, but the core is increasingly optimised for 3D generative
17
+ design.
14
18
 
15
19
  ## software status
16
20
 
@@ -43,25 +47,26 @@ examples, clone the github repository as shown above, and make sure
43
47
  that your PYTHONPATH includes the cloned top-level `yapCAD` directory.
44
48
  You will find the examples in the `yapCAD/examples` directory.
45
49
 
46
- For a fully worked parametric design system, see the `boxcut` example.
50
+ For a fully worked 2D parametric design system, see the `boxcut`
51
+ example. For a 3D generative example that builds a multi-stage rocket,
52
+ visualises it, and exports STL, see `examples/rocket_demo.py`.
47
53
 
48
54
  ### documentation
49
55
 
50
56
  Online **yapCAD** documentation can be found here:
51
- https://yapcad.readthedocs.io/en/latest/ &mdash; for some reason
52
- `readthedocs.io` isn't generating the full module documentation, so
53
- you might want to build a local copy, as described below.
57
+ https://yapcad.readthedocs.io/en/latest/ &mdash; some module references
58
+ lag behind the current 3D-focused APIs, so you may want to build a
59
+ local copy (see below) to explore the latest `geometry_utils`,
60
+ `metadata`, `geometry_checks`, and `io.stl` modules.
54
61
 
55
- To build the HTML **yapCAD** documentation locally, first make sure
56
- you have the sphinx package installed:
62
+ To build the HTML **yapCAD** documentation locally, install the
63
+ documentation dependencies and run Sphinx from the project root:
57
64
 
58
- pip install sphinx --user
59
-
60
- Then clone the github repository as shown above,
61
- `cd` to the `yapCAD` directory, and type
65
+ ```bash
66
+ python3 -m pip install -r docs/requirements.txt
67
+ make -C docs html
68
+ ```
62
69
 
63
- make -C docs html
64
-
65
70
  This will build the HTML documents in the `build/sphinx/html`
66
71
  directory. You can also build documentation in the other formats
67
72
  supported by Sphinx. See the [Sphinx
@@ -70,33 +75,81 @@ information.
70
75
 
71
76
  ### running tests
72
77
 
73
- The repository includes a small pytest suite that exercises the core
74
- geometry primitives. Install the testing dependencies and run pytest
75
- from the project root with the source tree on `PYTHONPATH`:
78
+ The repository includes a comprehensive pytest suite that exercises both core
79
+ geometry primitives and visual rendering capabilities. First, set up the
80
+ testing environment:
76
81
 
77
82
  ```bash
78
- python3 -m pip install pytest pytest-cov
79
- PYTHONPATH=./src python3 -m pytest
83
+ # Create and activate virtual environment
84
+ pyenv local 3.12 # or use python3.12 directly
85
+ python3 -m venv v_312
86
+ source v_312/bin/activate
87
+
88
+ # Install dependencies
89
+ pip install -r requirements.txt
90
+ pip install pytest pytest-cov
91
+ ```
92
+
93
+ #### Non-Visual Tests (Automated/CI-friendly)
94
+
95
+ Run the core computational geometry tests (including triangle, metadata,
96
+ validation, and STL exporter checks) without interactive displays:
97
+
98
+ ```bash
99
+ # Run all non-visual tests
100
+ PYTHONPATH=./src pytest tests/ -m "not visual"
101
+
102
+ # With coverage reporting (default)
103
+ PYTHONPATH=./src pytest tests/ -m "not visual" --cov=src
104
+
105
+ # Skip coverage for faster execution
106
+ PYTHONPATH=./src pytest tests/ -m "not visual" --override-ini addopts=
80
107
  ```
81
108
 
82
- The default configuration enables coverage reporting via
83
- `pytest-cov`. If you prefer to skip coverage, you can override the
84
- options:
109
+ #### Visual Tests (Interactive)
110
+
111
+ yapCAD includes visual tests that create interactive 3D renderings to verify
112
+ geometry generation and display functionality (for example,
113
+ `tests/test_mesh_view.py::test_mesh_view_visual_normals`). These require a
114
+ display and user interaction:
85
115
 
86
116
  ```bash
87
- PYTHONPATH=./src python3 -m pytest --override-ini addopts=
117
+ # Run all visual tests (opens interactive windows)
118
+ ./run_visual_tests_venv.sh
119
+
120
+ # Run specific visual tests by pattern
121
+ ./run_visual_tests_venv.sh test_geom # Only test_geom* visual tests
122
+ ./run_visual_tests_venv.sh surface # Tests matching "surface"
123
+ ./run_visual_tests_venv.sh Face # Face-related tests
124
+
125
+ # Alternative: Manual pytest execution
126
+ VISUALTEST=true PYTHONPATH=./src pytest tests/ -m visual
127
+
128
+ # Or run individual visual tests
129
+ VISUALTEST=true PYTHONPATH=./src pytest tests/test_geom3d.py::TestSurface::test_surface -s
88
130
  ```
89
131
 
132
+ **Note:** Visual tests require closing each interactive window to proceed to the next test. Use the dedicated `run_visual_tests_venv.sh` script for the best experience, as it runs each test in an isolated subprocess to prevent early termination.
133
+
90
134
  ## **yapCAD** goals
91
135
 
92
136
  The purpose of **yapCAD** is to support 2D and 3D computational
93
137
  geometry and parametric, procedural, and generative design projects in
94
138
  python3. **yapCAD** is designed to support multiple rendering
95
139
  back-ends, such that a relatively small amount of code is necessary to
96
- add support for a 2D or 3D cad or drawing file format. At present,
97
- **yapCAD** supports the AutoCad DXF file format for creating
98
- two-dimensional drawings and OpenGL for creating interactive 2D and 3D
99
- renderings.
140
+ add support for a cad or drawing file format. At present,
141
+ **yapCAD** supports:
142
+
143
+ - AutoCAD DXF output for two-dimensional drawings (via
144
+ [ezdxf](https://github.com/mozman/ezdxf)).
145
+ - STL export for 3D solids (via the new `yapcad.io.stl` module).
146
+ - OpenGL visualisation for 2D/3D geometries using
147
+ [pyglet](https://github.com/pyglet/pyglet).
148
+
149
+ The 0.5.0 release lays the shared foundations (triangle utilities,
150
+ metadata, validation checks, and STL export) that pave the way toward
151
+ STEP support and a packaged, provenance-aware project model targeted for
152
+ the forthcoming 1.0 release.
100
153
 
101
154
  The foundations of **yapCAD** are grounded in decades of the author's
102
155
  experience with graphics system programming, 3D CAD and
@@ -115,7 +168,8 @@ package, and interactive OpenGL visualization using the amazing
115
168
 
116
169
  (for a more complete list, see the [examples folder](./examples/))
117
170
 
118
- It's pretty easy to make a DXF drawing with **yapCAD**. Here is an example:
171
+ It's pretty easy to make a DXF drawing or a 3D model with **yapCAD**. Here
172
+ is a DXF example:
119
173
 
120
174
  from yapcad.ezdxf_drawable import *
121
175
  from yapcad.geom import *
@@ -146,7 +200,17 @@ It's pretty easy to make a DXF drawing with **yapCAD**. Here is an example:
146
200
  dd.draw(arc(point(0,3),3,45,135))
147
201
 
148
202
  # write out the geometry as example1-out.dxf
149
- dd.display()
203
+ dd.display()
204
+
205
+ For a 3D example that generates a complete rocket assembly and exports STL:
206
+
207
+ ```python
208
+ from pathlib import Path
209
+ from examples.rocket_demo import build_rocket, export_stl
210
+
211
+ components, assembly = build_rocket()
212
+ export_stl(assembly, Path("rocket_demo.stl"))
213
+ ```
150
214
 
151
215
  The **yapCAD** system isn't just about rendering, of course, it's
152
216
  about computational geometry. For example, if you want to calculate