nurbforge 0.9.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 (192) hide show
  1. nurbforge-0.9.0/.clang-format +8 -0
  2. nurbforge-0.9.0/.clang-tidy +11 -0
  3. nurbforge-0.9.0/.editorconfig +15 -0
  4. nurbforge-0.9.0/.gitattributes +3 -0
  5. nurbforge-0.9.0/.github/ISSUE_TEMPLATE/bug_report.yml +26 -0
  6. nurbforge-0.9.0/.github/ISSUE_TEMPLATE/config.yml +1 -0
  7. nurbforge-0.9.0/.github/ISSUE_TEMPLATE/feature_request.yml +21 -0
  8. nurbforge-0.9.0/.github/pull_request_template.md +7 -0
  9. nurbforge-0.9.0/.github/workflows/ci.yml +124 -0
  10. nurbforge-0.9.0/.github/workflows/docs.yml +82 -0
  11. nurbforge-0.9.0/.github/workflows/wheels.yml +138 -0
  12. nurbforge-0.9.0/.gitignore +39 -0
  13. nurbforge-0.9.0/CHANGELOG.md +394 -0
  14. nurbforge-0.9.0/CMakeLists.txt +117 -0
  15. nurbforge-0.9.0/CMakePresets.json +94 -0
  16. nurbforge-0.9.0/CONTRIBUTING.md +58 -0
  17. nurbforge-0.9.0/LICENSE +21 -0
  18. nurbforge-0.9.0/PKG-INFO +160 -0
  19. nurbforge-0.9.0/README.md +123 -0
  20. nurbforge-0.9.0/SECURITY.md +9 -0
  21. nurbforge-0.9.0/benchmarks/CMakeLists.txt +14 -0
  22. nurbforge-0.9.0/benchmarks/bench.cpp +122 -0
  23. nurbforge-0.9.0/benchmarks/stress.cpp +281 -0
  24. nurbforge-0.9.0/cmake/CompilerWarnings.cmake +15 -0
  25. nurbforge-0.9.0/docs/Doxyfile +20 -0
  26. nurbforge-0.9.0/docs/adr/0001-cpp-core-python-api.md +11 -0
  27. nurbforge-0.9.0/docs/adr/0002-dependency-free-kernel.md +11 -0
  28. nurbforge-0.9.0/docs/adr/0003-gmsh-exact-transfer.md +11 -0
  29. nurbforge-0.9.0/docs/adr/0004-llm-whitelisted-tools.md +10 -0
  30. nurbforge-0.9.0/docs/adr/0005-tolerance-model.md +30 -0
  31. nurbforge-0.9.0/docs/adr/README.md +12 -0
  32. nurbforge-0.9.0/docs/api/cpp-reference.md +16 -0
  33. nurbforge-0.9.0/docs/api/cpp.md +92 -0
  34. nurbforge-0.9.0/docs/api/python-reference.md +37 -0
  35. nurbforge-0.9.0/docs/api/python.md +52 -0
  36. nurbforge-0.9.0/docs/architecture.md +74 -0
  37. nurbforge-0.9.0/docs/benchmarks.md +83 -0
  38. nurbforge-0.9.0/docs/build/almalinux10.md +56 -0
  39. nurbforge-0.9.0/docs/build/macos.md +64 -0
  40. nurbforge-0.9.0/docs/build/windows11.md +61 -0
  41. nurbforge-0.9.0/docs/conf.py +119 -0
  42. nurbforge-0.9.0/docs/index.md +66 -0
  43. nurbforge-0.9.0/docs/io.md +247 -0
  44. nurbforge-0.9.0/docs/llm.md +102 -0
  45. nurbforge-0.9.0/docs/math/nurbs.md +437 -0
  46. nurbforge-0.9.0/docs/meshing.md +151 -0
  47. nurbforge-0.9.0/docs/optics.md +45 -0
  48. nurbforge-0.9.0/docs/roadmap.md +65 -0
  49. nurbforge-0.9.0/docs/tutorial.md +339 -0
  50. nurbforge-0.9.0/examples/cpp/CMakeLists.txt +7 -0
  51. nurbforge-0.9.0/examples/cpp/booleans.cpp +68 -0
  52. nurbforge-0.9.0/examples/cpp/lens_surface.cpp +24 -0
  53. nurbforge-0.9.0/examples/python/01_primitives.py +13 -0
  54. nurbforge-0.9.0/examples/python/02_lens_and_mesh.py +39 -0
  55. nurbforge-0.9.0/examples/python/03_patterns.py +14 -0
  56. nurbforge-0.9.0/examples/python/04_llm_ollama.py +11 -0
  57. nurbforge-0.9.0/examples/python/05_fitting.py +57 -0
  58. nurbforge-0.9.0/examples/python/06_loft_sweep_gordon.py +59 -0
  59. nurbforge-0.9.0/examples/python/07_freeform_optics.py +72 -0
  60. nurbforge-0.9.0/examples/python/08_intersect_trim.py +51 -0
  61. nurbforge-0.9.0/examples/python/09_solids_booleans.py +67 -0
  62. nurbforge-0.9.0/examples/python/10_offsets_fillets.py +54 -0
  63. nurbforge-0.9.0/examples/python/11_slice_and_hatch.py +40 -0
  64. nurbforge-0.9.0/include/nurbforge/analysis/closest_point.hpp +48 -0
  65. nurbforge-0.9.0/include/nurbforge/analysis/hatch.hpp +105 -0
  66. nurbforge-0.9.0/include/nurbforge/analysis/intersect.hpp +42 -0
  67. nurbforge-0.9.0/include/nurbforge/analysis/properties.hpp +74 -0
  68. nurbforge-0.9.0/include/nurbforge/analysis/section.hpp +39 -0
  69. nurbforge-0.9.0/include/nurbforge/analysis/shell_section.hpp +80 -0
  70. nurbforge-0.9.0/include/nurbforge/analysis/surface_intersect.hpp +58 -0
  71. nurbforge-0.9.0/include/nurbforge/core/error.hpp +19 -0
  72. nurbforge-0.9.0/include/nurbforge/core/tolerance.hpp +29 -0
  73. nurbforge-0.9.0/include/nurbforge/core/vec.hpp +66 -0
  74. nurbforge-0.9.0/include/nurbforge/fitting/fit.hpp +84 -0
  75. nurbforge-0.9.0/include/nurbforge/geometry/primitives.hpp +80 -0
  76. nurbforge-0.9.0/include/nurbforge/geometry/transform.hpp +42 -0
  77. nurbforge-0.9.0/include/nurbforge/io/step.hpp +97 -0
  78. nurbforge-0.9.0/include/nurbforge/modeling/construct.hpp +39 -0
  79. nurbforge-0.9.0/include/nurbforge/modeling/extend.hpp +36 -0
  80. nurbforge-0.9.0/include/nurbforge/modeling/fillet.hpp +136 -0
  81. nurbforge-0.9.0/include/nurbforge/modeling/gordon.hpp +30 -0
  82. nurbforge-0.9.0/include/nurbforge/modeling/loft.hpp +32 -0
  83. nurbforge-0.9.0/include/nurbforge/modeling/offset.hpp +56 -0
  84. nurbforge-0.9.0/include/nurbforge/modeling/pattern.hpp +34 -0
  85. nurbforge-0.9.0/include/nurbforge/modeling/sweep.hpp +49 -0
  86. nurbforge-0.9.0/include/nurbforge/nurbforge.hpp +37 -0
  87. nurbforge-0.9.0/include/nurbforge/nurbs/basis.hpp +21 -0
  88. nurbforge-0.9.0/include/nurbforge/nurbs/curve.hpp +116 -0
  89. nurbforge-0.9.0/include/nurbforge/nurbs/join.hpp +32 -0
  90. nurbforge-0.9.0/include/nurbforge/nurbs/knot_vector.hpp +32 -0
  91. nurbforge-0.9.0/include/nurbforge/nurbs/surface.hpp +123 -0
  92. nurbforge-0.9.0/include/nurbforge/optics/surfaces.hpp +90 -0
  93. nurbforge-0.9.0/include/nurbforge/topology/boolean.hpp +33 -0
  94. nurbforge-0.9.0/include/nurbforge/topology/shell.hpp +111 -0
  95. nurbforge-0.9.0/include/nurbforge/topology/solids.hpp +37 -0
  96. nurbforge-0.9.0/include/nurbforge/topology/trimmed_surface.hpp +120 -0
  97. nurbforge-0.9.0/include/nurbforge/version.hpp.in +5 -0
  98. nurbforge-0.9.0/pyproject.toml +86 -0
  99. nurbforge-0.9.0/python/bindings/CMakeLists.txt +30 -0
  100. nurbforge-0.9.0/python/bindings/module.cpp +1009 -0
  101. nurbforge-0.9.0/python/nurbforge/__init__.py +142 -0
  102. nurbforge-0.9.0/python/nurbforge/llm/__init__.py +9 -0
  103. nurbforge-0.9.0/python/nurbforge/llm/agent.py +83 -0
  104. nurbforge-0.9.0/python/nurbforge/llm/cli.py +44 -0
  105. nurbforge-0.9.0/python/nurbforge/llm/constraints.py +183 -0
  106. nurbforge-0.9.0/python/nurbforge/llm/ollama_client.py +57 -0
  107. nurbforge-0.9.0/python/nurbforge/llm/tools.py +525 -0
  108. nurbforge-0.9.0/python/nurbforge/llm/verify.py +158 -0
  109. nurbforge-0.9.0/python/nurbforge/mesh/__init__.py +12 -0
  110. nurbforge-0.9.0/python/nurbforge/mesh/gmsh_export.py +376 -0
  111. nurbforge-0.9.0/python/nurbforge/mesh/surface_mesh.py +242 -0
  112. nurbforge-0.9.0/python/nurbforge/patterns.py +14 -0
  113. nurbforge-0.9.0/python/nurbforge/py.typed +0 -0
  114. nurbforge-0.9.0/src/analysis/closest_point.cpp +294 -0
  115. nurbforge-0.9.0/src/analysis/hatch.cpp +740 -0
  116. nurbforge-0.9.0/src/analysis/intersect.cpp +470 -0
  117. nurbforge-0.9.0/src/analysis/properties.cpp +340 -0
  118. nurbforge-0.9.0/src/analysis/section.cpp +104 -0
  119. nurbforge-0.9.0/src/analysis/shell_section.cpp +492 -0
  120. nurbforge-0.9.0/src/analysis/surface_intersect.cpp +974 -0
  121. nurbforge-0.9.0/src/core/vec.cpp +16 -0
  122. nurbforge-0.9.0/src/fitting/fit.cpp +456 -0
  123. nurbforge-0.9.0/src/geometry/primitives.cpp +262 -0
  124. nurbforge-0.9.0/src/geometry/transform.cpp +68 -0
  125. nurbforge-0.9.0/src/io/step.cpp +497 -0
  126. nurbforge-0.9.0/src/io/step_read.cpp +1756 -0
  127. nurbforge-0.9.0/src/modeling/construct.cpp +148 -0
  128. nurbforge-0.9.0/src/modeling/extend.cpp +224 -0
  129. nurbforge-0.9.0/src/modeling/fillet.cpp +456 -0
  130. nurbforge-0.9.0/src/modeling/gordon.cpp +217 -0
  131. nurbforge-0.9.0/src/modeling/loft.cpp +86 -0
  132. nurbforge-0.9.0/src/modeling/offset.cpp +353 -0
  133. nurbforge-0.9.0/src/modeling/pattern.cpp +39 -0
  134. nurbforge-0.9.0/src/modeling/sweep.cpp +223 -0
  135. nurbforge-0.9.0/src/nurbs/basis.cpp +89 -0
  136. nurbforge-0.9.0/src/nurbs/curve.cpp +234 -0
  137. nurbforge-0.9.0/src/nurbs/join.cpp +121 -0
  138. nurbforge-0.9.0/src/nurbs/knot_vector.cpp +69 -0
  139. nurbforge-0.9.0/src/nurbs/reduce.cpp +226 -0
  140. nurbforge-0.9.0/src/nurbs/refine.cpp +307 -0
  141. nurbforge-0.9.0/src/nurbs/refine_detail.hpp +72 -0
  142. nurbforge-0.9.0/src/nurbs/surface.cpp +356 -0
  143. nurbforge-0.9.0/src/optics/surfaces.cpp +300 -0
  144. nurbforge-0.9.0/src/topology/arrangement.cpp +299 -0
  145. nurbforge-0.9.0/src/topology/boolean.cpp +523 -0
  146. nurbforge-0.9.0/src/topology/shell.cpp +453 -0
  147. nurbforge-0.9.0/src/topology/solids.cpp +103 -0
  148. nurbforge-0.9.0/src/topology/trimmed_surface.cpp +617 -0
  149. nurbforge-0.9.0/tests/cpp/CMakeLists.txt +48 -0
  150. nurbforge-0.9.0/tests/cpp/test_basis.cpp +46 -0
  151. nurbforge-0.9.0/tests/cpp/test_boolean.cpp +405 -0
  152. nurbforge-0.9.0/tests/cpp/test_closest_point.cpp +196 -0
  153. nurbforge-0.9.0/tests/cpp/test_construct.cpp +58 -0
  154. nurbforge-0.9.0/tests/cpp/test_curve.cpp +70 -0
  155. nurbforge-0.9.0/tests/cpp/test_curve_constructors.cpp +163 -0
  156. nurbforge-0.9.0/tests/cpp/test_derivatives.cpp +121 -0
  157. nurbforge-0.9.0/tests/cpp/test_elevate.cpp +161 -0
  158. nurbforge-0.9.0/tests/cpp/test_extend.cpp +150 -0
  159. nurbforge-0.9.0/tests/cpp/test_face_labels.cpp +79 -0
  160. nurbforge-0.9.0/tests/cpp/test_fillet.cpp +263 -0
  161. nurbforge-0.9.0/tests/cpp/test_fitting.cpp +196 -0
  162. nurbforge-0.9.0/tests/cpp/test_gordon.cpp +127 -0
  163. nurbforge-0.9.0/tests/cpp/test_hatch.cpp +400 -0
  164. nurbforge-0.9.0/tests/cpp/test_intersect.cpp +184 -0
  165. nurbforge-0.9.0/tests/cpp/test_loft.cpp +112 -0
  166. nurbforge-0.9.0/tests/cpp/test_offset.cpp +233 -0
  167. nurbforge-0.9.0/tests/cpp/test_optics.cpp +179 -0
  168. nurbforge-0.9.0/tests/cpp/test_properties.cpp +153 -0
  169. nurbforge-0.9.0/tests/cpp/test_reduce.cpp +189 -0
  170. nurbforge-0.9.0/tests/cpp/test_refine.cpp +187 -0
  171. nurbforge-0.9.0/tests/cpp/test_section.cpp +74 -0
  172. nurbforge-0.9.0/tests/cpp/test_shell.cpp +105 -0
  173. nurbforge-0.9.0/tests/cpp/test_shell_section.cpp +171 -0
  174. nurbforge-0.9.0/tests/cpp/test_solids.cpp +163 -0
  175. nurbforge-0.9.0/tests/cpp/test_split_join.cpp +217 -0
  176. nurbforge-0.9.0/tests/cpp/test_step.cpp +263 -0
  177. nurbforge-0.9.0/tests/cpp/test_step_read.cpp +426 -0
  178. nurbforge-0.9.0/tests/cpp/test_surface.cpp +24 -0
  179. nurbforge-0.9.0/tests/cpp/test_surface_intersect.cpp +172 -0
  180. nurbforge-0.9.0/tests/cpp/test_sweep.cpp +129 -0
  181. nurbforge-0.9.0/tests/cpp/test_transform.cpp +29 -0
  182. nurbforge-0.9.0/tests/cpp/test_trimmed.cpp +249 -0
  183. nurbforge-0.9.0/tests/python/test_core.py +477 -0
  184. nurbforge-0.9.0/tests/python/test_curve_constructors.py +29 -0
  185. nurbforge-0.9.0/tests/python/test_examples.py +66 -0
  186. nurbforge-0.9.0/tests/python/test_face_labels.py +40 -0
  187. nurbforge-0.9.0/tests/python/test_hatch.py +77 -0
  188. nurbforge-0.9.0/tests/python/test_llm.py +358 -0
  189. nurbforge-0.9.0/tests/python/test_mesh.py +398 -0
  190. nurbforge-0.9.0/tests/python/test_shell_section.py +36 -0
  191. nurbforge-0.9.0/tests/python/test_solids.py +52 -0
  192. nurbforge-0.9.0/tests/python/test_step.py +215 -0
