ngk 0.0.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 (511) hide show
  1. ngk-0.0.1/.cargo/config.toml +2 -0
  2. ngk-0.0.1/.cursor/rules/map_book_instructions.mdc +24 -0
  3. ngk-0.0.1/.github/workflows/deploy-pages.yml +70 -0
  4. ngk-0.0.1/.gitignore +45 -0
  5. ngk-0.0.1/.vscode/launch.json +16 -0
  6. ngk-0.0.1/.vscode/settings.json +14 -0
  7. ngk-0.0.1/AGENTS.md +177 -0
  8. ngk-0.0.1/CLAUDE.md +4 -0
  9. ngk-0.0.1/Cargo.lock +998 -0
  10. ngk-0.0.1/Cargo.toml +48 -0
  11. ngk-0.0.1/LICENSE +21 -0
  12. ngk-0.0.1/PKG-INFO +8 -0
  13. ngk-0.0.1/README.md +60 -0
  14. ngk-0.0.1/benches/booleans.rs +319 -0
  15. ngk-0.0.1/bindings/common/explore.rs +1091 -0
  16. ngk-0.0.1/bindings/common/mod.rs +1 -0
  17. ngk-0.0.1/bindings/python/examples/explore_block.py +28 -0
  18. ngk-0.0.1/bindings/python/exchange/mod.rs +8 -0
  19. ngk-0.0.1/bindings/python/exchange/step.rs +175 -0
  20. ngk-0.0.1/bindings/python/geometry/convert.rs +32 -0
  21. ngk-0.0.1/bindings/python/geometry/curves.rs +92 -0
  22. ngk-0.0.1/bindings/python/geometry/mod.rs +40 -0
  23. ngk-0.0.1/bindings/python/geometry/nurbs.rs +119 -0
  24. ngk-0.0.1/bindings/python/geometry/surfaces.rs +300 -0
  25. ngk-0.0.1/bindings/python/geometry/values.rs +281 -0
  26. ngk-0.0.1/bindings/python/mod.rs +21 -0
  27. ngk-0.0.1/bindings/python/modeling/common.rs +44 -0
  28. ngk-0.0.1/bindings/python/modeling/edges.rs +23 -0
  29. ngk-0.0.1/bindings/python/modeling/faces.rs +20 -0
  30. ngk-0.0.1/bindings/python/modeling/mod.rs +16 -0
  31. ngk-0.0.1/bindings/python/modeling/profiles.rs +20 -0
  32. ngk-0.0.1/bindings/python/modeling/solids.rs +60 -0
  33. ngk-0.0.1/bindings/python/python/ngk/__init__.py +30 -0
  34. ngk-0.0.1/bindings/python/python/ngk/__init__.pyi +362 -0
  35. ngk-0.0.1/bindings/python/python/ngk/exchange/__init__.py +5 -0
  36. ngk-0.0.1/bindings/python/python/ngk/exchange/__init__.pyi +1 -0
  37. ngk-0.0.1/bindings/python/python/ngk/exchange/step.py +5 -0
  38. ngk-0.0.1/bindings/python/python/ngk/exchange/step.pyi +6 -0
  39. ngk-0.0.1/bindings/python/python/ngk/geometry/__init__.py +28 -0
  40. ngk-0.0.1/bindings/python/python/ngk/geometry/__init__.pyi +3 -0
  41. ngk-0.0.1/bindings/python/python/ngk/modeling/__init__.py +5 -0
  42. ngk-0.0.1/bindings/python/python/ngk/modeling/__init__.pyi +1 -0
  43. ngk-0.0.1/bindings/python/python/ngk/modeling/edges.py +5 -0
  44. ngk-0.0.1/bindings/python/python/ngk/modeling/edges.pyi +3 -0
  45. ngk-0.0.1/bindings/python/python/ngk/modeling/faces.py +5 -0
  46. ngk-0.0.1/bindings/python/python/ngk/modeling/faces.pyi +3 -0
  47. ngk-0.0.1/bindings/python/python/ngk/modeling/profiles.py +5 -0
  48. ngk-0.0.1/bindings/python/python/ngk/modeling/profiles.pyi +3 -0
  49. ngk-0.0.1/bindings/python/python/ngk/modeling/solids.py +5 -0
  50. ngk-0.0.1/bindings/python/python/ngk/modeling/solids.pyi +6 -0
  51. ngk-0.0.1/bindings/python/run.ps1 +48 -0
  52. ngk-0.0.1/bindings/python/tests/test_block.py +116 -0
  53. ngk-0.0.1/bindings/python/tests/test_exploration.py +66 -0
  54. ngk-0.0.1/bindings/python/tests/test_public_modules.py +28 -0
  55. ngk-0.0.1/bindings/python/tests/test_step.py +160 -0
  56. ngk-0.0.1/bindings/python/tests/test_tcv.py +65 -0
  57. ngk-0.0.1/bindings/python/topology/common.rs +68 -0
  58. ngk-0.0.1/bindings/python/topology/edge.rs +92 -0
  59. ngk-0.0.1/bindings/python/topology/face.rs +84 -0
  60. ngk-0.0.1/bindings/python/topology/gmap.rs +207 -0
  61. ngk-0.0.1/bindings/python/topology/mod.rs +32 -0
  62. ngk-0.0.1/bindings/python/topology/profile.rs +99 -0
  63. ngk-0.0.1/bindings/python/topology/sheet.rs +114 -0
  64. ngk-0.0.1/bindings/python/topology/solid.rs +98 -0
  65. ngk-0.0.1/bindings/python/topology/vertex.rs +71 -0
  66. ngk-0.0.1/bindings/python/visualization/mod.rs +8 -0
  67. ngk-0.0.1/bindings/python/visualization/tcv.rs +67 -0
  68. ngk-0.0.1/bindings/wasm/geometry/convert.rs +45 -0
  69. ngk-0.0.1/bindings/wasm/geometry/curves.rs +85 -0
  70. ngk-0.0.1/bindings/wasm/geometry/mod.rs +10 -0
  71. ngk-0.0.1/bindings/wasm/geometry/nurbs.rs +559 -0
  72. ngk-0.0.1/bindings/wasm/geometry/pcurves.rs +336 -0
  73. ngk-0.0.1/bindings/wasm/geometry/surfaces.rs +312 -0
  74. ngk-0.0.1/bindings/wasm/geometry/values.rs +226 -0
  75. ngk-0.0.1/bindings/wasm/mod.rs +5 -0
  76. ngk-0.0.1/bindings/wasm/modeling/common.rs +49 -0
  77. ngk-0.0.1/bindings/wasm/modeling/edges.rs +23 -0
  78. ngk-0.0.1/bindings/wasm/modeling/faces.rs +15 -0
  79. ngk-0.0.1/bindings/wasm/modeling/mod.rs +5 -0
  80. ngk-0.0.1/bindings/wasm/modeling/profiles.rs +15 -0
  81. ngk-0.0.1/bindings/wasm/modeling/solids.rs +61 -0
  82. ngk-0.0.1/bindings/wasm/runtime.rs +7 -0
  83. ngk-0.0.1/bindings/wasm/topology/common.rs +52 -0
  84. ngk-0.0.1/bindings/wasm/topology/edge.rs +103 -0
  85. ngk-0.0.1/bindings/wasm/topology/face.rs +148 -0
  86. ngk-0.0.1/bindings/wasm/topology/gmap.rs +235 -0
  87. ngk-0.0.1/bindings/wasm/topology/mod.rs +16 -0
  88. ngk-0.0.1/bindings/wasm/topology/profile.rs +132 -0
  89. ngk-0.0.1/bindings/wasm/topology/sheet.rs +140 -0
  90. ngk-0.0.1/bindings/wasm/topology/solid.rs +117 -0
  91. ngk-0.0.1/bindings/wasm/topology/vertex.rs +72 -0
  92. ngk-0.0.1/bindings/wasm/visualization/mod.rs +5 -0
  93. ngk-0.0.1/bindings/wasm/visualization/scripts.rs +67 -0
  94. ngk-0.0.1/bindings/wasm/visualization/tcv.rs +90 -0
  95. ngk-0.0.1/build.ps1 +36 -0
  96. ngk-0.0.1/docs/boole_paper_ngk_integration.md +717 -0
  97. ngk-0.0.1/docs/boolean_algorithm_guide_fr.md +952 -0
  98. ngk-0.0.1/docs/chamfer_architecture.md +300 -0
  99. ngk-0.0.1/docs/model_api.md +815 -0
  100. ngk-0.0.1/docs/topology_orientation_refactor.md +351 -0
  101. ngk-0.0.1/examples/curved_support.rs +202 -0
  102. ngk-0.0.1/examples/debug_boolean.rs +77 -0
  103. ngk-0.0.1/examples/debug_boolean_curved.rs +112 -0
  104. ngk-0.0.1/examples/debug_geometry.rs +35 -0
  105. ngk-0.0.1/examples/step_export_fixtures.rs +195 -0
  106. ngk-0.0.1/examples/step_import_viewer.rs +99 -0
  107. ngk-0.0.1/package.json +6 -0
  108. ngk-0.0.1/plan/README.md +20 -0
  109. ngk-0.0.1/plan/analytical_geometry.md +255 -0
  110. ngk-0.0.1/plan/boolean_analytic.md +368 -0
  111. ngk-0.0.1/plan/boolean_evaluation.md +1392 -0
  112. ngk-0.0.1/plan/curved_support_pcurve_rebuild.md +91 -0
  113. ngk-0.0.1/plan/nurbs_surface_surface_intersection.md +899 -0
  114. ngk-0.0.1/plan/seamless_periodic_faces.md +1064 -0
  115. ngk-0.0.1/plan/shape_healing.md +471 -0
  116. ngk-0.0.1/plan/step_interop.md +1362 -0
  117. ngk-0.0.1/pyproject.toml +17 -0
  118. ngk-0.0.1/skills/.system/.codex-system-skills.marker +1 -0
  119. ngk-0.0.1/skills/.system/imagegen/LICENSE.txt +201 -0
  120. ngk-0.0.1/skills/.system/imagegen/SKILL.md +315 -0
  121. ngk-0.0.1/skills/.system/imagegen/agents/openai.yaml +6 -0
  122. ngk-0.0.1/skills/.system/imagegen/assets/imagegen-small.svg +5 -0
  123. ngk-0.0.1/skills/.system/imagegen/assets/imagegen.png +0 -0
  124. ngk-0.0.1/skills/.system/imagegen/references/cli.md +242 -0
  125. ngk-0.0.1/skills/.system/imagegen/references/codex-network.md +33 -0
  126. ngk-0.0.1/skills/.system/imagegen/references/image-api.md +90 -0
  127. ngk-0.0.1/skills/.system/imagegen/references/prompting.md +112 -0
  128. ngk-0.0.1/skills/.system/imagegen/references/sample-prompts.md +422 -0
  129. ngk-0.0.1/skills/.system/imagegen/scripts/image_gen.py +995 -0
  130. ngk-0.0.1/skills/.system/imagegen/scripts/remove_chroma_key.py +440 -0
  131. ngk-0.0.1/skills/.system/openai-docs/LICENSE.txt +201 -0
  132. ngk-0.0.1/skills/.system/openai-docs/SKILL.md +38 -0
  133. ngk-0.0.1/skills/.system/openai-docs/agents/openai.yaml +6 -0
  134. ngk-0.0.1/skills/.system/openai-docs/assets/openai-small.svg +3 -0
  135. ngk-0.0.1/skills/.system/openai-docs/assets/openai.png +0 -0
  136. ngk-0.0.1/skills/.system/openai-docs/references/codex-self-knowledge.md +71 -0
  137. ngk-0.0.1/skills/.system/openai-docs/references/latest-model.md +25 -0
  138. ngk-0.0.1/skills/.system/openai-docs/references/mcp-diagnostics.md +27 -0
  139. ngk-0.0.1/skills/.system/openai-docs/references/model-migration.md +45 -0
  140. ngk-0.0.1/skills/.system/openai-docs/references/model-selection.md +12 -0
  141. ngk-0.0.1/skills/.system/openai-docs/references/official-docs.md +25 -0
  142. ngk-0.0.1/skills/.system/openai-docs/references/prompting-guide.md +287 -0
  143. ngk-0.0.1/skills/.system/openai-docs/references/upgrade-guide.md +22 -0
  144. ngk-0.0.1/skills/.system/openai-docs/references/upgrading-to-gpt-5p6-sol.md +448 -0
  145. ngk-0.0.1/skills/.system/openai-docs/scripts/fetch-codex-manual.mjs +598 -0
  146. ngk-0.0.1/skills/.system/openai-docs/scripts/resolve-latest-model-info +39 -0
  147. ngk-0.0.1/skills/.system/openai-docs/scripts/resolve-latest-model-info.cjs +165 -0
  148. ngk-0.0.1/skills/.system/plugin-creator/SKILL.md +249 -0
  149. ngk-0.0.1/skills/.system/plugin-creator/agents/openai.yaml +6 -0
  150. ngk-0.0.1/skills/.system/plugin-creator/assets/plugin-creator-small.svg +3 -0
  151. ngk-0.0.1/skills/.system/plugin-creator/assets/plugin-creator.png +0 -0
  152. ngk-0.0.1/skills/.system/plugin-creator/references/installing-and-updating.md +144 -0
  153. ngk-0.0.1/skills/.system/plugin-creator/references/plugin-json-spec.md +218 -0
  154. ngk-0.0.1/skills/.system/plugin-creator/scripts/create_basic_plugin.py +339 -0
  155. ngk-0.0.1/skills/.system/plugin-creator/scripts/identifier_validation.py +20 -0
  156. ngk-0.0.1/skills/.system/plugin-creator/scripts/read_marketplace_name.py +53 -0
  157. ngk-0.0.1/skills/.system/plugin-creator/scripts/update_plugin_cachebuster.py +87 -0
  158. ngk-0.0.1/skills/.system/plugin-creator/scripts/validate_plugin.py +639 -0
  159. ngk-0.0.1/skills/.system/review-agent/SKILL.md +57 -0
  160. ngk-0.0.1/skills/.system/review-agent/agents/openai.yaml +6 -0
  161. ngk-0.0.1/skills/.system/skill-creator/SKILL.md +229 -0
  162. ngk-0.0.1/skills/.system/skill-creator/agents/openai.yaml +5 -0
  163. ngk-0.0.1/skills/.system/skill-creator/assets/skill-creator-small.svg +3 -0
  164. ngk-0.0.1/skills/.system/skill-creator/assets/skill-creator.png +0 -0
  165. ngk-0.0.1/skills/.system/skill-creator/license.txt +202 -0
  166. ngk-0.0.1/skills/.system/skill-creator/references/openai_yaml.md +49 -0
  167. ngk-0.0.1/skills/.system/skill-creator/scripts/generate_openai_yaml.py +226 -0
  168. ngk-0.0.1/skills/.system/skill-creator/scripts/init_skill.py +294 -0
  169. ngk-0.0.1/skills/.system/skill-creator/scripts/quick_validate.py +125 -0
  170. ngk-0.0.1/skills/.system/skill-installer/LICENSE.txt +202 -0
  171. ngk-0.0.1/skills/.system/skill-installer/SKILL.md +58 -0
  172. ngk-0.0.1/skills/.system/skill-installer/agents/openai.yaml +5 -0
  173. ngk-0.0.1/skills/.system/skill-installer/assets/skill-installer-small.svg +3 -0
  174. ngk-0.0.1/skills/.system/skill-installer/assets/skill-installer.png +0 -0
  175. ngk-0.0.1/skills/.system/skill-installer/scripts/github_utils.py +21 -0
  176. ngk-0.0.1/skills/.system/skill-installer/scripts/install-skill-from-github.py +344 -0
  177. ngk-0.0.1/skills/.system/skill-installer/scripts/list-skills.py +107 -0
  178. ngk-0.0.1/skills/build123d-step-testing/SKILL.md +100 -0
  179. ngk-0.0.1/skills/build123d-step-testing/agents/openai.yaml +4 -0
  180. ngk-0.0.1/skills/gmap-reference/SKILL.md +42 -0
  181. ngk-0.0.1/skills/gmap-reference/agents/openai.yaml +4 -0
  182. ngk-0.0.1/skills/ngk-project/SKILL.md +109 -0
  183. ngk-0.0.1/skills/ngk-project/agents/openai.yaml +4 -0
  184. ngk-0.0.1/skills/test-first-workflow/SKILL.md +48 -0
  185. ngk-0.0.1/skills/test-first-workflow/agents/openai.yaml +4 -0
  186. ngk-0.0.1/src/builders/boolean/assemble.rs +383 -0
  187. ngk-0.0.1/src/builders/boolean/broad_phase.rs +325 -0
  188. ngk-0.0.1/src/builders/boolean/classify.rs +517 -0
  189. ngk-0.0.1/src/builders/boolean/clip.rs +289 -0
  190. ngk-0.0.1/src/builders/boolean/contacts.rs +1544 -0
  191. ngk-0.0.1/src/builders/boolean/diagnostics.rs +149 -0
  192. ngk-0.0.1/src/builders/boolean/errors.rs +100 -0
  193. ngk-0.0.1/src/builders/boolean/graph.rs +886 -0
  194. ngk-0.0.1/src/builders/boolean/imprint.rs +174 -0
  195. ngk-0.0.1/src/builders/boolean/mod.rs +729 -0
  196. ngk-0.0.1/src/builders/boolean/neighborhood.rs +87 -0
  197. ngk-0.0.1/src/builders/boolean/operand.rs +220 -0
  198. ngk-0.0.1/src/builders/boolean/pair.rs +228 -0
  199. ngk-0.0.1/src/builders/boolean/result.rs +119 -0
  200. ngk-0.0.1/src/builders/boolean/select.rs +47 -0
  201. ngk-0.0.1/src/builders/boolean/tolerance.rs +176 -0
  202. ngk-0.0.1/src/builders/boolean/trim.rs +421 -0
  203. ngk-0.0.1/src/builders/chamfer.rs +1365 -0
  204. ngk-0.0.1/src/builders/edges.rs +529 -0
  205. ngk-0.0.1/src/builders/errors.rs +227 -0
  206. ngk-0.0.1/src/builders/faces.rs +2743 -0
  207. ngk-0.0.1/src/builders/mod.rs +11 -0
  208. ngk-0.0.1/src/builders/profiles.rs +377 -0
  209. ngk-0.0.1/src/builders/removal.rs +1544 -0
  210. ngk-0.0.1/src/builders/revolve.rs +1693 -0
  211. ngk-0.0.1/src/builders/sheets.rs +598 -0
  212. ngk-0.0.1/src/builders/solids.rs +620 -0
  213. ngk-0.0.1/src/builders/vertices.rs +1 -0
  214. ngk-0.0.1/src/exchange/mod.rs +10 -0
  215. ngk-0.0.1/src/exchange/step/builder.rs +178 -0
  216. ngk-0.0.1/src/exchange/step/convert/curves.rs +220 -0
  217. ngk-0.0.1/src/exchange/step/convert/iso_curve.rs +167 -0
  218. ngk-0.0.1/src/exchange/step/convert/mod.rs +17 -0
  219. ngk-0.0.1/src/exchange/step/convert/nurbs.rs +312 -0
  220. ngk-0.0.1/src/exchange/step/convert/pcurve.rs +348 -0
  221. ngk-0.0.1/src/exchange/step/convert/placement.rs +174 -0
  222. ngk-0.0.1/src/exchange/step/convert/surfaces.rs +394 -0
  223. ngk-0.0.1/src/exchange/step/convert/uv_map.rs +249 -0
  224. ngk-0.0.1/src/exchange/step/error.rs +253 -0
  225. ngk-0.0.1/src/exchange/step/fs.rs +87 -0
  226. ngk-0.0.1/src/exchange/step/mod.rs +200 -0
  227. ngk-0.0.1/src/exchange/step/options.rs +119 -0
  228. ngk-0.0.1/src/exchange/step/part21/mod.rs +19 -0
  229. ngk-0.0.1/src/exchange/step/part21/parse.rs +453 -0
  230. ngk-0.0.1/src/exchange/step/part21/value.rs +338 -0
  231. ngk-0.0.1/src/exchange/step/part21/write.rs +182 -0
  232. ngk-0.0.1/src/exchange/step/report.rs +128 -0
  233. ngk-0.0.1/src/exchange/step/schema/bspline.rs +527 -0
  234. ngk-0.0.1/src/exchange/step/schema/entities.rs +1136 -0
  235. ngk-0.0.1/src/exchange/step/schema/mod.rs +12 -0
  236. ngk-0.0.1/src/exchange/step/schema/product.rs +253 -0
  237. ngk-0.0.1/src/exchange/step/schema/resolver.rs +515 -0
  238. ngk-0.0.1/src/exchange/step/schema/units.rs +239 -0
  239. ngk-0.0.1/src/exchange/step/topology/export.rs +506 -0
  240. ngk-0.0.1/src/exchange/step/topology/import.rs +969 -0
  241. ngk-0.0.1/src/exchange/step/topology/mod.rs +9 -0
  242. ngk-0.0.1/src/exchange/step/topology/seam.rs +249 -0
  243. ngk-0.0.1/src/geometry/axis.rs +33 -0
  244. ngk-0.0.1/src/geometry/counters.rs +186 -0
  245. ngk-0.0.1/src/geometry/dim2/bezier.rs +103 -0
  246. ngk-0.0.1/src/geometry/dim2/conics.rs +78 -0
  247. ngk-0.0.1/src/geometry/dim2/curves.rs +794 -0
  248. ngk-0.0.1/src/geometry/dim2/intersections.rs +775 -0
  249. ngk-0.0.1/src/geometry/dim2/mod.rs +7 -0
  250. ngk-0.0.1/src/geometry/dim2/nurbs.rs +676 -0
  251. ngk-0.0.1/src/geometry/dim2/trimmed.rs +344 -0
  252. ngk-0.0.1/src/geometry/dim2/utils.rs +86 -0
  253. ngk-0.0.1/src/geometry/dim3/bbox.rs +429 -0
  254. ngk-0.0.1/src/geometry/dim3/conics.rs +74 -0
  255. ngk-0.0.1/src/geometry/dim3/curves.rs +1106 -0
  256. ngk-0.0.1/src/geometry/dim3/frame.rs +83 -0
  257. ngk-0.0.1/src/geometry/dim3/intersections/analytic/curve_curve.rs +310 -0
  258. ngk-0.0.1/src/geometry/dim3/intersections/analytic/curve_surface.rs +277 -0
  259. ngk-0.0.1/src/geometry/dim3/intersections/analytic/mod.rs +116 -0
  260. ngk-0.0.1/src/geometry/dim3/intersections/analytic/roots.rs +75 -0
  261. ngk-0.0.1/src/geometry/dim3/intersections/analytic/surface_surface.rs +853 -0
  262. ngk-0.0.1/src/geometry/dim3/intersections/curve_curve.rs +470 -0
  263. ngk-0.0.1/src/geometry/dim3/intersections/curve_surface.rs +562 -0
  264. ngk-0.0.1/src/geometry/dim3/intersections/error.rs +11 -0
  265. ngk-0.0.1/src/geometry/dim3/intersections/options.rs +69 -0
  266. ngk-0.0.1/src/geometry/dim3/intersections/surface_surface/fitting.rs +485 -0
  267. ngk-0.0.1/src/geometry/dim3/intersections/surface_surface/normals.rs +264 -0
  268. ngk-0.0.1/src/geometry/dim3/intersections/surface_surface/seeds.rs +1162 -0
  269. ngk-0.0.1/src/geometry/dim3/intersections/surface_surface/simplification.rs +287 -0
  270. ngk-0.0.1/src/geometry/dim3/intersections/surface_surface/tracer.rs +508 -0
  271. ngk-0.0.1/src/geometry/dim3/intersections/surface_surface.rs +498 -0
  272. ngk-0.0.1/src/geometry/dim3/intersections.rs +360 -0
  273. ngk-0.0.1/src/geometry/dim3/mod.rs +9 -0
  274. ngk-0.0.1/src/geometry/dim3/nurbs/bezier.rs +112 -0
  275. ngk-0.0.1/src/geometry/dim3/nurbs/curve.rs +676 -0
  276. ngk-0.0.1/src/geometry/dim3/nurbs/degree.rs +25 -0
  277. ngk-0.0.1/src/geometry/dim3/nurbs/knots.rs +128 -0
  278. ngk-0.0.1/src/geometry/dim3/nurbs/mod.rs +14 -0
  279. ngk-0.0.1/src/geometry/dim3/nurbs/points.rs +187 -0
  280. ngk-0.0.1/src/geometry/dim3/nurbs/surface.rs +591 -0
  281. ngk-0.0.1/src/geometry/dim3/nurbs/tessellate.rs +100 -0
  282. ngk-0.0.1/src/geometry/dim3/surfaces.rs +1927 -0
  283. ngk-0.0.1/src/geometry/dim3/trimmed.rs +240 -0
  284. ngk-0.0.1/src/geometry/dim3/utils.rs +73 -0
  285. ngk-0.0.1/src/geometry/interval.rs +102 -0
  286. ngk-0.0.1/src/geometry/mod.rs +52 -0
  287. ngk-0.0.1/src/geometry/nurbs/basis.rs +102 -0
  288. ngk-0.0.1/src/geometry/nurbs/error.rs +35 -0
  289. ngk-0.0.1/src/geometry/nurbs/mod.rs +4 -0
  290. ngk-0.0.1/src/geometry/reparam.rs +142 -0
  291. ngk-0.0.1/src/geometry/tolerance.rs +10 -0
  292. ngk-0.0.1/src/geometry/traits.rs +209 -0
  293. ngk-0.0.1/src/healing/errors.rs +29 -0
  294. ngk-0.0.1/src/healing/mod.rs +107 -0
  295. ngk-0.0.1/src/healing/options.rs +95 -0
  296. ngk-0.0.1/src/healing/passes/edges.rs +395 -0
  297. ngk-0.0.1/src/healing/passes/mod.rs +95 -0
  298. ngk-0.0.1/src/healing/passes/seams.rs +36 -0
  299. ngk-0.0.1/src/healing/passes/vertices.rs +253 -0
  300. ngk-0.0.1/src/healing/predicates/curve.rs +229 -0
  301. ngk-0.0.1/src/healing/predicates/mod.rs +14 -0
  302. ngk-0.0.1/src/healing/predicates/pcurve.rs +198 -0
  303. ngk-0.0.1/src/healing/predicates/surface.rs +147 -0
  304. ngk-0.0.1/src/healing/report.rs +108 -0
  305. ngk-0.0.1/src/lib.rs +24 -0
  306. ngk-0.0.1/src/main.rs +49 -0
  307. ngk-0.0.1/src/model.rs +17 -0
  308. ngk-0.0.1/src/modeling/edges.rs +51 -0
  309. ngk-0.0.1/src/modeling/errors.rs +11 -0
  310. ngk-0.0.1/src/modeling/faces.rs +72 -0
  311. ngk-0.0.1/src/modeling/mod.rs +9 -0
  312. ngk-0.0.1/src/modeling/profiles.rs +74 -0
  313. ngk-0.0.1/src/modeling/revolve.rs +29 -0
  314. ngk-0.0.1/src/modeling/sheets.rs +1 -0
  315. ngk-0.0.1/src/modeling/solids.rs +208 -0
  316. ngk-0.0.1/src/modeling/sweep.rs +28 -0
  317. ngk-0.0.1/src/modeling/vertices.rs +1 -0
  318. ngk-0.0.1/src/scripts/chamfered_block.rs +130 -0
  319. ngk-0.0.1/src/scripts/chamfered_rectangle.rs +96 -0
  320. ngk-0.0.1/src/scripts/chamfered_wavy_edge.rs +117 -0
  321. ngk-0.0.1/src/scripts/cylinder.rs +75 -0
  322. ngk-0.0.1/src/scripts/extruded_holed_pentagon.rs +110 -0
  323. ngk-0.0.1/src/scripts/extruded_open_polyline.rs +36 -0
  324. ngk-0.0.1/src/scripts/extruded_square.rs +14 -0
  325. ngk-0.0.1/src/scripts/hollow_cylinder.rs +132 -0
  326. ngk-0.0.1/src/scripts/interactive_extrusion.rs +56 -0
  327. ngk-0.0.1/src/scripts/mod.rs +89 -0
  328. ngk-0.0.1/src/scripts/revolved_triangle.rs +72 -0
  329. ngk-0.0.1/src/tcv.rs +401 -0
  330. ngk-0.0.1/src/tessellate/curve.rs +20 -0
  331. ngk-0.0.1/src/tessellate/face.rs +630 -0
  332. ngk-0.0.1/src/tessellate/mod.rs +94 -0
  333. ngk-0.0.1/src/tessellate/shape.rs +53 -0
  334. ngk-0.0.1/src/tessellate/surface.rs +135 -0
  335. ngk-0.0.1/src/topology/attributes.rs +567 -0
  336. ngk-0.0.1/src/topology/closed.rs +78 -0
  337. ngk-0.0.1/src/topology/dart.rs +46 -0
  338. ngk-0.0.1/src/topology/edge.rs +431 -0
  339. ngk-0.0.1/src/topology/edit.md +77 -0
  340. ngk-0.0.1/src/topology/edit.rs +1730 -0
  341. ngk-0.0.1/src/topology/face.rs +482 -0
  342. ngk-0.0.1/src/topology/gmap.rs +2061 -0
  343. ngk-0.0.1/src/topology/mod.rs +29 -0
  344. ngk-0.0.1/src/topology/orientation.rs +65 -0
  345. ngk-0.0.1/src/topology/payload.rs +36 -0
  346. ngk-0.0.1/src/topology/planar.rs +365 -0
  347. ngk-0.0.1/src/topology/profile.rs +246 -0
  348. ngk-0.0.1/src/topology/shape.rs +189 -0
  349. ngk-0.0.1/src/topology/shape_keys.rs +36 -0
  350. ngk-0.0.1/src/topology/sheet.rs +269 -0
  351. ngk-0.0.1/src/topology/solid.rs +193 -0
  352. ngk-0.0.1/src/topology/unwrapped_face_domain.rs +444 -0
  353. ngk-0.0.1/src/topology/validation.rs +356 -0
  354. ngk-0.0.1/src/topology/vertex.rs +109 -0
  355. ngk-0.0.1/src/viz/brep.rs +162 -0
  356. ngk-0.0.1/src/viz/debug_viewer.rs +474 -0
  357. ngk-0.0.1/src/viz/geometry.rs +171 -0
  358. ngk-0.0.1/src/viz/gmap.rs +254 -0
  359. ngk-0.0.1/src/viz/hints.rs +84 -0
  360. ngk-0.0.1/src/viz/mod.rs +146 -0
  361. ngk-0.0.1/src/viz/ocp_vscode.rs +656 -0
  362. ngk-0.0.1/src/viz/scene.rs +115 -0
  363. ngk-0.0.1/tests/builders/boolean.rs +1765 -0
  364. ngk-0.0.1/tests/builders/boolean_broad_phase.rs +187 -0
  365. ngk-0.0.1/tests/builders/boolean_budget.rs +157 -0
  366. ngk-0.0.1/tests/builders/boolean_classify.rs +41 -0
  367. ngk-0.0.1/tests/builders/boolean_clip.rs +62 -0
  368. ngk-0.0.1/tests/builders/boolean_network.rs +240 -0
  369. ngk-0.0.1/tests/builders/boolean_trim.rs +90 -0
  370. ngk-0.0.1/tests/builders/chamfer.rs +303 -0
  371. ngk-0.0.1/tests/builders/face_lineage.rs +181 -0
  372. ngk-0.0.1/tests/builders/faces.rs +897 -0
  373. ngk-0.0.1/tests/builders/profiles.rs +180 -0
  374. ngk-0.0.1/tests/builders/removal.rs +644 -0
  375. ngk-0.0.1/tests/builders/revolve.rs +935 -0
  376. ngk-0.0.1/tests/builders/solids.rs +95 -0
  377. ngk-0.0.1/tests/builders.rs +31 -0
  378. ngk-0.0.1/tests/exchange/part21_fixture_files.rs +43 -0
  379. ngk-0.0.1/tests/exchange/part21_parse.rs +398 -0
  380. ngk-0.0.1/tests/exchange/part21_round_trip.rs +180 -0
  381. ngk-0.0.1/tests/exchange/part21_write.rs +211 -0
  382. ngk-0.0.1/tests/exchange/step_builder.rs +170 -0
  383. ngk-0.0.1/tests/exchange/step_convert.rs +592 -0
  384. ngk-0.0.1/tests/exchange/step_entities.rs +671 -0
  385. ngk-0.0.1/tests/exchange/step_export.rs +534 -0
  386. ngk-0.0.1/tests/exchange/step_fs.rs +125 -0
  387. ngk-0.0.1/tests/exchange/step_import.rs +568 -0
  388. ngk-0.0.1/tests/exchange/step_round_trip.rs +304 -0
  389. ngk-0.0.1/tests/exchange.rs +25 -0
  390. ngk-0.0.1/tests/fixtures/hollow.rs +73 -0
  391. ngk-0.0.1/tests/fixtures/seamed.rs +346 -0
  392. ngk-0.0.1/tests/fixtures/step/box.step +415 -0
  393. ngk-0.0.1/tests/fixtures/step/cylinder.step +147 -0
  394. ngk-0.0.1/tests/fixtures/step/frustum.step +147 -0
  395. ngk-0.0.1/tests/fixtures/step/generate_box.py +11 -0
  396. ngk-0.0.1/tests/fixtures/step/generate_cylinder.py +15 -0
  397. ngk-0.0.1/tests/fixtures/step/generate_frustum.py +17 -0
  398. ngk-0.0.1/tests/fixtures/step/generate_holed_slab.py +17 -0
  399. ngk-0.0.1/tests/fixtures/step/generate_nurbs.py +37 -0
  400. ngk-0.0.1/tests/fixtures/step/generate_sphere.py +17 -0
  401. ngk-0.0.1/tests/fixtures/step/generate_torus.py +15 -0
  402. ngk-0.0.1/tests/fixtures/step/holed_slab.step +780 -0
  403. ngk-0.0.1/tests/fixtures/step/lofted.step +630 -0
  404. ngk-0.0.1/tests/fixtures/step/sphere.step +49 -0
  405. ngk-0.0.1/tests/fixtures/step/swept_circle.step +512 -0
  406. ngk-0.0.1/tests/fixtures/step/torus.step +103 -0
  407. ngk-0.0.1/tests/fixtures/step/ttt/generate_ttt.py +648 -0
  408. ngk-0.0.1/tests/fixtures/step/ttt/import_ttt.py +122 -0
  409. ngk-0.0.1/tests/fixtures/step/validate_ngk_export.py +225 -0
  410. ngk-0.0.1/tests/geometry/dim2.rs +504 -0
  411. ngk-0.0.1/tests/geometry/dim3/analytic.rs +456 -0
  412. ngk-0.0.1/tests/geometry/dim3/bbox.rs +188 -0
  413. ngk-0.0.1/tests/geometry/dim3/cone.rs +165 -0
  414. ngk-0.0.1/tests/geometry/dim3/conics.rs +111 -0
  415. ngk-0.0.1/tests/geometry/dim3/curves.rs +258 -0
  416. ngk-0.0.1/tests/geometry/dim3/frame.rs +32 -0
  417. ngk-0.0.1/tests/geometry/dim3/intersections.rs +1011 -0
  418. ngk-0.0.1/tests/geometry/dim3/mod.rs +12 -0
  419. ngk-0.0.1/tests/geometry/dim3/nurbs/bezier.rs +113 -0
  420. ngk-0.0.1/tests/geometry/dim3/nurbs/curve.rs +285 -0
  421. ngk-0.0.1/tests/geometry/dim3/nurbs/mod.rs +3 -0
  422. ngk-0.0.1/tests/geometry/dim3/nurbs/surface.rs +150 -0
  423. ngk-0.0.1/tests/geometry/dim3/sphere.rs +148 -0
  424. ngk-0.0.1/tests/geometry/dim3/surfaces.rs +428 -0
  425. ngk-0.0.1/tests/geometry/dim3/torus.rs +240 -0
  426. ngk-0.0.1/tests/geometry/dim3/trimmed.rs +170 -0
  427. ngk-0.0.1/tests/geometry/interval.rs +86 -0
  428. ngk-0.0.1/tests/geometry.rs +6 -0
  429. ngk-0.0.1/tests/healing/boolean_integration.rs +152 -0
  430. ngk-0.0.1/tests/healing/edge_removal.rs +198 -0
  431. ngk-0.0.1/tests/healing/predicates.rs +177 -0
  432. ngk-0.0.1/tests/healing/seam_removal.rs +152 -0
  433. ngk-0.0.1/tests/healing/vertex_removal.rs +228 -0
  434. ngk-0.0.1/tests/healing.rs +13 -0
  435. ngk-0.0.1/tests/modeling/edges.rs +84 -0
  436. ngk-0.0.1/tests/modeling/faces.rs +116 -0
  437. ngk-0.0.1/tests/modeling/profiles.rs +93 -0
  438. ngk-0.0.1/tests/modeling/solids.rs +477 -0
  439. ngk-0.0.1/tests/modeling.rs +8 -0
  440. ngk-0.0.1/tests/scripts/interactive_extrusion.rs +11 -0
  441. ngk-0.0.1/tests/scripts/mod.rs +1 -0
  442. ngk-0.0.1/tests/scripts.rs +2 -0
  443. ngk-0.0.1/tests/tcv.rs +70 -0
  444. ngk-0.0.1/tests/topology/edge.rs +40 -0
  445. ngk-0.0.1/tests/topology/edge_split.rs +196 -0
  446. ngk-0.0.1/tests/topology/edit.rs +696 -0
  447. ngk-0.0.1/tests/topology/face.rs +208 -0
  448. ngk-0.0.1/tests/topology/indexes.rs +29 -0
  449. ngk-0.0.1/tests/topology/planar.rs +63 -0
  450. ngk-0.0.1/tests/topology/profile.rs +92 -0
  451. ngk-0.0.1/tests/topology/serialization.rs +96 -0
  452. ngk-0.0.1/tests/topology/sheet.rs +35 -0
  453. ngk-0.0.1/tests/topology/transaction.rs +44 -0
  454. ngk-0.0.1/tests/topology/unwrapped_face_domain.rs +245 -0
  455. ngk-0.0.1/tests/topology/validation.rs +56 -0
  456. ngk-0.0.1/tests/topology.rs +24 -0
  457. ngk-0.0.1/tests/viz/gmap.rs +127 -0
  458. ngk-0.0.1/tests/viz/ocp_vscode.rs +57 -0
  459. ngk-0.0.1/tests/viz.rs +5 -0
  460. ngk-0.0.1/uv.lock +14 -0
  461. ngk-0.0.1/visualization/.gitignore +5 -0
  462. ngk-0.0.1/visualization/README.md +71 -0
  463. ngk-0.0.1/visualization/index.html +12 -0
  464. ngk-0.0.1/visualization/package-lock.json +3517 -0
  465. ngk-0.0.1/visualization/package.json +34 -0
  466. ngk-0.0.1/visualization/src/App.tsx +62 -0
  467. ngk-0.0.1/visualization/src/components/CadControls.ts +3367 -0
  468. ngk-0.0.1/visualization/src/components/CadControlsView.tsx +229 -0
  469. ngk-0.0.1/visualization/src/components/ExperimentErrorBoundary.tsx +59 -0
  470. ngk-0.0.1/visualization/src/components/ExperimentSidebar.tsx +36 -0
  471. ngk-0.0.1/visualization/src/components/SceneShell.tsx +31 -0
  472. ngk-0.0.1/visualization/src/components/VizSceneView.layout.ts +299 -0
  473. ngk-0.0.1/visualization/src/components/VizSceneView.tsx +739 -0
  474. ngk-0.0.1/visualization/src/components/useVizControls.ts +192 -0
  475. ngk-0.0.1/visualization/src/experiments/BlockPrimitive/index.tsx +95 -0
  476. ngk-0.0.1/visualization/src/experiments/ChamferedBlock/index.tsx +53 -0
  477. ngk-0.0.1/visualization/src/experiments/ChamferedRectangle/index.tsx +49 -0
  478. ngk-0.0.1/visualization/src/experiments/ChamferedWavyEdge/index.tsx +53 -0
  479. ngk-0.0.1/visualization/src/experiments/CurveSurfaceIntersectionExplorer/index.tsx +238 -0
  480. ngk-0.0.1/visualization/src/experiments/Cylinder/index.tsx +38 -0
  481. ngk-0.0.1/visualization/src/experiments/DebugViewer/ConsolePane.tsx +730 -0
  482. ngk-0.0.1/visualization/src/experiments/DebugViewer/index.tsx +718 -0
  483. ngk-0.0.1/visualization/src/experiments/DebugViewer/objectPreviews.ts +221 -0
  484. ngk-0.0.1/visualization/src/experiments/ExtrudedHoledPentagon/index.tsx +32 -0
  485. ngk-0.0.1/visualization/src/experiments/ExtrudedOpenPolyline/index.tsx +32 -0
  486. ngk-0.0.1/visualization/src/experiments/ExtrudedSquare/index.tsx +32 -0
  487. ngk-0.0.1/visualization/src/experiments/HollowCylinder/index.tsx +32 -0
  488. ngk-0.0.1/visualization/src/experiments/InteractiveExtrusion/index.tsx +196 -0
  489. ngk-0.0.1/visualization/src/experiments/NurbsCurveEditor/ControlPolygon.tsx +14 -0
  490. ngk-0.0.1/visualization/src/experiments/NurbsCurveEditor/DraggableHandle.tsx +128 -0
  491. ngk-0.0.1/visualization/src/experiments/NurbsCurveEditor/index.tsx +174 -0
  492. ngk-0.0.1/visualization/src/experiments/NurbsIntersectionExplorer/index.tsx +333 -0
  493. ngk-0.0.1/visualization/src/experiments/NurbsKnotExplorer/index.tsx +407 -0
  494. ngk-0.0.1/visualization/src/experiments/NurbsSurfaceEditor/index.tsx +186 -0
  495. ngk-0.0.1/visualization/src/experiments/RevolvedTriangle/index.tsx +51 -0
  496. ngk-0.0.1/visualization/src/experiments/SurfaceSurfaceIntersectionExplorer/index.tsx +230 -0
  497. ngk-0.0.1/visualization/src/experiments/TwoFacesAlpha2/index.tsx +37 -0
  498. ngk-0.0.1/visualization/src/experiments/_template/index.tsx +26 -0
  499. ngk-0.0.1/visualization/src/experiments/registry.ts +132 -0
  500. ngk-0.0.1/visualization/src/kernel/debugViewer.ts +420 -0
  501. ngk-0.0.1/visualization/src/kernel/nurbs.ts +46 -0
  502. ngk-0.0.1/visualization/src/kernel/useKernel.ts +27 -0
  503. ngk-0.0.1/visualization/src/kernel/viz.ts +212 -0
  504. ngk-0.0.1/visualization/src/main.tsx +10 -0
  505. ngk-0.0.1/visualization/src/styles.css +1082 -0
  506. ngk-0.0.1/visualization/tests/VizSceneView.layout.test.ts +153 -0
  507. ngk-0.0.1/visualization/tsconfig.json +22 -0
  508. ngk-0.0.1/visualization/tsconfig.node.json +13 -0
  509. ngk-0.0.1/visualization/tsconfig.node.tsbuildinfo +1 -0
  510. ngk-0.0.1/visualization/tsconfig.tsbuildinfo +1 -0
  511. ngk-0.0.1/visualization/vite.config.ts +97 -0
