yapCAD 0.2.5__tar.gz → 0.3.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.
Files changed (120) hide show
  1. {yapCAD-0.2.5 → yapcad-0.3.1}/.gitignore +5 -0
  2. {yapCAD-0.2.5 → yapcad-0.3.1}/.readthedocs.yml +10 -1
  3. yapcad-0.3.1/CHANGELOG.rst +146 -0
  4. yapCAD-0.2.5/README.rst → yapcad-0.3.1/PKG-INFO +124 -28
  5. {yapCAD-0.2.5 → yapcad-0.3.1}/README.md +105 -22
  6. yapCAD-0.2.5/PKG-INFO → yapcad-0.3.1/README.rst +98 -46
  7. yapCAD-0.2.5/src/yapCAD.egg-info/PKG-INFO → yapcad-0.3.1/docs/README.rst +98 -46
  8. {yapCAD-0.2.5 → yapcad-0.3.1}/docs/conf.py +17 -5
  9. yapcad-0.3.1/docs/images/RocketDemoScreenshot.png +0 -0
  10. yapcad-0.3.1/docs/images/yapCadSplash.png +0 -0
  11. {yapCAD-0.2.5 → yapcad-0.3.1}/docs/index.rst +43 -13
  12. yapcad-0.3.1/docs/requirements.txt +2 -0
  13. yapcad-0.3.1/docs/yapCADfoundations.md +44 -0
  14. yapcad-0.3.1/docs/yapCADone.md +92 -0
  15. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/boxcut/boxcut.py +145 -111
  16. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/example1.py +12 -5
  17. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/example10.py +21 -67
  18. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/example11.py +22 -9
  19. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/example12.py +53 -25
  20. yapcad-0.3.1/examples/example13.py +107 -0
  21. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/example4.py +2 -2
  22. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/example6.py +3 -3
  23. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/example8-gl.py +10 -2
  24. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/example8.py +4 -4
  25. yapcad-0.3.1/examples/example9.py +105 -0
  26. yapcad-0.3.1/examples/rocket_demo.py +121 -0
  27. yapcad-0.3.1/images/RocketDemoScreenshot.png +0 -0
  28. yapcad-0.3.1/images/yapCadSplash.png +0 -0
  29. {yapCAD-0.2.5 → yapcad-0.3.1}/pyproject.toml +9 -6
  30. yapcad-0.3.1/pytest.ini +4 -0
  31. {yapCAD-0.2.5 → yapcad-0.3.1}/requirements.txt +8 -3
  32. yapcad-0.3.1/run_visual_tests.py +313 -0
  33. yapcad-0.3.1/run_visual_tests_venv.sh +19 -0
  34. {yapCAD-0.2.5 → yapcad-0.3.1}/setup.cfg +10 -1
  35. yapCAD-0.2.5/docs/README.rst → yapcad-0.3.1/src/yapCAD.egg-info/PKG-INFO +124 -28
  36. {yapCAD-0.2.5 → yapcad-0.3.1}/src/yapCAD.egg-info/SOURCES.txt +31 -0
  37. yapcad-0.3.1/src/yapCAD.egg-info/requires.txt +12 -0
  38. yapcad-0.3.1/src/yapcad/__init__.py +11 -0
  39. yapcad-0.3.1/src/yapcad/combine.py +98 -0
  40. {yapCAD-0.2.5 → yapcad-0.3.1}/src/yapcad/drawable.py +44 -3
  41. {yapCAD-0.2.5 → yapcad-0.3.1}/src/yapcad/ezdxf_drawable.py +1 -1
  42. {yapCAD-0.2.5 → yapcad-0.3.1}/src/yapcad/geom.py +214 -276
  43. yapcad-0.3.1/src/yapcad/geom3d.py +982 -0
  44. yapcad-0.3.1/src/yapcad/geom3d_util.py +541 -0
  45. yapcad-0.3.1/src/yapcad/geom_util.py +817 -0
  46. yapcad-0.3.1/src/yapcad/geometry.py +473 -0
  47. yapcad-0.3.1/src/yapcad/geometry_checks.py +112 -0
  48. yapcad-0.3.1/src/yapcad/geometry_utils.py +115 -0
  49. yapcad-0.3.1/src/yapcad/io/__init__.py +5 -0
  50. yapcad-0.3.1/src/yapcad/io/stl.py +83 -0
  51. yapcad-0.3.1/src/yapcad/mesh.py +46 -0
  52. yapcad-0.3.1/src/yapcad/metadata.py +109 -0
  53. yapcad-0.3.1/src/yapcad/octtree.py +627 -0
  54. {yapCAD-0.2.5 → yapcad-0.3.1}/src/yapcad/poly.py +153 -299
  55. yapcad-0.3.1/src/yapcad/pyglet_drawable.py +1035 -0
  56. yapcad-0.3.1/src/yapcad/triangulator.py +103 -0
  57. {yapCAD-0.2.5 → yapcad-0.3.1}/src/yapcad/xform.py +10 -5
  58. {yapCAD-0.2.5 → yapcad-0.3.1}/tests/test_geom.py +131 -13
  59. yapcad-0.3.1/tests/test_geom3d.py +711 -0
  60. yapcad-0.3.1/tests/test_geom_util.py +38 -0
  61. yapcad-0.3.1/tests/test_geometry.py +246 -0
  62. yapcad-0.3.1/tests/test_geometry_checks.py +91 -0
  63. yapcad-0.3.1/tests/test_geometry_utils.py +75 -0
  64. yapcad-0.3.1/tests/test_geomlist_snap.py +10 -0
  65. yapcad-0.3.1/tests/test_io_stl.py +41 -0
  66. yapcad-0.3.1/tests/test_mesh_view.py +122 -0
  67. yapcad-0.3.1/tests/test_metadata_utils.py +78 -0
  68. yapcad-0.3.1/tests/test_octtree.py +393 -0
  69. yapcad-0.3.1/tests/test_poly2surface_orientation.py +83 -0
  70. {yapCAD-0.2.5 → yapcad-0.3.1}/tests/test_xform.py +10 -0
  71. yapCAD-0.2.5/CHANGELOG.rst +0 -63
  72. yapCAD-0.2.5/docs/images/yapCadSplash.png +0 -0
  73. yapCAD-0.2.5/examples/example9.py +0 -148
  74. yapCAD-0.2.5/images/yapCadSplash.png +0 -0
  75. yapCAD-0.2.5/src/yapCAD.egg-info/requires.txt +0 -11
  76. yapCAD-0.2.5/src/yapcad/__init__.py +0 -11
  77. yapCAD-0.2.5/src/yapcad/combine.py +0 -386
  78. yapCAD-0.2.5/src/yapcad/geom3d.py +0 -62
  79. yapCAD-0.2.5/src/yapcad/geometry.py +0 -81
  80. yapCAD-0.2.5/src/yapcad/pyglet_drawable.py +0 -499
  81. {yapCAD-0.2.5 → yapcad-0.3.1}/.coveragerc +0 -0
  82. {yapCAD-0.2.5 → yapcad-0.3.1}/AUTHORS.rst +0 -0
  83. {yapCAD-0.2.5 → yapcad-0.3.1}/LICENSE +0 -0
  84. {yapCAD-0.2.5 → yapcad-0.3.1}/LICENSE.txt +0 -0
  85. {yapCAD-0.2.5 → yapcad-0.3.1}/docs/Makefile +0 -0
  86. {yapCAD-0.2.5 → yapcad-0.3.1}/docs/_static/.gitignore +0 -0
  87. {yapCAD-0.2.5 → yapcad-0.3.1}/docs/authors.rst +0 -0
  88. {yapCAD-0.2.5 → yapcad-0.3.1}/docs/changelog.rst +0 -0
  89. {yapCAD-0.2.5 → yapcad-0.3.1}/docs/images/laserbox.jpg +0 -0
  90. {yapCAD-0.2.5 → yapcad-0.3.1}/docs/license.rst +0 -0
  91. {yapCAD-0.2.5 → yapcad-0.3.1}/dxf/README.md +0 -0
  92. {yapCAD-0.2.5 → yapcad-0.3.1}/dxf/README.rst +0 -0
  93. {yapCAD-0.2.5 → yapcad-0.3.1}/dxf/boxout.dxf +0 -0
  94. {yapCAD-0.2.5 → yapcad-0.3.1}/dxf/example1-out.dxf +0 -0
  95. {yapCAD-0.2.5 → yapcad-0.3.1}/dxf/example10-out.dxf +0 -0
  96. {yapCAD-0.2.5 → yapcad-0.3.1}/dxf/example3-out.dxf +0 -0
  97. {yapCAD-0.2.5 → yapcad-0.3.1}/dxf/example4-out.dxf +0 -0
  98. {yapCAD-0.2.5 → yapcad-0.3.1}/dxf/example5-out.dxf +0 -0
  99. {yapCAD-0.2.5 → yapcad-0.3.1}/dxf/example6-out.dxf +0 -0
  100. {yapCAD-0.2.5 → yapcad-0.3.1}/dxf/example7-out.dxf +0 -0
  101. {yapCAD-0.2.5 → yapcad-0.3.1}/dxf/example8-out.dxf +0 -0
  102. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/README.md +0 -0
  103. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/README.rst +0 -0
  104. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/boxcut/README.md +0 -0
  105. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/boxcut/README.rst +0 -0
  106. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/example2.py +0 -0
  107. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/example3.py +0 -0
  108. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/example5.py +0 -0
  109. {yapCAD-0.2.5 → yapcad-0.3.1}/examples/example7.py +0 -0
  110. {yapCAD-0.2.5 → yapcad-0.3.1}/images/README.md +0 -0
  111. {yapCAD-0.2.5 → yapcad-0.3.1}/images/README.rst +0 -0
  112. {yapCAD-0.2.5 → yapcad-0.3.1}/images/example6-out.png +0 -0
  113. {yapCAD-0.2.5 → yapcad-0.3.1}/images/example8-out.png +0 -0
  114. {yapCAD-0.2.5 → yapcad-0.3.1}/images/yapCAD01.png +0 -0
  115. {yapCAD-0.2.5 → yapcad-0.3.1}/images/yapCAD02.png +0 -0
  116. {yapCAD-0.2.5 → yapcad-0.3.1}/setup.py +0 -0
  117. {yapCAD-0.2.5 → yapcad-0.3.1}/src/yapCAD.egg-info/dependency_links.txt +0 -0
  118. {yapCAD-0.2.5 → yapcad-0.3.1}/src/yapCAD.egg-info/not-zip-safe +0 -0
  119. {yapCAD-0.2.5 → yapcad-0.3.1}/src/yapCAD.egg-info/top_level.txt +0 -0
  120. {yapCAD-0.2.5 → yapcad-0.3.1}/tests/conftest.py +0 -0