@@ -0,0 +1,8 @@
1
+ BasedOnStyle: Google
2
+ ColumnLimit: 100
3
+ IndentWidth: 2
4
+ AllowShortFunctionsOnASingleLine: All
5
+ AllowShortIfStatementsOnASingleLine: WithoutElse
6
+ DerivePointerAlignment: false
7
+ PointerAlignment: Left
8
+ IncludeBlocks: Regroup
@@ -0,0 +1,11 @@
1
+ Checks: >
2
+ bugprone-*,
3
+ performance-*,
4
+ modernize-*,
5
+ readability-*,
6
+ -modernize-use-trailing-return-type,
7
+ -readability-identifier-length,
8
+ -readability-magic-numbers,
9
+ -bugprone-easily-swappable-parameters
10
+ WarningsAsErrors: ''
11
+ HeaderFilterRegex: 'include/nurbforge/.*'
@@ -0,0 +1,15 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+ indent_style = space
9
+ indent_size = 2
10
+
11
+ [*.py]
12
+ indent_size = 4
13
+
14
+ [*.md]
15
+ trim_trailing_whitespace = false
@@ -0,0 +1,3 @@
1
+ * text=auto eol=lf
2
+ *.bat text eol=crlf
3
+ *.ps1 text eol=crlf
@@ -0,0 +1,26 @@
1
+ name: Bug report
2
+ description: Something produces wrong geometry, crashes or fails to build
3
+ labels: [bug]
4
+ body:
5
+ - type: textarea
6
+ id: what
7
+ attributes:
8
+ label: What happened?
9
+ description: Include a minimal script (Python or C++) that reproduces the problem.
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: expected
14
+ attributes:
15
+ label: Expected result
16
+ - type: dropdown
17
+ id: platform
18
+ attributes:
19
+ label: Platform
20
+ options: [AlmaLinux 10, Windows 11, Other]
21
+ validations:
22
+ required: true
23
+ - type: input
24
+ id: version
25
+ attributes:
26
+ label: Nurbforge version / commit
@@ -0,0 +1 @@
1
+ blank_issues_enabled: true
@@ -0,0 +1,21 @@
1
+ name: Feature request
2
+ description: Propose a new geometric operation or integration
3
+ labels: [enhancement]
4
+ body:
5
+ - type: textarea
6
+ id: use-case
7
+ attributes:
8
+ label: Use case
9
+ description: Which scientific workflow needs this (optics, FEM, BEM, FMM, ...)?
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: proposal
14
+ attributes:
15
+ label: Proposed API
16
+ description: Sketch the Python and/or C++ call.
17
+ - type: textarea
18
+ id: references
19
+ attributes:
20
+ label: References
21
+ description: Algorithms, papers, NURBS Book sections.
@@ -0,0 +1,7 @@
1
+ ## Summary
2
+
3
+ ## Checklist
4
+ - [ ] Tests added/updated (C++ and/or Python)
5
+ - [ ] Python bindings updated if the C++ API changed
6
+ - [ ] Documentation and CHANGELOG updated
7
+ - [ ] CI green on AlmaLinux 10 and Windows 11
@@ -0,0 +1,124 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ almalinux10:
18
+ name: AlmaLinux 10 (GCC)
19
+ runs-on: ubuntu-latest
20
+ container: almalinux:10
21
+ steps:
22
+ - name: System packages
23
+ run: |
24
+ dnf install -y gcc-c++ git python3 python3-devel python3-pip \
25
+ mesa-libGL mesa-libGLU libglvnd-opengl libgomp fontconfig \
26
+ libX11 libXext libXfixes libXcursor libXinerama libXft libXrender
27
+ - uses: actions/checkout@v5
28
+ - name: Python environment
29
+ run: |
30
+ python3 -m venv /opt/venv
31
+ /opt/venv/bin/pip install --upgrade pip cmake ninja pybind11 scikit-build-core
32
+ - name: Configure & build (C++)
33
+ run: |
34
+ export PATH=/opt/venv/bin:$PATH
35
+ cmake --preset ci -DNF_BUILD_PYTHON=OFF
36
+ cmake --build --preset ci -j
37
+ - name: C++ tests
38
+ run: /opt/venv/bin/ctest --preset ci
39
+ - name: Python package & tests
40
+ run: |
41
+ export PATH=/opt/venv/bin:$PATH
42
+ pip install ".[dev]"
43
+ python -c "import gmsh; print('gmsh', gmsh.__version__)"
44
+ pytest -v
45
+
46
+ windows11:
47
+ name: Windows (MSVC)
48
+ runs-on: windows-latest
49
+ steps:
50
+ - uses: actions/checkout@v5
51
+ - uses: actions/setup-python@v6
52
+ with:
53
+ python-version: "3.12"
54
+ - name: Configure & build (C++)
55
+ run: |
56
+ pip install pybind11
57
+ cmake --preset msvc -DNF_BUILD_PYTHON=OFF
58
+ cmake --build --preset msvc
59
+ - name: C++ tests
60
+ run: ctest --preset msvc
61
+ - name: Python package & tests
62
+ run: |
63
+ pip install ".[dev]"
64
+ python -c "import gmsh; print('gmsh', gmsh.__version__)"
65
+ pytest -v
66
+
67
+ macos:
68
+ name: macOS (Apple Clang, arm64)
69
+ runs-on: macos-latest
70
+ env:
71
+ MACOSX_DEPLOYMENT_TARGET: "14.0" # same as the release wheels (pyproject.toml)
72
+ steps:
73
+ - uses: actions/checkout@v5
74
+ - uses: actions/setup-python@v6
75
+ with:
76
+ python-version: "3.12"
77
+ - name: Tools
78
+ run: pip install --upgrade cmake ninja pybind11 scikit-build-core
79
+ - name: Configure & build (C++)
80
+ run: |
81
+ cmake --preset ci -DNF_BUILD_PYTHON=OFF
82
+ cmake --build --preset ci -j
83
+ - name: C++ tests
84
+ run: ctest --preset ci
85
+ - name: Python package & tests
86
+ run: |
87
+ pip install ".[dev]"
88
+ python -c "import gmsh; print('gmsh', gmsh.__version__)"
89
+ pytest -v
90
+
91
+ tsan:
92
+ name: ThreadSanitizer (concurrent const queries)
93
+ runs-on: ubuntu-latest
94
+ steps:
95
+ - uses: actions/checkout@v5
96
+ - name: Tools
97
+ run: |
98
+ sudo apt-get update
99
+ sudo apt-get install -y ninja-build
100
+ sudo sysctl vm.mmap_rnd_bits=28 # TSAN needs a smaller ASLR range on current kernels
101
+ - name: Configure & build
102
+ run: |
103
+ cmake -S . -B build/tsan -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DNF_BUILD_PYTHON=OFF \
104
+ -DNF_BUILD_EXAMPLES=OFF -DCMAKE_CXX_FLAGS="-fsanitize=thread -fno-omit-frame-pointer"
105
+ cmake --build build/tsan --target nurbforge_tests -j
106
+ - name: Concurrent queries under TSAN
107
+ env:
108
+ TSAN_OPTIONS: halt_on_error=1
109
+ run: ./build/tsan/tests/cpp/nurbforge_tests "[threads]"
110
+
111
+ lint:
112
+ name: Lint (ruff, clang-format)
113
+ runs-on: ubuntu-latest
114
+ steps:
115
+ - uses: actions/checkout@v5
116
+ - uses: actions/setup-python@v6
117
+ with:
118
+ python-version: "3.12"
119
+ - run: pip install ruff clang-format
120
+ - run: ruff check python tests examples
121
+ - name: clang-format (report only)
122
+ run: |
123
+ find include src python/bindings tests/cpp examples/cpp -name '*.[ch]pp' \
124
+ | xargs clang-format --dry-run || true
@@ -0,0 +1,82 @@
1
+ name: Docs
2
+
3
+ # Builds the documentation site (Doxygen XML -> Breathe, Markdown via MyST, Python autodoc)
4
+ # and deploys it to GitHub Pages from main. Warnings are reported but not fatal yet.
5
+ # One-time repository setting: Settings -> Pages -> Source: "GitHub Actions".
6
+
7
+ on:
8
+ push:
9
+ branches: [main]
10
+ pull_request:
11
+ paths:
12
+ - docs/**
13
+ - include/**
14
+ - python/nurbforge/**
15
+ - README.md
16
+ - pyproject.toml
17
+ - .github/workflows/docs.yml
18
+ workflow_dispatch:
19
+
20
+ permissions:
21
+ contents: read
22
+
23
+ concurrency:
24
+ group: ${{ github.workflow }}-${{ github.ref }}
25
+ cancel-in-progress: true
26
+
27
+ jobs:
28
+ build:
29
+ name: Build documentation
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - uses: actions/checkout@v5
33
+ - uses: actions/setup-python@v6
34
+ with:
35
+ python-version: "3.12"
36
+ - name: Doxygen
37
+ run: |
38
+ sudo apt-get update
39
+ sudo apt-get install -y --no-install-recommends doxygen
40
+ doxygen --version
41
+ - name: Python package (compiled _core for autodoc) and Sphinx
42
+ run: python -m pip install ".[docs]"
43
+ - name: Doxygen XML
44
+ run: |
45
+ mkdir -p build/docs # doxygen does not create nested output directories
46
+ doxygen docs/Doxyfile
47
+ - name: Sphinx
48
+ run: |
49
+ sphinx-build -b html --keep-going -w build/sphinx-warnings.log docs build/sphinx/html
50
+ - name: Warning summary
51
+ if: always()
52
+ run: |
53
+ if [ -s build/sphinx-warnings.log ]; then
54
+ echo "::warning::Sphinx reported $(wc -l < build/sphinx-warnings.log) warning line(s)"
55
+ {
56
+ echo '### Sphinx warnings'
57
+ echo '```'
58
+ head -n 200 build/sphinx-warnings.log
59
+ echo '```'
60
+ } >> "$GITHUB_STEP_SUMMARY"
61
+ fi
62
+ - uses: actions/upload-pages-artifact@v4
63
+ with:
64
+ path: build/sphinx/html
65
+
66
+ deploy:
67
+ name: Deploy to GitHub Pages
68
+ needs: build
69
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
70
+ runs-on: ubuntu-latest
71
+ permissions:
72
+ pages: write
73
+ id-token: write
74
+ environment:
75
+ name: github-pages
76
+ url: ${{ steps.deployment.outputs.page_url }}
77
+ concurrency:
78
+ group: pages
79
+ cancel-in-progress: false
80
+ steps:
81
+ - id: deployment
82
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,138 @@
1
+ name: Wheels
2
+
3
+ # Binary wheels (manylinux_2_28 x86_64, win_amd64, macOS 14+ arm64/x86_64; CPython 3.10-3.14)
4
+ # and an sdist.
5
+ # cibuildwheel is configured in pyproject.toml ([tool.cibuildwheel]); every wheel is tested
6
+ # with the pytest suite before it is uploaded as an artifact. For a v* tag the release job then
7
+ # creates the GitHub release with the wheels, the sdist and the tag's CHANGELOG section; an
8
+ # existing tag can be (re)released by running the workflow manually with `release_tag`.
9
+
10
+ on:
11
+ push:
12
+ tags: ["v*"]
13
+ workflow_dispatch:
14
+ inputs:
15
+ release_tag:
16
+ description: "Existing tag (e.g. v0.9.0) to build from and publish as a GitHub release"
17
+ required: false
18
+ default: ""
19
+ # Only packaging changes trigger wheel builds on PRs. Source changes (incl. CMakeLists.txt,
20
+ # which nearly every feature PR touches) are built and tested on both platforms by ci.yml;
21
+ # wheels are built for tags and on demand (workflow_dispatch).
22
+ pull_request:
23
+ paths:
24
+ - pyproject.toml
25
+ - .github/workflows/wheels.yml
26
+
27
+ permissions:
28
+ contents: read
29
+
30
+ concurrency:
31
+ group: ${{ github.workflow }}-${{ github.ref }}
32
+ cancel-in-progress: true
33
+
34
+ jobs:
35
+ wheels:
36
+ name: Wheels (${{ matrix.os }})
37
+ runs-on: ${{ matrix.os }}
38
+ strategy:
39
+ fail-fast: false
40
+ matrix:
41
+ os: [ubuntu-latest, windows-latest, macos-latest]
42
+ steps:
43
+ - uses: actions/checkout@v5
44
+ with:
45
+ ref: ${{ inputs.release_tag || github.ref }}
46
+ - name: Build and test wheels
47
+ uses: pypa/cibuildwheel@v3.2.1
48
+ with:
49
+ output-dir: wheelhouse
50
+ - uses: actions/upload-artifact@v7
51
+ with:
52
+ name: wheels-${{ matrix.os }}
53
+ path: wheelhouse/*.whl
54
+ if-no-files-found: error
55
+
56
+ sdist:
57
+ name: Source distribution
58
+ runs-on: ubuntu-latest
59
+ steps:
60
+ - uses: actions/checkout@v5
61
+ with:
62
+ ref: ${{ inputs.release_tag || github.ref }}
63
+ - uses: actions/setup-python@v6
64
+ with:
65
+ python-version: "3.12"
66
+ - name: Build sdist
67
+ run: |
68
+ python -m pip install --upgrade build twine
69
+ python -m build --sdist --outdir dist
70
+ python -m twine check dist/*
71
+ - uses: actions/upload-artifact@v7
72
+ with:
73
+ name: sdist
74
+ path: dist/*.tar.gz
75
+ if-no-files-found: error
76
+
77
+ release:
78
+ name: GitHub release
79
+ needs: [wheels, sdist]
80
+ if: >-
81
+ startsWith(github.ref, 'refs/tags/v') ||
82
+ (github.event_name == 'workflow_dispatch' && inputs.release_tag != '')
83
+ runs-on: ubuntu-latest
84
+ permissions:
85
+ contents: write
86
+ env:
87
+ TAG: ${{ inputs.release_tag || github.ref_name }}
88
+ GH_TOKEN: ${{ github.token }}
89
+ steps:
90
+ - uses: actions/checkout@v5
91
+ with:
92
+ ref: ${{ inputs.release_tag || github.ref }}
93
+ - uses: actions/download-artifact@v5
94
+ with:
95
+ path: dist
96
+ merge-multiple: true
97
+ - name: Release notes from CHANGELOG.md
98
+ run: |
99
+ python3 - <<'PY'
100
+ import os, re
101
+ version = os.environ["TAG"].removeprefix("v")
102
+ text = open("CHANGELOG.md", encoding="utf-8").read()
103
+ m = re.search(r"^## \[" + re.escape(version) + r"\][^\n]*\n(.*?)(?=^## \[)", text, re.S | re.M)
104
+ notes = m.group(1).strip() if m else f"Nurbforge {version}"
105
+ notes += ("\n\n### Install\nBinary wheels for Linux (manylinux_2_28 x86_64), Windows "
106
+ "(win_amd64) and macOS 14+ (arm64, x86_64), CPython 3.10-3.14, and the sdist "
107
+ "are attached, e.g.\n\n"
108
+ f"```bash\npip install nurbforge-{version}-cp312-cp312-win_amd64.whl\n```\n")
109
+ open("notes.md", "w", encoding="utf-8").write(notes)
110
+ PY
111
+ - name: Create or update the release
112
+ run: |
113
+ ls -l dist
114
+ if gh release view "$TAG" > /dev/null 2>&1; then
115
+ gh release upload "$TAG" dist/* --clobber
116
+ gh release edit "$TAG" --notes-file notes.md
117
+ else
118
+ gh release create "$TAG" dist/* --verify-tag --title "Nurbforge ${TAG#v}" --notes-file notes.md
119
+ fi
120
+
121
+ # PyPI via trusted publishing (OIDC, no API token): the publisher is registered on PyPI for
122
+ # PhotonPower/Nurbforge, workflow wheels.yml, environment "pypi". Only tag pushes publish.
123
+ publish:
124
+ name: Publish to PyPI
125
+ needs: [wheels, sdist]
126
+ if: startsWith(github.ref, 'refs/tags/v')
127
+ runs-on: ubuntu-latest
128
+ environment:
129
+ name: pypi
130
+ url: https://pypi.org/p/nurbforge
131
+ permissions:
132
+ id-token: write
133
+ steps:
134
+ - uses: actions/download-artifact@v5
135
+ with:
136
+ path: dist
137
+ merge-multiple: true
138
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,39 @@
1
+ # Build
2
+ /build/
3
+ /out/
4
+ _skbuild/
5
+ dist/
6
+ *.egg-info/
7
+ CMakeUserPresets.json
8
+ compile_commands.json
9
+
10
+ # Compiled extension placed in-tree
11
+ python/nurbforge/_core*.so
12
+ python/nurbforge/_core*.pyd
13
+
14
+ # Python
15
+ __pycache__/
16
+ *.py[cod]
17
+ .venv/
18
+ .pytest_cache/
19
+ .ruff_cache/
20
+ .mypy_cache/
21
+
22
+ # Mesh / CAD outputs
23
+ *.msh
24
+ *.vtk
25
+ *.stl
26
+ *.step
27
+ *.stp
28
+ *.brep
29
+
30
+ # IDEs / OS
31
+ .vscode/
32
+ .idea/
33
+ .vs/
34
+ *.swp
35
+ .DS_Store
36
+ Thumbs.db
37
+
38
+ # Claude Code agent worktrees
39
+ .claude/worktrees/