@@ -0,0 +1,2 @@
1
+ [env]
2
+ PYO3_NO_PYTHON = "1"
@@ -0,0 +1,24 @@
1
+ ---
2
+ description: Canonical combinatorial / generalized map (gmap) theory lives in private_doc book; consult it in chunks, not whole-file reads
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # Combinatorial maps & GMap — reference source
7
+
8
+ **Authoritative domain knowledge** for combinatorial maps, generalized maps (GMap / gmap), darts, involutions, and related constructions in this codebase is written in the **combinatorial maps book** stored under the project’s private documentation:
9
+
10
+ - **Location:** `private_doc/Combinatorial_Maps_Book/Combinatorial_Maps_Book.md`
11
+
12
+ Treat that material as the **source of truth** when reasoning about theory, definitions, or algorithms for maps and gmaps in this repo.
13
+
14
+ ## How to use the book (LLM context limits)
15
+
16
+ The book is **too large to load entirely** into a single context window. **Do not** read or paste the full file in one shot.
17
+
18
+ Instead:
19
+
20
+ 1. **Search and slice:** Use workspace search, grep, or partial reads (`read_file` with `offset` / `limit`) to open **only the sections** relevant to the current question (chapter headings, keywords: e.g. “generalized map”, “involution”, “sew”, “alpha”, “dimension”).
21
+ 2. **Iterate:** If the first excerpt is insufficient, refine keywords or read the **next adjacent chunk** — still in small portions.
22
+ 3. **Prefer targeted questions:** Formulate what definition or construction you need, then locate that passage rather than skimming from the start.
23
+
24
+ This keeps answers aligned with the book while staying within practical context size.
@@ -0,0 +1,70 @@
1
+ name: Deploy visualization to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches: ["master"]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ concurrency:
14
+ group: "pages"
15
+ cancel-in-progress: false
16
+
17
+ jobs:
18
+ build:
19
+ runs-on: ubuntu-latest
20
+
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@v4
24
+
25
+ - name: Setup Rust
26
+ uses: dtolnay/rust-toolchain@stable
27
+ with:
28
+ targets: wasm32-unknown-unknown
29
+
30
+ - name: Setup wasm-pack
31
+ uses: jetli/wasm-pack-action@v0.4.0
32
+ with:
33
+ version: latest
34
+
35
+ - name: Setup Node
36
+ uses: actions/setup-node@v4
37
+ with:
38
+ node-version: 20
39
+ cache: npm
40
+ cache-dependency-path: visualization/package-lock.json
41
+
42
+ - name: Install dependencies
43
+ working-directory: visualization
44
+ run: npm ci
45
+
46
+ - name: Build visualization
47
+ working-directory: visualization
48
+ env:
49
+ VITE_BASE_PATH: /ngk/
50
+ run: npm run build
51
+
52
+ - name: Configure GitHub Pages
53
+ uses: actions/configure-pages@v5
54
+
55
+ - name: Upload Pages artifact
56
+ uses: actions/upload-pages-artifact@v3
57
+ with:
58
+ path: visualization/dist
59
+
60
+ deploy:
61
+ environment:
62
+ name: github-pages
63
+ url: ${{ steps.deployment.outputs.page_url }}
64
+ runs-on: ubuntu-latest
65
+ needs: build
66
+
67
+ steps:
68
+ - name: Deploy to GitHub Pages
69
+ id: deployment
70
+ uses: actions/deploy-pages@v4
ngk-0.0.1/.gitignore ADDED
@@ -0,0 +1,45 @@
1
+ # Generated by Cargo
2
+ # will have compiled files and executables
3
+ debug
4
+ target
5
+
6
+ # These are backup files generated by rustfmt
7
+ **/*.rs.bk
8
+
9
+ # MSVC Windows builds of rustc generate these, which store debugging information
10
+ *.pdb
11
+
12
+ # Generated by cargo mutants
13
+ # Contains mutation testing data
14
+ **/mutants.out*/
15
+
16
+ # RustRover
17
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
18
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
19
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
20
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
21
+ #.idea/
22
+
23
+ # Added by cargo
24
+
25
+ /target
26
+
27
+ # Private documentation (not tracked)
28
+ private_doc/
29
+
30
+ # Local junction onto skills/ — recreate per machine, see AGENTS.md
31
+ .claude/skills
32
+
33
+ # Visualization frontend
34
+ visualization/node_modules/
35
+ visualization/dist/
36
+ visualization/src/wasm/
37
+
38
+ # Python local builds
39
+ .venv/
40
+ .uv-cache/
41
+ .uv-python/
42
+ __pycache__/
43
+ **/__pycache__/
44
+ *.pyd
45
+
@@ -0,0 +1,16 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+
8
+ {
9
+ "name": "Python Debugger: Current File",
10
+ "type": "debugpy",
11
+ "request": "launch",
12
+ "program": "${file}",
13
+ "console": "integratedTerminal"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "rust-analyzer.debug.engine": "vadimcn.vscode-lldb",
3
+ "rust-analyzer.runnables.extraEnv": {
4
+ "RUSTUP_TOOLCHAIN": "stable-x86_64-pc-windows-gnu",
5
+ "Path": "C:\\msys64\\ucrt64\\bin;C:\\Users\\romai\\.cargo\\bin;C:\\Windows\\System32;C:\\Windows"
6
+ },
7
+ "rust-analyzer.debug.engineSettings": {
8
+ "vadimcn.vscode-lldb": {
9
+ "expressions": "simple",
10
+ "sourceLanguages": ["rust"]
11
+ }
12
+ },
13
+ "lldb.script.lang.rust.toolchain": "stable-x86_64-pc-windows-gnu"
14
+ }
ngk-0.0.1/AGENTS.md ADDED
@@ -0,0 +1,177 @@
1
+ # AGENTS.md — NGK (Nales Geometry Kernel)
2
+
3
+ Working memory for agents (Claude Code, Codex, and others) in `D:\Projets\ngk`.
4
+ Read this first, then the pointed-to docs.
5
+
6
+ Shared skills live in `skills/` at the repo root — `.claude/skills` is a local
7
+ directory junction onto it, so skill content is edited in one place only.
8
+ The junction is machine-local (not tracked in git); recreate it after a fresh
9
+ clone with:
10
+
11
+ ```powershell
12
+ New-Item -ItemType Junction -Path ".claude\skills" -Target "skills"
13
+ ```
14
+
15
+ ## What this project is
16
+
17
+ NGK is an experimental **CAD geometric kernel written in Rust**, built around
18
+ **generalized maps (3-GMaps)** instead of a classical winged-edge / OCCT-style B-Rep.
19
+
20
+ The core bet: represent topology combinatorially first (darts + α involutions),
21
+ and attach geometry (points, curves, surfaces) as *payload attributes* on cells.
22
+ Sewing, unsewing, extrusion, splitting and cell traversal then become explicit,
23
+ provable operations on the map rather than ad-hoc record surgery.
24
+
25
+ Goal is a **robust, state-of-the-art kernel for CAD** — not a history-based
26
+ parametric modeler. Operations mutate one map and return explicit handles.
27
+
28
+ - Crate: `ngk`, edition 2024, MIT. `cdylib` + `rlib`, plus an `ngk` binary.
29
+ - Deps: `nalgebra`, `slotmap`, `serde`, `thiserror`, `radians`.
30
+ - Features: `python` (pyo3/maturin), `wasm` (wasm-bindgen).
31
+ - Author: Jojain (romain.ferru@gmail.com). Pages demo: https://jojain.github.io/ngk/
32
+
33
+ ## Layering (bottom → top)
34
+
35
+ | Layer | Path | Role |
36
+ |---|---|---|
37
+ | `topology` | `src/topology/` | The GMap: darts, α0..α3, cells, keys, attributes, transactional editing |
38
+ | `geometry` | `src/geometry/` | Pure math: points, curves, surfaces, NURBS, intersections, bbox, tolerance |
39
+ | `builders` | `src/builders/` | Low-level topology construction (`&mut GMap`), one transaction each |
40
+ | `modeling` | `src/modeling/` | Thin user-facing standalone shape builders (`block`, `revolve`, …) |
41
+ | `healing` | `src/healing/` | Removes topology that carries no shape (`i`-removal passes over `builders::removal`) |
42
+ | `tessellate` | `src/tessellate/` | Geometry/BRep → polylines + indexed meshes |
43
+ | `viz` | `src/viz/` | `VizScene` assembly, dart/α overlays, debug viewer, ocp_vscode bridge |
44
+ | `scripts` | `src/scripts/` | Named exploration scenes, registered in `SCRIPTS` |
45
+ | `bindings` | `bindings/{common,python,wasm}` | pyo3 + wasm-bindgen surfaces |
46
+ | `visualization/` | React + R3F + Vite | Playground consuming the wasm build |
47
+
48
+ `src/model.rs` holds an embryonic `Model<P>` (owns one persistent `GMap`) —
49
+ the target design lives in `docs/model_api.md` and is **not implemented yet**.
50
+
51
+ ## Topology core — key concepts
52
+
53
+ - **`Dart`** — oriented traversal locator. Short-lived; may be destroyed by any edit.
54
+ - **`Dim::{Zero,One,Two,Three}`** ↔ α0..α3 ↔ vertex/edge/face/(sheet|solid).
55
+ `GMAP_INVOLUTION_COUNT = 4`.
56
+ - **Keys are the durable identity**: `VertexKey, EdgeKey, ProfileKey, FaceKey,
57
+ SheetKey, SolidKey` (slotmap `new_key_type!`). Public APIs select cells by key,
58
+ never by dart.
59
+ - **Attributes** (`topology/attributes.rs`) store geometry + user payload per cell:
60
+ `VertexAttr{dart, point, data}`, `EdgeAttr{dart, curve, data}`, `FaceAttr`
61
+ (surface + pcurve loops), `ProfileAttr`, `SheetAttr`, `SolidAttr`.
62
+ - **Orientation triple** (`docs/topology_orientation_refactor.md`):
63
+ `identity = XKey` · `default orientation = reference dart in XAttr` ·
64
+ `contextual orientation = dart carried by the view`.
65
+ `Orientation::{Same,Reversed}` composes and applies to vectors/scalars.
66
+ - **Typed views** — `Vertex`, `Edge`, `Face`, `Profile`, `Sheet`, `Solid`, plus
67
+ `Shape<K, P>` (owned map + primary handle). *Traverse with these, not raw darts.*
68
+ - **`Payload` trait** — type-level bundle of user data per dimension;
69
+ `StandardPayload` = `()` everywhere. Most types are generic over `P: Payload`.
70
+ - **Profiles = face boundary loops; Sheets = solid shells.** They must be
71
+ **registered explicitly** (`add_profile` / `add_sheet`); commit rejects faces
72
+ or solids referencing unregistered components.
73
+
74
+ ### Transactions (read `src/topology/edit.md` — short and essential)
75
+
76
+ `GMap::transaction` / `transaction_with_policy` is the atomic boundary for a
77
+ modeling operation. The closure receives a **`TopologyEdit`** — the only public
78
+ mutation capability (`add_dart`, `remove_dart`, `link`, `unlink`, `sew`, plus
79
+ attribute create/remove/split/merge declarations).
80
+
81
+ - One public builder = one transaction; composite builders pass the same
82
+ `&mut TopologyEdit` down to private `*_staged` helpers.
83
+ - Any error, validation failure, identity-reconciliation failure or payload
84
+ policy failure restores the full transaction-start snapshot. Panics are **not** caught.
85
+ - **Lineage**: `add_*` (fresh) / `add_*_split_from` (derived) / `merge_*_into`
86
+ (explicit survivor). At commit, merge chains resolve and `EditPolicy`
87
+ (e.g. `PreservePayload`) runs only on net externally-visible changes.
88
+ - **Identity reconciliation** picks one surviving key per final cell;
89
+ transaction-start keys beat transaction-local ones. Local keys may vanish at commit.
90
+ - Derived dart→key maps are one lazy `DerivedCellIndexes` cache, invalidated on mutation.
91
+
92
+ ## Geometry
93
+
94
+ - 2D: `Curve2` (`Line2`, `Circle2`, `Ellipse2`, `NurbsCurve2`), `TrimmedCurve2`,
95
+ 2D intersections (used for pcurves/imprints).
96
+ - 3D: `Curve` (`Line`, `Circle`, NURBS), `Surface` (`Plane`, `Cylinder`,
97
+ `RuledSurface`, `SurfaceOfRevolution`, `NurbsSurface`), `BBox`, `Frame`, `Interval`.
98
+ - Intersections: curve/curve, curve/surface, surface/surface with `IntersectionOptions`.
99
+ - Tolerances: `LINEAR_TOLERANCE`, `ANGULAR_TOLERANCE`; point equality via
100
+ `PointCoincidence::coincides`.
101
+ - **Analytic-first dispatch, certified NURBS fallback** (`intersections/analytic/`):
102
+ a recognized pair is answered in closed form *before* anything is converted or
103
+ decomposed; everything else takes the NURBS solver, which is also the
104
+ differential-test oracle. `intersect_analytic_*` return `Option<Result<..>>`:
105
+ `None` declines the pair (fall back), `Ok(..Empty)` certifies disjointness.
106
+ A pair in the table that reaches a case the `Curve` types cannot carry also
107
+ declines. Covered today: surface/surface plane×{plane,sphere,cylinder} and
108
+ sphere×sphere; curve/surface line×{plane,sphere,cylinder,cone} and
109
+ circle×{plane,sphere}; curve/curve line×line, line×circle, circle×circle.
110
+ Not covered: anything involving a cone surface pair, cylinder×cylinder,
111
+ circle×{cylinder,cone}.
112
+ - **A `Curve` is an unbounded support, never trimmed to the cell carrying it.**
113
+ There is no `Curve::Bounded` variant: a line runs to infinity, a circle closes.
114
+ Which part is meant is said by **`TrimmedCurve`** (`geometry/dim3/trimmed.rs`)
115
+ — support + an `Interval` of its *native* parameters, kept as one value so the
116
+ halves cannot drift apart. It normalizes traversal (fraction 0 → 1 over the
117
+ span), unwraps periodic branches, and answers `contains` / `length` / `sub` /
118
+ `reversed`. `to_curve()` is the cut-down copy: exact, but NURBS, so reach for
119
+ it only when a curve that *is* the section is required (fitting a pcurve).
120
+ - **2D mirrors 3D exactly.** A `Curve2` is an unbounded support in a surface's
121
+ parameter space — `Line2` extrapolates, `Circle2` and `Ellipse2` close — with
122
+ *native* parameters (a line's affine, a conic's angle in radians, a NURBS
123
+ curve's own knot domain); nothing is renormalized to `[0, 1]`.
124
+ **`TrimmedCurve2`** (`geometry/dim2/trimmed.rs`) is support + `Interval`, with
125
+ the same API as `TrimmedCurve`. Both carry the same shorthand constructors —
126
+ `segment`, `arc`, `ellipse_arc` (each anchoring the support so the span is
127
+ just the sweep) and `whole` (a support that already *is* the section, such as
128
+ an interpolated NURBS) — so a common span is never spelled out as a support
129
+ and an interval side by side. **Every pcurve is a `TrimmedCurve2`**: unlike an edge, it has
130
+ no bounding vertices to derive a span from, since a face stores no 2D vertex
131
+ positions. 2D intersection takes two spans, not two supports — the
132
+ subdivision search needs control polygons, which an infinite support has none
133
+ of — and returns fractions of each span.
134
+ - **The span is derived only on an edge.** `EdgeAttr` stores no interval;
135
+ `Edge::trimmed_curve()` derives it from the bounding vertices plus the view's
136
+ orientation. Everything without vertices — `AnalyticSection`,
137
+ `SurfaceIntersectionBranch`, `FaceImprint`, `IntersectionSpan` — must carry
138
+ it: the minor and major arc between two points share both endpoints, so
139
+ endpoints alone name neither, and direction is load-bearing besides.
140
+ - **A solver answers for the support.** Clip its result to the cells' own spans
141
+ (`TrimmedCurve::contains`) before treating it as a contact, or an edge picks up
142
+ hits from the part of its line no edge occupies.
143
+ - `FaceImprint`'s two halves are **synchronized** — same fraction, same point —
144
+ which constrains the support: a `Circle` spans its arc in angle, the rational
145
+ quadratic its pcurve is fitted from does not, so an imprinted arc carries NURBS.
146
+ - A section's 3D curve is exact; its **pcurve is exact only where a closed form
147
+
148
+ ## Working rules
149
+
150
+ - **Deleting behaviour means deleting or adapting its tests.** A change is not
151
+ finished while a test still asserts, names, or explains the thing that was
152
+ removed. Grep for the concept by name, not just for compile errors: a test that
153
+ still passes can be testing nothing, and one whose name or comment describes the
154
+ old design is worse than no test, because it teaches the next reader something
155
+ false. Three outcomes, in order of preference — the test states a property that
156
+ survives, so keep it and fix the wording; the property moved to another shape,
157
+ so retarget it there; the property is genuinely gone, so delete the test. Never
158
+ leave the fourth. The same goes for doc comments, error-variant docs, `#[ignore]`
159
+ reasons, and plan files: an `#[ignore]` whose stated reason no longer applies
160
+ must be re-checked, since the test may now pass or fail for a new reason.
161
+ - **Never `git checkout`, `git restore`, or `git stash` a file to undo your own
162
+ edit.** The working tree holds uncommitted work that is not recoverable. Undo
163
+ by making the inverse edit, and use a marker comment you can grep for when
164
+ adding temporary instrumentation.
165
+ - **A comment describes the code as it is, never a plan for it.** Doc comments
166
+ and inline comments state what the thing does, why it is shaped that way, and
167
+ what it refuses — all in the present tense, all checkable against the code
168
+ next to them. They must not reference a plan document, a milestone, a stage
169
+ number, or a decision id (`plan/foo.md`, "stage 4", "D7", "arrives later",
170
+ "not implemented yet"), and must not describe behaviour that does not exist
171
+ yet. Keep the *reason* and drop the schedule: "a cylinder wall closes on
172
+ itself, which STEP cannot spell without a synthesized seam" is factual and
173
+ stays true; "…which needs seam synthesis (stage 4)" is a promise that rots the
174
+ moment the plan moves, and the reader cannot tell from the code whether it
175
+ still holds. Plans belong in `plan/`, which is where they can be revised in
176
+ one place. This applies to module docs, error-variant docs, test comments and
177
+ commit-adjacent prose alike.
ngk-0.0.1/CLAUDE.md ADDED
@@ -0,0 +1,4 @@
1
+ # CLAUDE.md — NGK
2
+
3
+ Full project instructions for all agents live in [AGENTS.md](AGENTS.md) — read
4
+ it first. This file exists only so Claude Code's own auto-load picks it up.