@@ -48,6 +48,11 @@ MANIFEST
48
48
 
49
49
  # Per-project virtualenvs
50
50
  .venv*/
51
+ venv/
52
+ v_*/
53
+
54
+ #cached python version for pyenv
55
+ .python-version
51
56
 
52
57
  # generated DXF files in examples
53
58
  examples/*.dxf
@@ -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
@@ -0,0 +1,146 @@
1
+ =========
2
+ Changelog
3
+ =========
4
+
5
+ Version 0.5.0 (2024-09-30)
6
+ ==========================
7
+
8
+ what's new:
9
+ -----------
10
+
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.
40
+
41
+ Known problems
42
+ --------------
43
+
44
+ - Incomplete documentation, especially outside the ``yapcad.geom`` module.
45
+ - Occasional problems with complex boolean operations.
46
+ - Incomplete functionality around 3D modeling.
47
+
48
+ Version 0.3.1
49
+ =============
50
+
51
+ what's new:
52
+ -----------
53
+
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).
58
+
59
+ Known problems
60
+ --------------
61
+
62
+ - Incomplete documentation, especially outside the ``yapcad.geom`` module.
63
+ - Occasional problems with complex boolean operations.
64
+ - Incomplete functionality around 3D modeling.
65
+
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``.
79
+
80
+ Known problems
81
+ --------------
82
+
83
+ - Incomplete documentation, especially outside the ``yapcad.geom`` module.
84
+ - Occasional problems with complex boolean operations.
85
+ - Incomplete functionality around 3D modeling.
86
+
87
+ Version 0.2.0
88
+ =============
89
+
90
+ what's new:
91
+ -----------
92
+
93
+ - First announced version of **yapCAD**. Yay!
94
+
95
+ - Added new ``boxcut`` example, showing a fully worked (if simple)
96
+ parametric design system.
97
+
98
+ - Additional documentation updates and minor bugfixes.
99
+
100
+ Known problems
101
+ --------------
102
+
103
+ - Our `yapCAD readthedocs`_ documentation is missing the expanded
104
+ documentation from submodules, which is a problem since much of
105
+ **yapCAD**'s documentation is in the form of docstrings in the
106
+ source. I'm working on getting this sorted out. In the mean time,
107
+ you may want to build a local copy of the documentation as described
108
+ in the main ``README`` file. Or, checkout and read the source.
109
+
110
+ - Incomplete documentation, especially outside the ``yapcad.geom`` module.
111
+
112
+ - Occasional problems with complex boolean operations. A bug in the
113
+ ``intersectXY`` method of the ``Boolean`` class.
114
+
115
+ - Incomplete functionality around 3D modeling
116
+
117
+ - Inconsistent inclusion of licensing boilerplate, other minor
118
+ formatting issues.
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
+
146
+ .. _yapCAD readthedocs: https://yapcad.readthedocs.io/en/latest/index.html
@@ -1,13 +1,39 @@
1
+ Metadata-Version: 2.4
2
+ Name: yapCAD
3
+ Version: 0.3.1
4
+ Summary: yet another procedural CAD and computational geometry system
5
+ Author-email: Richard DeVaul <richard.devaul@gmail.com>
6
+ Project-URL: Homepage, https://github.com/rdevaul/yapCAD/
7
+ Project-URL: Documentation, https://yapcad.readthedocs.io/en/latest/
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/x-rst
13
+ License-File: LICENSE
14
+ License-File: LICENSE.txt
15
+ License-File: AUTHORS.rst
16
+ Requires-Dist: ezdxf>=1.1
17
+ Requires-Dist: pyglet<2,>=1.5
18
+ Requires-Dist: mpmath>=1.2
19
+ Requires-Dist: pyobjc-core; platform_system == "Darwin"
20
+ Requires-Dist: pyobjc-framework-Cocoa; platform_system == "Darwin"
21
+ Requires-Dist: pyobjc-framework-Quartz; platform_system == "Darwin"
22
+ Provides-Extra: tests
23
+ Requires-Dist: pytest; extra == "tests"
24
+ Requires-Dist: pytest-cov; extra == "tests"
25
+ Dynamic: license-file
26
+
1
27
  **yapCAD**
2
28
  ==========
3
29
 
4
30
  yet another procedural CAD and computational geometry system written in
5
- python 3
31
+ python 3, now with a growing focus on 3D generative design and STL export
6
32
 
7
- .. figure:: images/yapCadSplash.png
8
- :alt: **yapCAD** image
33
+ .. figure:: images/RocketDemoScreenshot.png
34
+ :alt: **yapCAD** rocket example
9
35
 
10
- **yapCAD** image
36
+ **yapCAD** rocket example
11
37
 
12
38
  what’s **yapCAD** for?
13
39
  ----------------------
@@ -16,8 +42,10 @@ First and foremost, **yapCAD** is a framework for creating
16
42
  `parametric <https://en.wikipedia.org/wiki/Parametric_design>`__,
17
43
  procedural, and
18
44
  `generative <https://en.wikipedia.org/wiki/Parametric_design>`__ design
19
- systems. You can also use **yapCAD** for other CAD, CAM, and
20
- computational geometry purposes.
45
+ systems. Starting with the 0.5 release, the emphasis has shifted toward
46
+ 3D solid workflows, including STL export for downstream slicing and
47
+ simulation, while retaining support for DXF generation and computational
48
+ geometry experiments.
21
49
 
22
50
  software status
23
51
  ---------------
@@ -58,28 +86,23 @@ clone the github repository as shown above, and make sure that your
58
86
  PYTHONPATH includes the cloned top-level ``yapCAD`` directory. You will
59
87
  find the examples in the ``yapCAD/examples`` directory.
60
88
 
61
- For a fully worked parametric design system, see the ``boxcut`` example.
89
+ For a fully worked 2D parametric design system, see the ``boxcut`` example.
90
+ For a 3D generative example that builds a multi-stage rocket, visualises
91
+ it, and exports STL, see ``examples/rocket_demo.py``.
62
92
 
63
93
  documentation
64
94
  ~~~~~~~~~~~~~
65
95
 
66
96
  Online **yapCAD** documentation can be found here:
67
- https://yapcad.readthedocs.io/en/latest/ — for some reason
68
- ``readthedocs.io`` isn’t generating the full module documentation, so
69
- you might want to build a local copy, as described below.
70
-
71
- To build the HTML **yapCAD** documentation locally, first make sure you
72
- have the sphinx package installed:
73
-
74
- ::
97
+ https://yapcad.readthedocs.io/en/latest/ — some module references lag
98
+ behind the latest 3D-focused APIs, so you may want to build a local copy
99
+ as described below to explore ``geometry_utils``, ``geometry_checks``,
100
+ ``metadata``, and ``io.stl``.
75
101
 
76
- pip install sphinx --user
77
-
78
- Then clone the github repository as shown above, ``cd`` to the
79
- ``yapCAD`` directory, and type
80
-
81
- ::
102
+ To build the HTML **yapCAD** documentation locally, install the
103
+ documentation dependencies and run Sphinx from the project root::
82
104
 
105
+ python3 -m pip install -r docs/requirements.txt
83
106
  make -C docs html
84
107
 
85
108
  This will build the HTML documents in the ``build/sphinx/html``
@@ -88,16 +111,80 @@ supported by Sphinx. See the `Sphinx
88
111
  documentation <https://www.sphinx-doc.org/en/master/>`__ for more
89
112
  information.
90
113
 
114
+ running tests
115
+ ~~~~~~~~~~~~~
116
+
117
+ The repository includes a comprehensive pytest suite that exercises both core
118
+ geometry primitives and visual rendering capabilities. First, set up the
119
+ testing environment::
120
+
121
+ # Create and activate virtual environment
122
+ pyenv local 3.12 # or use python3.12 directly
123
+ python3 -m venv v_312
124
+ source v_312/bin/activate
125
+
126
+ # Install dependencies
127
+ pip install -r requirements.txt
128
+ pip install pytest pytest-cov
129
+
130
+ Non-Visual Tests (Automated/CI-friendly)
131
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132
+
133
+ Run the core computational geometry tests (including triangle, metadata,
134
+ validation, and STL exporter checks) without interactive displays::
135
+
136
+ # Run all non-visual tests
137
+ PYTHONPATH=./src pytest tests/ -m "not visual"
138
+
139
+ # With coverage reporting (default)
140
+ PYTHONPATH=./src pytest tests/ -m "not visual" --cov=src
141
+
142
+ # Skip coverage for faster execution
143
+ PYTHONPATH=./src pytest tests/ -m "not visual" --override-ini addopts=
144
+
145
+ Visual Tests (Interactive)
146
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
147
+
148
+ yapCAD includes visual tests that create interactive 3D renderings to verify
149
+ geometry generation and display functionality (for example,
150
+ ``tests/test_mesh_view.py::test_mesh_view_visual_normals``). These require a
151
+ display and user interaction::
152
+
153
+ # Run all visual tests (opens interactive windows)
154
+ ./run_visual_tests_venv.sh
155
+
156
+ # Run specific visual tests by pattern
157
+ ./run_visual_tests_venv.sh test_geom # Only test_geom* visual tests
158
+ ./run_visual_tests_venv.sh surface # Tests matching "surface"
159
+ ./run_visual_tests_venv.sh Face # Face-related tests
160
+
161
+ # Alternative: Manual pytest execution
162
+ VISUALTEST=true PYTHONPATH=./src pytest tests/ -m visual
163
+
164
+ # Or run individual visual tests
165
+ VISUALTEST=true PYTHONPATH=./src pytest tests/test_geom3d.py::TestSurface::test_surface -s
166
+
167
+ **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.
168
+
91
169
  **yapCAD** goals
92
170
  ----------------
93
171
 
94
172
  The purpose of **yapCAD** is to support 2D and 3D computational geometry
95
173
  and parametric, procedural, and generative design projects in python3.
96
- **yapCAD** is designed to support multiple rendering back-ends, such
97
- that a relatively small amount of code is necessary to add support for a
98
- 2D or 3D cad or drawing file format. At present, **yapCAD** supports the
99
- AutoCad DXF file format for creating two-dimensional drawings and OpenGL
100
- for creating interactive 2D and 3D renderings.
174
+ **yapCAD** is designed to support multiple rendering back-ends, such that
175
+ only a small amount of code is necessary to add support for a CAD or
176
+ drawing file format. At present, **yapCAD** supports:
177
+
178
+ * AutoCAD DXF output for two-dimensional drawings (via
179
+ `ezdxf <https://github.com/mozman/ezdxf>`__).
180
+ * STL export for 3D solids (via the new ``yapcad.io.stl`` module).
181
+ * OpenGL visualisation for 2D/3D geometries using
182
+ `pyglet <https://github.com/pyglet/pyglet>`__.
183
+
184
+ The 0.5.0 release lays the shared foundations (triangle utilities,
185
+ metadata, validation checks, and STL export) that pave the way toward STEP
186
+ support and a packaged, provenance-aware project model targeted for the
187
+ forthcoming 1.0 release.
101
188
 
102
189
  The foundations of **yapCAD** are grounded in decades of the author’s
103
190
  experience with graphics system programming, 3D CAD and simulation.
@@ -116,8 +203,8 @@ package, and interactive OpenGL visualization using the amazing
116
203
 
117
204
  (for a more complete list, see the `examples folder <./examples/>`__)
118
205
 
119
- It’s pretty easy to make a DXF drawing with **yapCAD**. Here is an
120
- example:
206
+ It’s pretty easy to make a DXF drawing or a 3D model with **yapCAD**. Here
207
+ is a DXF example:
121
208
 
122
209
  ::
123
210
 
@@ -152,6 +239,15 @@ example:
152
239
  # write out the geometry as example1-out.dxf
153
240
  dd.display()
154
241
 
242
+ For a 3D example that generates a complete rocket assembly and exports
243
+ STL::
244
+
245
+ from pathlib import Path
246
+ from examples.rocket_demo import build_rocket, export_stl
247
+
248
+ components, assembly = build_rocket()
249
+ export_stl(assembly, Path("rocket_demo.stl"))
250
+
155
251
  The **yapCAD** system isn’t just about rendering, of course, it’s about
156
252
  computational geometry. For example, if you want to calculate the
157
253
  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,41 +47,109 @@ 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
65
+ ```bash
66
+ python3 -m pip install -r docs/requirements.txt
67
+ make -C docs html
68
+ ```
59
69
 
60
- Then clone the github repository as shown above,
61
- `cd` to the `yapCAD` directory, and type
62
-
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
68
73
  documentation](https://www.sphinx-doc.org/en/master/) for more
69
74
  information.
70
75
 
76
+ ### running tests
77
+
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:
81
+
82
+ ```bash
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=
107
+ ```
108
+
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:
115
+
116
+ ```bash
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
130
+ ```
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
+
71
134
  ## **yapCAD** goals
72
135
 
73
136
  The purpose of **yapCAD** is to support 2D and 3D computational
74
137
  geometry and parametric, procedural, and generative design projects in
75
138
  python3. **yapCAD** is designed to support multiple rendering
76
139
  back-ends, such that a relatively small amount of code is necessary to
77
- add support for a 2D or 3D cad or drawing file format. At present,
78
- **yapCAD** supports the AutoCad DXF file format for creating
79
- two-dimensional drawings and OpenGL for creating interactive 2D and 3D
80
- 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.
81
153
 
82
154
  The foundations of **yapCAD** are grounded in decades of the author's
83
155
  experience with graphics system programming, 3D CAD and
@@ -96,7 +168,8 @@ package, and interactive OpenGL visualization using the amazing
96
168
 
97
169
  (for a more complete list, see the [examples folder](./examples/))
98
170
 
99
- 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:
100
173
 
101
174
  from yapcad.ezdxf_drawable import *
102
175
  from yapcad.geom import *
@@ -127,7 +200,17 @@ It's pretty easy to make a DXF drawing with **yapCAD**. Here is an example:
127
200
  dd.draw(arc(point(0,3),3,45,135))
128
201
 
129
202
  # write out the geometry as example1-out.dxf
130
- 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
+ ```
131
214
 
132
215
  The **yapCAD** system isn't just about rendering, of course, it's
133
216
  about computational geometry. For example, if you want to calculate