simplecadapi 2.0.0__tar.gz → 2.0.0b2__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 (256) hide show
  1. simplecadapi-2.0.0b2/.gitignore +27 -0
  2. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/PKG-INFO +191 -66
  3. simplecadapi-2.0.0b2/README.md +213 -0
  4. simplecadapi-2.0.0b2/docs/api/Const.md +17 -0
  5. simplecadapi-2.0.0b2/docs/api/Expr.md +17 -0
  6. simplecadapi-2.0.0b2/docs/api/ExpressionGraph.md +17 -0
  7. simplecadapi-2.0.0b2/docs/api/GraphSession.md +31 -0
  8. simplecadapi-2.0.0b2/docs/api/README.md +122 -0
  9. simplecadapi-2.0.0b2/docs/api/SemanticDelta.md +17 -0
  10. simplecadapi-2.0.0b2/docs/api/SemanticRef.md +17 -0
  11. simplecadapi-2.0.0b2/docs/api/SimpleCADError.md +17 -0
  12. simplecadapi-2.0.0b2/docs/api/Sketch.md +22 -0
  13. simplecadapi-2.0.0b2/docs/api/Var.md +17 -0
  14. simplecadapi-2.0.0b2/docs/api/and_.md +17 -0
  15. simplecadapi-2.0.0b2/docs/api/apply_tag.md +23 -0
  16. simplecadapi-2.0.0b2/docs/api/chamfer_rsolid.md +17 -0
  17. simplecadapi-2.0.0b2/docs/api/const_function.md +17 -0
  18. simplecadapi-2.0.0b2/docs/api/cut_rsolidlist.md +34 -0
  19. simplecadapi-2.0.0b2/docs/api/export_graph_json.md +31 -0
  20. simplecadapi-2.0.0b2/docs/api/export_model_json.md +22 -0
  21. simplecadapi-2.0.0b2/docs/api/export_session_json.md +17 -0
  22. simplecadapi-2.0.0b2/docs/api/export_step.md +50 -0
  23. simplecadapi-2.0.0b2/docs/api/export_stl.md +50 -0
  24. simplecadapi-2.0.0b2/docs/api/extrude_rsolid.md +17 -0
  25. simplecadapi-2.0.0b2/docs/api/fillet_rsolid.md +17 -0
  26. simplecadapi-2.0.0b2/docs/api/geo.md +17 -0
  27. simplecadapi-2.0.0b2/docs/api/helical_sweep_rsolid.md +17 -0
  28. simplecadapi-2.0.0b2/docs/api/import_graph_json.md +27 -0
  29. simplecadapi-2.0.0b2/docs/api/import_model_json.md +17 -0
  30. simplecadapi-2.0.0b2/docs/api/import_session_json.md +17 -0
  31. simplecadapi-2.0.0b2/docs/api/intersect_rsolidlist.md +31 -0
  32. simplecadapi-2.0.0b2/docs/api/linear_pattern_rsolidlist.md +17 -0
  33. simplecadapi-2.0.0b2/docs/api/list_tags.md +17 -0
  34. simplecadapi-2.0.0b2/docs/api/loft_rsolid.md +17 -0
  35. simplecadapi-2.0.0b2/docs/api/make_angle_arc_redge.md +17 -0
  36. simplecadapi-2.0.0b2/docs/api/make_angle_arc_rwire.md +17 -0
  37. simplecadapi-2.0.0b2/docs/api/make_box_rsolid.md +17 -0
  38. simplecadapi-2.0.0b2/docs/api/make_circle_redge.md +17 -0
  39. simplecadapi-2.0.0b2/docs/api/make_circle_rface.md +17 -0
  40. simplecadapi-2.0.0b2/docs/api/make_circle_rwire.md +17 -0
  41. simplecadapi-2.0.0b2/docs/api/make_cone_rsolid.md +17 -0
  42. simplecadapi-2.0.0b2/docs/api/make_cylinder_rsolid.md +17 -0
  43. simplecadapi-2.0.0b2/docs/api/make_face_from_wire_rface.md +17 -0
  44. simplecadapi-2.0.0b2/docs/api/make_helix_redge.md +17 -0
  45. simplecadapi-2.0.0b2/docs/api/make_helix_rwire.md +17 -0
  46. simplecadapi-2.0.0b2/docs/api/make_line_redge.md +17 -0
  47. simplecadapi-2.0.0b2/docs/api/make_n_hole_flange_rsolid.md +17 -0
  48. simplecadapi-2.0.0b2/docs/api/make_naca_propeller_blade_rsolid.md +17 -0
  49. simplecadapi-2.0.0b2/docs/api/make_point_rvertex.md +17 -0
  50. simplecadapi-2.0.0b2/docs/api/make_polyline_rwire.md +17 -0
  51. simplecadapi-2.0.0b2/docs/api/make_rectangle_rface.md +17 -0
  52. simplecadapi-2.0.0b2/docs/api/make_rectangle_rwire.md +17 -0
  53. simplecadapi-2.0.0b2/docs/api/make_segment_redge.md +17 -0
  54. simplecadapi-2.0.0b2/docs/api/make_segment_rwire.md +17 -0
  55. simplecadapi-2.0.0b2/docs/api/make_sphere_rsolid.md +17 -0
  56. simplecadapi-2.0.0b2/docs/api/make_spline_redge.md +17 -0
  57. simplecadapi-2.0.0b2/docs/api/make_spline_rwire.md +17 -0
  58. simplecadapi-2.0.0b2/docs/api/make_threaded_rod_rsolid.md +17 -0
  59. simplecadapi-2.0.0b2/docs/api/make_three_point_arc_redge.md +17 -0
  60. simplecadapi-2.0.0b2/docs/api/make_three_point_arc_rwire.md +17 -0
  61. simplecadapi-2.0.0b2/docs/api/make_wire_from_edges_rwire.md +17 -0
  62. simplecadapi-2.0.0b2/docs/api/meta.md +35 -0
  63. simplecadapi-2.0.0b2/docs/api/mirror_shape.md +17 -0
  64. simplecadapi-2.0.0b2/docs/api/not_.md +17 -0
  65. simplecadapi-2.0.0b2/docs/api/or_.md +17 -0
  66. simplecadapi-2.0.0b2/docs/api/radial_pattern_rsolidlist.md +17 -0
  67. simplecadapi-2.0.0b2/docs/api/render_screenshot_rpath.md +17 -0
  68. simplecadapi-2.0.0b2/docs/api/replay_graph.md +31 -0
  69. simplecadapi-2.0.0b2/docs/api/replay_model_json.md +17 -0
  70. simplecadapi-2.0.0b2/docs/api/revolve_rsolid.md +17 -0
  71. simplecadapi-2.0.0b2/docs/api/rotate_shape.md +17 -0
  72. simplecadapi-2.0.0b2/docs/api/select.md +17 -0
  73. simplecadapi-2.0.0b2/docs/api/select_edges_by_tag.md +17 -0
  74. simplecadapi-2.0.0b2/docs/api/select_faces_by_tag.md +17 -0
  75. simplecadapi-2.0.0b2/docs/api/shell_rsolid.md +17 -0
  76. simplecadapi-2.0.0b2/docs/api/suspend_graph_recording.md +17 -0
  77. simplecadapi-2.0.0b2/docs/api/sweep_rsolid.md +17 -0
  78. simplecadapi-2.0.0b2/docs/api/tag.md +27 -0
  79. simplecadapi-2.0.0b2/docs/api/translate_shape.md +17 -0
  80. simplecadapi-2.0.0b2/docs/api/union_rsolid.md +53 -0
  81. simplecadapi-2.0.0b2/docs/api/value.md +31 -0
  82. simplecadapi-2.0.0b2/docs/api/var_function.md +17 -0
  83. simplecadapi-2.0.0b2/docs/architecture/sdk-architecture-review.md +369 -0
  84. simplecadapi-2.0.0b2/docs/core/README.md +103 -0
  85. simplecadapi-2.0.0b2/docs/core/compound.md +13 -0
  86. simplecadapi-2.0.0b2/docs/core/coordinate_system.md +30 -0
  87. simplecadapi-2.0.0b2/docs/core/declarative_constraints.md +35 -0
  88. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/docs/core/edge.md +83 -88
  89. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/docs/core/face.md +108 -113
  90. simplecadapi-2.0.0b2/docs/core/operation_graph_json_spec.md +1517 -0
  91. simplecadapi-2.0.0b2/docs/core/rearchitecture_2_0.md +1072 -0
  92. simplecadapi-2.0.0b2/docs/core/rearchitecture_2_0_requirements.md +423 -0
  93. simplecadapi-2.0.0b2/docs/core/serialization/README.md +63 -0
  94. simplecadapi-2.0.0b2/docs/core/serialization/expressions-and-replay.md +146 -0
  95. simplecadapi-2.0.0b2/docs/core/serialization/features-booleans-transforms.md +471 -0
  96. simplecadapi-2.0.0b2/docs/core/serialization/primitives-and-profiles.md +457 -0
  97. simplecadapi-2.0.0b2/docs/core/serialization/scalar-fields.md +13 -0
  98. simplecadapi-2.0.0b2/docs/core/shell.md +11 -0
  99. simplecadapi-2.0.0b2/docs/core/simple_workplane.md +26 -0
  100. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/docs/core/solid.md +124 -129
  101. simplecadapi-2.0.0b2/docs/core/tagged_mixin.md +90 -0
  102. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/docs/core/vertex.md +80 -113
  103. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/docs/core/wire.md +89 -94
  104. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/pyproject.toml +36 -7
  105. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/src/simplecadapi/__init__.py +94 -27
  106. simplecadapi-2.0.0b2/src/simplecadapi/_vendor_warning_filters.py +25 -0
  107. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/src/simplecadapi/auto_tools/auto_docs_gen.py +341 -62
  108. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/src/simplecadapi/auto_tools/evolution.py +53 -49
  109. simplecadapi-2.0.0b2/src/simplecadapi/auto_tools/make_export.py +616 -0
  110. simplecadapi-2.0.0b2/src/simplecadapi/auto_tools/skill_pack.py +898 -0
  111. simplecadapi-2.0.0b2/src/simplecadapi/autotag.py +165 -0
  112. simplecadapi-2.0.0b2/src/simplecadapi/core.py +881 -0
  113. simplecadapi-2.0.0b2/src/simplecadapi/errors.py +153 -0
  114. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/src/simplecadapi/evolve.py +151 -168
  115. simplecadapi-2.0.0b2/src/simplecadapi/expr.py +411 -0
  116. simplecadapi-2.0.0b2/src/simplecadapi/frame.py +82 -0
  117. simplecadapi-2.0.0b2/src/simplecadapi/freecad_translator.py +2643 -0
  118. simplecadapi-2.0.0b2/src/simplecadapi/graph.py +395 -0
  119. simplecadapi-2.0.0b2/src/simplecadapi/kernel/__init__.py +1 -0
  120. simplecadapi-2.0.0b2/src/simplecadapi/kernel/ocp_booleans.py +93 -0
  121. simplecadapi-2.0.0b2/src/simplecadapi/kernel/ocp_builders.py +74 -0
  122. simplecadapi-2.0.0b2/src/simplecadapi/kernel/ocp_cast.py +65 -0
  123. simplecadapi-2.0.0b2/src/simplecadapi/kernel/ocp_curves.py +138 -0
  124. simplecadapi-2.0.0b2/src/simplecadapi/kernel/ocp_export.py +47 -0
  125. simplecadapi-2.0.0b2/src/simplecadapi/kernel/ocp_features.py +64 -0
  126. simplecadapi-2.0.0b2/src/simplecadapi/kernel/ocp_mesh.py +72 -0
  127. simplecadapi-2.0.0b2/src/simplecadapi/kernel/ocp_properties.py +192 -0
  128. simplecadapi-2.0.0b2/src/simplecadapi/kernel/ocp_topology.py +69 -0
  129. simplecadapi-2.0.0b2/src/simplecadapi/kernel/ocp_transforms.py +88 -0
  130. simplecadapi-2.0.0b2/src/simplecadapi/kernel/spline_fit.py +33 -0
  131. simplecadapi-2.0.0b2/src/simplecadapi/operations.py +4572 -0
  132. simplecadapi-2.0.0b2/src/simplecadapi/ql.py +1011 -0
  133. simplecadapi-2.0.0b2/src/simplecadapi/serializer.py +1673 -0
  134. simplecadapi-2.0.0b2/src/simplecadapi/sketch.py +45 -0
  135. simplecadapi-2.0.0b2/src/simplecadapi/tagging.py +155 -0
  136. simplecadapi-2.0.0b2/src/simplecadapi/topology.py +749 -0
  137. simplecadapi-2.0.0b2/src/simplecadapi/tracking.py +886 -0
  138. simplecadapi-2.0.0/.gitignore +0 -14
  139. simplecadapi-2.0.0/.python-version +0 -1
  140. simplecadapi-2.0.0/README.md +0 -87
  141. simplecadapi-2.0.0/docs/api/README.md +0 -78
  142. simplecadapi-2.0.0/docs/api/chamfer_rsolid.md +0 -67
  143. simplecadapi-2.0.0/docs/api/cut_rsolidlist.md +0 -59
  144. simplecadapi-2.0.0/docs/api/export_step.md +0 -27
  145. simplecadapi-2.0.0/docs/api/export_stl.md +0 -27
  146. simplecadapi-2.0.0/docs/api/extrude_rsolid.md +0 -65
  147. simplecadapi-2.0.0/docs/api/fillet_rsolid.md +0 -69
  148. simplecadapi-2.0.0/docs/api/helical_sweep_rsolid.md +0 -83
  149. simplecadapi-2.0.0/docs/api/intersect_rsolidlist.md +0 -60
  150. simplecadapi-2.0.0/docs/api/linear_pattern_rsolidlist.md +0 -70
  151. simplecadapi-2.0.0/docs/api/loft_rsolid.md +0 -63
  152. simplecadapi-2.0.0/docs/api/make_angle_arc_redge.md +0 -77
  153. simplecadapi-2.0.0/docs/api/make_angle_arc_rwire.md +0 -69
  154. simplecadapi-2.0.0/docs/api/make_box_rsolid.md +0 -75
  155. simplecadapi-2.0.0/docs/api/make_circle_redge.md +0 -61
  156. simplecadapi-2.0.0/docs/api/make_circle_rface.md +0 -57
  157. simplecadapi-2.0.0/docs/api/make_circle_rwire.md +0 -55
  158. simplecadapi-2.0.0/docs/api/make_cone_rsolid.md +0 -66
  159. simplecadapi-2.0.0/docs/api/make_cylinder_rsolid.md +0 -74
  160. simplecadapi-2.0.0/docs/api/make_face_from_wire_rface.md +0 -60
  161. simplecadapi-2.0.0/docs/api/make_helix_redge.md +0 -71
  162. simplecadapi-2.0.0/docs/api/make_helix_rwire.md +0 -67
  163. simplecadapi-2.0.0/docs/api/make_line_redge.md +0 -57
  164. simplecadapi-2.0.0/docs/api/make_n_hole_flange_rsolid.md +0 -94
  165. simplecadapi-2.0.0/docs/api/make_naca_propeller_blade_rsolid.md +0 -74
  166. simplecadapi-2.0.0/docs/api/make_point_rvertex.md +0 -62
  167. simplecadapi-2.0.0/docs/api/make_polyline_rwire.md +0 -59
  168. simplecadapi-2.0.0/docs/api/make_rectangle_rface.md +0 -62
  169. simplecadapi-2.0.0/docs/api/make_rectangle_rwire.md +0 -66
  170. simplecadapi-2.0.0/docs/api/make_segment_redge.md +0 -46
  171. simplecadapi-2.0.0/docs/api/make_segment_rwire.md +0 -50
  172. simplecadapi-2.0.0/docs/api/make_sphere_rsolid.md +0 -64
  173. simplecadapi-2.0.0/docs/api/make_spline_redge.md +0 -60
  174. simplecadapi-2.0.0/docs/api/make_spline_rwire.md +0 -57
  175. simplecadapi-2.0.0/docs/api/make_threaded_rod_rsolid.md +0 -79
  176. simplecadapi-2.0.0/docs/api/make_three_point_arc_redge.md +0 -61
  177. simplecadapi-2.0.0/docs/api/make_three_point_arc_rwire.md +0 -56
  178. simplecadapi-2.0.0/docs/api/make_wire_from_edges_rwire.md +0 -49
  179. simplecadapi-2.0.0/docs/api/mirror_shape.md +0 -64
  180. simplecadapi-2.0.0/docs/api/radial_pattern_rsolidlist.md +0 -74
  181. simplecadapi-2.0.0/docs/api/revolve_rsolid.md +0 -70
  182. simplecadapi-2.0.0/docs/api/rotate_shape.md +0 -70
  183. simplecadapi-2.0.0/docs/api/select_edges_by_tag.md +0 -27
  184. simplecadapi-2.0.0/docs/api/select_faces_by_tag.md +0 -27
  185. simplecadapi-2.0.0/docs/api/set_tag.md +0 -27
  186. simplecadapi-2.0.0/docs/api/shell_rsolid.md +0 -67
  187. simplecadapi-2.0.0/docs/api/sweep_rsolid.md +0 -68
  188. simplecadapi-2.0.0/docs/api/translate_shape.md +0 -59
  189. simplecadapi-2.0.0/docs/api/union_rsolidlist.md +0 -51
  190. simplecadapi-2.0.0/docs/core/README.md +0 -212
  191. simplecadapi-2.0.0/docs/core/compound.md +0 -635
  192. simplecadapi-2.0.0/docs/core/coordinate_system.md +0 -175
  193. simplecadapi-2.0.0/docs/core/shell.md +0 -518
  194. simplecadapi-2.0.0/docs/core/simple_workplane.md +0 -278
  195. simplecadapi-2.0.0/docs/core/tagged_mixin.md +0 -692
  196. simplecadapi-2.0.0/examples.py +0 -949
  197. simplecadapi-2.0.0/sandbox/test.py +0 -135
  198. simplecadapi-2.0.0/scripts/publish.sh +0 -45
  199. simplecadapi-2.0.0/src/docs/api/README.md +0 -78
  200. simplecadapi-2.0.0/src/docs/api/chamfer_rsolid.md +0 -56
  201. simplecadapi-2.0.0/src/docs/api/cut_rsolidlist.md +0 -48
  202. simplecadapi-2.0.0/src/docs/api/export_step.md +0 -23
  203. simplecadapi-2.0.0/src/docs/api/export_stl.md +0 -23
  204. simplecadapi-2.0.0/src/docs/api/extrude_rsolid.md +0 -54
  205. simplecadapi-2.0.0/src/docs/api/fillet_rsolid.md +0 -58
  206. simplecadapi-2.0.0/src/docs/api/helical_sweep_rsolid.md +0 -71
  207. simplecadapi-2.0.0/src/docs/api/intersect_rsolidlist.md +0 -49
  208. simplecadapi-2.0.0/src/docs/api/linear_pattern_rsolidlist.md +0 -59
  209. simplecadapi-2.0.0/src/docs/api/loft_rsolid.md +0 -52
  210. simplecadapi-2.0.0/src/docs/api/make_angle_arc_redge.md +0 -62
  211. simplecadapi-2.0.0/src/docs/api/make_angle_arc_rwire.md +0 -58
  212. simplecadapi-2.0.0/src/docs/api/make_box_rsolid.md +0 -60
  213. simplecadapi-2.0.0/src/docs/api/make_circle_redge.md +0 -50
  214. simplecadapi-2.0.0/src/docs/api/make_circle_rface.md +0 -50
  215. simplecadapi-2.0.0/src/docs/api/make_circle_rwire.md +0 -48
  216. simplecadapi-2.0.0/src/docs/api/make_cone_rsolid.md +0 -59
  217. simplecadapi-2.0.0/src/docs/api/make_cylinder_rsolid.md +0 -59
  218. simplecadapi-2.0.0/src/docs/api/make_face_from_wire_rface.md +0 -49
  219. simplecadapi-2.0.0/src/docs/api/make_helix_redge.md +0 -60
  220. simplecadapi-2.0.0/src/docs/api/make_helix_rwire.md +0 -60
  221. simplecadapi-2.0.0/src/docs/api/make_line_redge.md +0 -46
  222. simplecadapi-2.0.0/src/docs/api/make_n_hole_flange_rsolid.md +0 -92
  223. simplecadapi-2.0.0/src/docs/api/make_naca_propeller_blade_rsolid.md +0 -71
  224. simplecadapi-2.0.0/src/docs/api/make_point_rvertex.md +0 -51
  225. simplecadapi-2.0.0/src/docs/api/make_polyline_rwire.md +0 -48
  226. simplecadapi-2.0.0/src/docs/api/make_rectangle_rface.md +0 -55
  227. simplecadapi-2.0.0/src/docs/api/make_rectangle_rwire.md +0 -55
  228. simplecadapi-2.0.0/src/docs/api/make_segment_redge.md +0 -39
  229. simplecadapi-2.0.0/src/docs/api/make_segment_rwire.md +0 -43
  230. simplecadapi-2.0.0/src/docs/api/make_sphere_rsolid.md +0 -49
  231. simplecadapi-2.0.0/src/docs/api/make_spline_redge.md +0 -49
  232. simplecadapi-2.0.0/src/docs/api/make_spline_rwire.md +0 -50
  233. simplecadapi-2.0.0/src/docs/api/make_threaded_rod_rsolid.md +0 -76
  234. simplecadapi-2.0.0/src/docs/api/make_three_point_arc_redge.md +0 -50
  235. simplecadapi-2.0.0/src/docs/api/make_three_point_arc_rwire.md +0 -49
  236. simplecadapi-2.0.0/src/docs/api/make_wire_from_edges_rwire.md +0 -42
  237. simplecadapi-2.0.0/src/docs/api/mirror_shape.md +0 -53
  238. simplecadapi-2.0.0/src/docs/api/radial_pattern_rsolidlist.md +0 -63
  239. simplecadapi-2.0.0/src/docs/api/revolve_rsolid.md +0 -59
  240. simplecadapi-2.0.0/src/docs/api/rotate_shape.md +0 -59
  241. simplecadapi-2.0.0/src/docs/api/select_edges_by_tag.md +0 -23
  242. simplecadapi-2.0.0/src/docs/api/select_faces_by_tag.md +0 -23
  243. simplecadapi-2.0.0/src/docs/api/set_tag.md +0 -23
  244. simplecadapi-2.0.0/src/docs/api/shell_rsolid.md +0 -56
  245. simplecadapi-2.0.0/src/docs/api/sweep_rsolid.md +0 -57
  246. simplecadapi-2.0.0/src/docs/api/translate_shape.md +0 -48
  247. simplecadapi-2.0.0/src/docs/api/union_rsolidlist.md +0 -44
  248. simplecadapi-2.0.0/src/simplecadapi/auto_tools/make_export.py +0 -697
  249. simplecadapi-2.0.0/src/simplecadapi/core.py +0 -1038
  250. simplecadapi-2.0.0/src/simplecadapi/operations.py +0 -2842
  251. simplecadapi-2.0.0/test/test_all_features.py +0 -866
  252. simplecadapi-2.0.0/uv.lock +0 -3278
  253. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/LICENSE +0 -0
  254. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/MANIFEST.in +0 -0
  255. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/src/simplecadapi/auto_tools/__init__.py +0 -0
  256. {simplecadapi-2.0.0 → simplecadapi-2.0.0b2}/src/simplecadapi/py.typed +0 -0
@@ -0,0 +1,27 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ .env
13
+
14
+ output/
15
+
16
+ # Sandbox artifacts
17
+ sandbox/
18
+
19
+ # Generated skills archives
20
+ skills/*.tar.gz
21
+
22
+ .DS_Store
23
+
24
+ # CAD/export artifacts
25
+ *.step
26
+ *.stl
27
+ examples.py
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simplecadapi
3
- Version: 2.0.0
4
- Summary: A simplified CAD modeling Python API based on CADQuery
3
+ Version: 2.0.0b2
4
+ Summary: A simplified OCP-native CAD modeling Python API
5
5
  Project-URL: Homepage, https://github.com/NiJingzhe/SimpleCADAPI
6
6
  Project-URL: Repository, https://github.com/NiJingzhe/SimpleCADAPI
7
7
  Project-URL: Documentation, https://github.com/NiJingzhe/SimpleCADAPI#readme
@@ -348,7 +348,7 @@ License: GNU GENERAL PUBLIC LICENSE
348
348
  library. If this is what you want to do, use the GNU Lesser General
349
349
  Public License instead of this License.
350
350
  License-File: LICENSE
351
- Keywords: 3d,cad,cadquery,design,modeling
351
+ Keywords: 3d,cad,design,modeling,ocp,opencascade
352
352
  Classifier: Development Status :: 3 - Alpha
353
353
  Classifier: Intended Audience :: Developers
354
354
  Classifier: Intended Audience :: Manufacturing
@@ -361,7 +361,7 @@ Classifier: Programming Language :: Python :: 3.12
361
361
  Classifier: Topic :: Scientific/Engineering
362
362
  Classifier: Topic :: Scientific/Engineering :: Visualization
363
363
  Requires-Python: >=3.10
364
- Requires-Dist: cadquery>=2.5.2
364
+ Requires-Dist: cadquery-ocp>=7.8.1
365
365
  Requires-Dist: numpy>=1.21.0
366
366
  Requires-Dist: rich>=14.0.0
367
367
  Provides-Extra: dev
@@ -371,93 +371,218 @@ Requires-Dist: mypy>=1.0; extra == 'dev'
371
371
  Requires-Dist: pytest-cov>=4.0; extra == 'dev'
372
372
  Requires-Dist: pytest>=7.0; extra == 'dev'
373
373
  Provides-Extra: editor
374
- Requires-Dist: cq-editor>=0.5.0; extra == 'editor'
375
374
  Description-Content-Type: text/markdown
376
375
 
377
- # CAD建模形式化Python API设计与实现
376
+ # SimpleCADAPI
378
377
 
379
- ---
378
+ SimpleCADAPI is an OCP-native imperative CAD modeling Python package. It keeps the 1.x-style functional API while adding v2 graph recording, expression parameters, and replayable model JSON workflows.
380
379
 
381
- ## 简介
380
+ ## README Scope
382
381
 
383
- 本项目旨在使用CadQuery的occ impl.shapes中提供的方法,编写一套命令式的Python API,以简化通过代码进行CAD建模的过程。API设计遵循开放封闭原则,核心类型封闭,所有的操作和扩展都通过新建函数实现。
384
- 同时兼容Numpy库,允许用户在几何体上进行高效的数学运算和变换。
382
+ This README only covers package-level capabilities, installation methods, publishing/packaging workflows, and Skills usage instructions.
383
+ Experimental scripts and temporary modeling examples are not included as formal documentation.
385
384
 
386
- ## 详细文档
385
+ ## Package Installation (Python Package Managers)
387
386
 
388
- ![Document](./docs/)
387
+ Current package name: `simplecadapi` (see `pyproject.toml` for the version).
389
388
 
390
- ## 基础类型
389
+ ### Method A: Install from package repository with pip
391
390
 
392
- ### 图元类型
391
+ ```bash
392
+ pip install simplecadapi
393
+ ```
393
394
 
394
- 图元类型和OCP的TopoDS_Shape类型一一对应,主要包括以下几种:
395
+ Optional development dependencies:
395
396
 
396
- - `Solid`: 实体类型,表示封闭的三维几何体。
397
- - `Face`: 面类型,表示单个表面。
398
- - `Edge`: 边类型,表示曲线边界。
399
- - `Vertex`: 顶点类型,表示几何体的点。
400
- - `Wire`: 线类型,表示边的集合。
397
+ ```bash
398
+ pip install "simplecadapi[dev]"
399
+ ```
401
400
 
402
- ### 坐标系类型
401
+ ### Method B: Install with uv
403
402
 
404
- 坐标系类型用于定义三维空间中的位置和方向,我们对于世界坐标系的定义是:一个右手坐标系,原点在(0, 0, 0),默认X轴向前,Y轴向右,Z轴向上。坐标系类型包括:
403
+ Install in the current virtual environment:
405
404
 
406
- - `SimpleWorkplane`: 工作平面类型,表示一个二维平面,本质上统计一个原点和一个法向量和一个X轴方向向量。作为一个上下文变量,可以通过with语法包裹操作,那么这些操作就会在这个工作平面下进行。允许嵌套定义Workplane,那么嵌套定义的平面将在上一个平面的基础上进行变换。
405
+ ```bash
406
+ uv pip install simplecadapi
407
+ ```
407
408
 
408
- ## API命名风格
409
+ Add as a project dependency in `pyproject.toml`:
409
410
 
410
- - 所有函数名使用小写字母和下划线分隔(snake_case),要求使用动词开头,表示操作或行为,同时需要包含API的返回类型(因为同名API可能会重载为返回不同类型的对象,但我们想要避免这一点),例如:`make_circle_rwire`, `make_circle_redge`, `make_circle_rface`, `extrude_rsolid`等
411
- - 类名使用驼峰命名法(CamelCase)
412
- - 函数和类的文档字符串使用Google风格,包含参数、返回值和异常说明
413
- - 所有函数和类都应有类型注解,确保代码的可读性和可维护性
414
- - 所有函数和类都应有详细的文档字符串,描述其功能、参数、返回值和异常
415
- - 所有函数和类都应有示例代码,便于用户理解和使用
416
- - 所有的代码实现都要有严格且详细的try catch和异常抛出,异常抛出的内容中要求明确指出错误原因,以及用户应当如何在调用层做出怎样的改进可能可以避免这个问题。
411
+ ```bash
412
+ uv add simplecadapi
413
+ ```
417
414
 
418
- ## 扩展原则
415
+ ### Method C: Install from local build artifacts
419
416
 
420
- 开放封闭原则,核心类型封闭,所有的操作和扩展都通过新建函数实现。我们可以通过利用现有的函数和操作来组合出新的高级操作并封装为函数来实现功能的扩展。
417
+ Build a local wheel/sdist first if you want to install from local artifacts:
421
418
 
422
- ## 自动化工具 (Auto Tools)
419
+ ```bash
420
+ uv build
421
+ ```
423
422
 
424
- 项目包含一套自动化工具,用于支持API的自进化开发流程:
423
+ ## Quick Verification of Installation
425
424
 
426
- ### 主要CLI工具
425
+ ```python
426
+ import simplecadapi as scad
427
427
 
428
- #### 1. `auto_docs_gen.py` - 动态文档生成
429
- - **功能**: 自动从`operations.py`和`evolve.py`中提取所有API函数
430
- - **特点**:
431
- - 解析函数签名、文档字符串、参数说明、返回值、异常信息
432
- - 自动清理已删除API对应的过期文档
433
- - 支持多源文件与多输出目录参数(`--source`、`--output-dir`)
434
- - **输出**: 生成格式统一的Markdown文档到`docs/api/`目录(默认)
435
- - **使用**: `auto-docs-gen [--source <path>] [--output-dir <dir>] [--no-clean]`
428
+ box = scad.make_box_rsolid(10.0, 20.0, 30.0)
429
+ scad.export_stl(box, "example_box.stl")
430
+ scad.export_step(box, "example_box.step")
431
+ ```
436
432
 
437
- #### 2. `make_export.py` - 动态修改__init__.py
438
- - **功能**: 自动更新`__init__.py`文件中的导入和导出
439
- - **特点**:
440
- - 自动检测新增的API函数
441
- - 按功能分类组织导入语句
442
- - 生成友好的别名映射
443
- - 支持预览模式(`--dry-run`)和强制模式(`--force`)
444
- - **使用**: `python make_export.py [--dry-run] [--force]`
433
+ ## How to Package SDK Skills
445
434
 
446
- #### 3. `evolution.py` - 代码自进化
447
- - **功能**: 从指定脚本中自动抽取新的建模函数并添加到`evolve.py`
448
- - **特点**:
449
- - 提取函数完整实现代码
450
- - 自动处理导入语句
451
- - 支持代码自进化开发流程
452
- - **使用**: `python evolution.py <script_path>`
435
+ This project provides the `skill-pack` CLI for generating lightweight SDK reference skills: **No built-in SDK source code**, focused on API and architecture descriptions.
453
436
 
454
- ### 自进化开发流程
437
+ ### 1) Packaging Command
455
438
 
456
- 这套工具支持以下自进化开发流程:
439
+ Execute in the repository root directory:
457
440
 
458
- 1. **开发新API**: 在`operations.py`或`evolve.py`中添加新函数
459
- 2. **自动导出**: 运行`make_export.py`更新`__init__.py`
460
- 3. **生成文档**: 运行`auto_docs_gen.py`生成API文档
461
- 4. **持续进化**: 重复上述流程实现API的持续进化
441
+ ```bash
442
+ uv run skill-pack --refresh-docs --archive --skill-name simplecadapi
443
+ ```
462
444
 
463
- 所有工具都支持错误处理和详细的日志输出,确保开发流程的稳定性和可追踪性。
445
+ Common parameters:
446
+
447
+ - `--output-root <dir>`: Output directory (default `./skills`)
448
+ - `--package-name <pkg>`: Runtime installation package name (default reads from `project.name`)
449
+ - `--package-version <ver>`: Runtime installation version (default reads from `project.version`)
450
+ - `--no-clean`: Do not clean existing output directory
451
+ - `--archive`: Additionally generate `<skill-name>.tar.gz`
452
+
453
+ ### 2) Packaging Result Structure
454
+
455
+ After packaging, you will get a directory similar to:
456
+
457
+ - `skills/simplecadapi/SKILL.md`
458
+ - `skills/simplecadapi/references/`
459
+ - `skills/simplecadapi/references/docs/api/`
460
+ - `skills/simplecadapi/references/docs/core/`
461
+
462
+ ### 3) Read the SDK skill
463
+
464
+ ```bash
465
+ cd skills/simplecadapi
466
+ ```
467
+
468
+ Key entry points:
469
+
470
+ - `skills/simplecadapi/SKILL.md`
471
+ - `skills/simplecadapi/references/SDK_OVERVIEW.md`
472
+ - `skills/simplecadapi/references/SDK_SURFACES.md`
473
+ - `skills/simplecadapi/references/V2_MODELING_WORKFLOWS.md`
474
+ - `skills/simplecadapi/references/SDK_PACKAGE_SUMMARY.md`
475
+ - `skills/simplecadapi/references/docs/api/README.md`
476
+ - `skills/simplecadapi/references/docs/core/README.md`
477
+
478
+ ### 4) Preferred v2 replay workflow
479
+
480
+ ```python
481
+ from simplecadapi import GraphSession, export_model_json, replay_model_json
482
+
483
+ with GraphSession() as session:
484
+ ...
485
+
486
+ model_json = export_model_json(session)
487
+ rebuilt = replay_model_json(model_json)
488
+ print(len(rebuilt))
489
+ ```
490
+
491
+ ## Serialization and Replay Docs
492
+
493
+ For detailed operation-by-operation JSON formats and replay behavior, see:
494
+
495
+ - [`docs/core/serialization/README.md`](docs/core/serialization/README.md)
496
+ - [`docs/core/operation_graph_json_spec.md`](docs/core/operation_graph_json_spec.md)
497
+ - [`examples/07_serialization_operation_tree.py`](examples/07_serialization_operation_tree.py)
498
+
499
+ ## Auto Tools
500
+
501
+ The project includes 4 main CLIs:
502
+
503
+ - `auto-docs-gen`: Generate `docs/api/` documentation from the public API source surface
504
+ - `make-export`: Update imports/exports in `src/simplecadapi/__init__.py`
505
+ - `evolve`: Extract functions from scripts for repository-managed evolve modules
506
+ - `skill-pack`: Package thin SDK skill (documentation only)
507
+
508
+ Examples:
509
+
510
+ ```bash
511
+ uv run make-export --dry-run
512
+ uv run auto-docs-gen
513
+ uv run evolve path/to/your_case.py
514
+ uv run skill-pack --refresh-docs --archive
515
+ ```
516
+
517
+ ## RAGFlow Documentation Sync
518
+
519
+ `scripts/sync_ragflow_docs.py` is used to incrementally sync Markdown files under `docs/` to the specified RAGFlow dataset, chunked by H2 headings; the document's `chunk_method` is set to `manual`.
520
+
521
+ Prepare the environment:
522
+
523
+ ```bash
524
+ .venv/bin/python -m pip install ragflow-sdk
525
+ ```
526
+
527
+ It is recommended to use `.env` (already added to `.gitignore`):
528
+
529
+ ```bash
530
+ RAGFLOW_API_KEY=your_key_here
531
+ RAGFLOW_BASE_URL=http://localhost
532
+ RAGFLOW_DATASET_NAME=SimpleCADAPI
533
+ ```
534
+
535
+ Run the sync:
536
+
537
+ ```bash
538
+ set -a && source .env && set +a
539
+ .venv/bin/python scripts/sync_ragflow_docs.py --create-dataset
540
+ ```
541
+
542
+ Common parameters:
543
+
544
+ - `--dataset-id` / `RAGFLOW_DATASET_ID`: Directly specify the dataset ID (avoid name conflicts)
545
+ - `--delete-removed`: Delete documents that have been removed locally
546
+ - `--dry-run`: Only preview changes without executing writes
547
+ - `--progress-interval N`: Print progress every N documents
548
+
549
+ ## Development and Testing
550
+
551
+ Local development installation (editable):
552
+
553
+ ```bash
554
+ uv pip install -e ".[dev]"
555
+ ```
556
+
557
+ Run unit tests:
558
+
559
+ ```bash
560
+ uv run python -m unittest test/test_all_features.py
561
+ ```
562
+
563
+ Run examples:
564
+
565
+ ```bash
566
+ uv run python examples/01_basic_modeling.py
567
+ uv run python examples/02_graph_replay.py
568
+ uv run python examples/03_expressions.py
569
+ uv run python examples/05_loft_sweep_revolve.py
570
+ uv run python examples/06_parametric_gear_model.py
571
+ uv run python examples/07_serialization_operation_tree.py
572
+ ```
573
+
574
+ ## Core Design Constraints (Brief)
575
+
576
+ - API functions uniformly use `snake_case` and reflect return types in function names (e.g., `*_rsolid`, `*_rwire`).
577
+ - Core types are OCP-native wrappers and are kept as stable as possible; functionality is extended by adding new functions (Open-Closed Principle).
578
+ - Support `SimpleWorkplane` context for local coordinate modeling.
579
+ - Export interfaces support single entities, multiple entities, and nested list inputs.
580
+
581
+ ## Documentation Entry Points
582
+
583
+ - API documentation: `docs/api/`
584
+ - Core documentation: `docs/core/`
585
+
586
+ ## License
587
+
588
+ MIT, see `LICENSE`.
@@ -0,0 +1,213 @@
1
+ # SimpleCADAPI
2
+
3
+ SimpleCADAPI is an OCP-native imperative CAD modeling Python package. It keeps the 1.x-style functional API while adding v2 graph recording, expression parameters, and replayable model JSON workflows.
4
+
5
+ ## README Scope
6
+
7
+ This README only covers package-level capabilities, installation methods, publishing/packaging workflows, and Skills usage instructions.
8
+ Experimental scripts and temporary modeling examples are not included as formal documentation.
9
+
10
+ ## Package Installation (Python Package Managers)
11
+
12
+ Current package name: `simplecadapi` (see `pyproject.toml` for the version).
13
+
14
+ ### Method A: Install from package repository with pip
15
+
16
+ ```bash
17
+ pip install simplecadapi
18
+ ```
19
+
20
+ Optional development dependencies:
21
+
22
+ ```bash
23
+ pip install "simplecadapi[dev]"
24
+ ```
25
+
26
+ ### Method B: Install with uv
27
+
28
+ Install in the current virtual environment:
29
+
30
+ ```bash
31
+ uv pip install simplecadapi
32
+ ```
33
+
34
+ Add as a project dependency in `pyproject.toml`:
35
+
36
+ ```bash
37
+ uv add simplecadapi
38
+ ```
39
+
40
+ ### Method C: Install from local build artifacts
41
+
42
+ Build a local wheel/sdist first if you want to install from local artifacts:
43
+
44
+ ```bash
45
+ uv build
46
+ ```
47
+
48
+ ## Quick Verification of Installation
49
+
50
+ ```python
51
+ import simplecadapi as scad
52
+
53
+ box = scad.make_box_rsolid(10.0, 20.0, 30.0)
54
+ scad.export_stl(box, "example_box.stl")
55
+ scad.export_step(box, "example_box.step")
56
+ ```
57
+
58
+ ## How to Package SDK Skills
59
+
60
+ This project provides the `skill-pack` CLI for generating lightweight SDK reference skills: **No built-in SDK source code**, focused on API and architecture descriptions.
61
+
62
+ ### 1) Packaging Command
63
+
64
+ Execute in the repository root directory:
65
+
66
+ ```bash
67
+ uv run skill-pack --refresh-docs --archive --skill-name simplecadapi
68
+ ```
69
+
70
+ Common parameters:
71
+
72
+ - `--output-root <dir>`: Output directory (default `./skills`)
73
+ - `--package-name <pkg>`: Runtime installation package name (default reads from `project.name`)
74
+ - `--package-version <ver>`: Runtime installation version (default reads from `project.version`)
75
+ - `--no-clean`: Do not clean existing output directory
76
+ - `--archive`: Additionally generate `<skill-name>.tar.gz`
77
+
78
+ ### 2) Packaging Result Structure
79
+
80
+ After packaging, you will get a directory similar to:
81
+
82
+ - `skills/simplecadapi/SKILL.md`
83
+ - `skills/simplecadapi/references/`
84
+ - `skills/simplecadapi/references/docs/api/`
85
+ - `skills/simplecadapi/references/docs/core/`
86
+
87
+ ### 3) Read the SDK skill
88
+
89
+ ```bash
90
+ cd skills/simplecadapi
91
+ ```
92
+
93
+ Key entry points:
94
+
95
+ - `skills/simplecadapi/SKILL.md`
96
+ - `skills/simplecadapi/references/SDK_OVERVIEW.md`
97
+ - `skills/simplecadapi/references/SDK_SURFACES.md`
98
+ - `skills/simplecadapi/references/V2_MODELING_WORKFLOWS.md`
99
+ - `skills/simplecadapi/references/SDK_PACKAGE_SUMMARY.md`
100
+ - `skills/simplecadapi/references/docs/api/README.md`
101
+ - `skills/simplecadapi/references/docs/core/README.md`
102
+
103
+ ### 4) Preferred v2 replay workflow
104
+
105
+ ```python
106
+ from simplecadapi import GraphSession, export_model_json, replay_model_json
107
+
108
+ with GraphSession() as session:
109
+ ...
110
+
111
+ model_json = export_model_json(session)
112
+ rebuilt = replay_model_json(model_json)
113
+ print(len(rebuilt))
114
+ ```
115
+
116
+ ## Serialization and Replay Docs
117
+
118
+ For detailed operation-by-operation JSON formats and replay behavior, see:
119
+
120
+ - [`docs/core/serialization/README.md`](docs/core/serialization/README.md)
121
+ - [`docs/core/operation_graph_json_spec.md`](docs/core/operation_graph_json_spec.md)
122
+ - [`examples/07_serialization_operation_tree.py`](examples/07_serialization_operation_tree.py)
123
+
124
+ ## Auto Tools
125
+
126
+ The project includes 4 main CLIs:
127
+
128
+ - `auto-docs-gen`: Generate `docs/api/` documentation from the public API source surface
129
+ - `make-export`: Update imports/exports in `src/simplecadapi/__init__.py`
130
+ - `evolve`: Extract functions from scripts for repository-managed evolve modules
131
+ - `skill-pack`: Package thin SDK skill (documentation only)
132
+
133
+ Examples:
134
+
135
+ ```bash
136
+ uv run make-export --dry-run
137
+ uv run auto-docs-gen
138
+ uv run evolve path/to/your_case.py
139
+ uv run skill-pack --refresh-docs --archive
140
+ ```
141
+
142
+ ## RAGFlow Documentation Sync
143
+
144
+ `scripts/sync_ragflow_docs.py` is used to incrementally sync Markdown files under `docs/` to the specified RAGFlow dataset, chunked by H2 headings; the document's `chunk_method` is set to `manual`.
145
+
146
+ Prepare the environment:
147
+
148
+ ```bash
149
+ .venv/bin/python -m pip install ragflow-sdk
150
+ ```
151
+
152
+ It is recommended to use `.env` (already added to `.gitignore`):
153
+
154
+ ```bash
155
+ RAGFLOW_API_KEY=your_key_here
156
+ RAGFLOW_BASE_URL=http://localhost
157
+ RAGFLOW_DATASET_NAME=SimpleCADAPI
158
+ ```
159
+
160
+ Run the sync:
161
+
162
+ ```bash
163
+ set -a && source .env && set +a
164
+ .venv/bin/python scripts/sync_ragflow_docs.py --create-dataset
165
+ ```
166
+
167
+ Common parameters:
168
+
169
+ - `--dataset-id` / `RAGFLOW_DATASET_ID`: Directly specify the dataset ID (avoid name conflicts)
170
+ - `--delete-removed`: Delete documents that have been removed locally
171
+ - `--dry-run`: Only preview changes without executing writes
172
+ - `--progress-interval N`: Print progress every N documents
173
+
174
+ ## Development and Testing
175
+
176
+ Local development installation (editable):
177
+
178
+ ```bash
179
+ uv pip install -e ".[dev]"
180
+ ```
181
+
182
+ Run unit tests:
183
+
184
+ ```bash
185
+ uv run python -m unittest test/test_all_features.py
186
+ ```
187
+
188
+ Run examples:
189
+
190
+ ```bash
191
+ uv run python examples/01_basic_modeling.py
192
+ uv run python examples/02_graph_replay.py
193
+ uv run python examples/03_expressions.py
194
+ uv run python examples/05_loft_sweep_revolve.py
195
+ uv run python examples/06_parametric_gear_model.py
196
+ uv run python examples/07_serialization_operation_tree.py
197
+ ```
198
+
199
+ ## Core Design Constraints (Brief)
200
+
201
+ - API functions uniformly use `snake_case` and reflect return types in function names (e.g., `*_rsolid`, `*_rwire`).
202
+ - Core types are OCP-native wrappers and are kept as stable as possible; functionality is extended by adding new functions (Open-Closed Principle).
203
+ - Support `SimpleWorkplane` context for local coordinate modeling.
204
+ - Export interfaces support single entities, multiple entities, and nested list inputs.
205
+
206
+ ## Documentation Entry Points
207
+
208
+ - API documentation: `docs/api/`
209
+ - Core documentation: `docs/core/`
210
+
211
+ ## License
212
+
213
+ MIT, see `LICENSE`.
@@ -0,0 +1,17 @@
1
+ # Const
2
+
3
+ ## Class Definition
4
+
5
+ ```python
6
+ class Const
7
+ ```
8
+
9
+ *Source: expr.py*
10
+
11
+ ## Import Surface
12
+
13
+ - top-level: `from simplecadapi import Const`
14
+
15
+ ## Description
16
+
17
+ Immutable constant node used in the v2 expression graph.
@@ -0,0 +1,17 @@
1
+ # Expr
2
+
3
+ ## Class Definition
4
+
5
+ ```python
6
+ class Expr
7
+ ```
8
+
9
+ *Source: expr.py*
10
+
11
+ ## Import Surface
12
+
13
+ - top-level: `from simplecadapi import Expr`
14
+
15
+ ## Description
16
+
17
+ Derived scalar expression node built from one or more operands.
@@ -0,0 +1,17 @@
1
+ # ExpressionGraph
2
+
3
+ ## Class Definition
4
+
5
+ ```python
6
+ class ExpressionGraph()
7
+ ```
8
+
9
+ *Source: expr.py*
10
+
11
+ ## Import Surface
12
+
13
+ - top-level: `from simplecadapi import ExpressionGraph`
14
+
15
+ ## Description
16
+
17
+ A lightweight registry of expression DAG nodes.
@@ -0,0 +1,31 @@
1
+ # GraphSession
2
+
3
+ ## Class Definition
4
+
5
+ ```python
6
+ class GraphSession(graph_id: Optional[str] = None)
7
+ ```
8
+
9
+ *Source: graph.py*
10
+
11
+ ## Import Surface
12
+
13
+ - top-level: `from simplecadapi import GraphSession`
14
+
15
+ ## Description
16
+
17
+ Context manager that records CAD operations into a DAG.
18
+
19
+ with GraphSession() as session:
20
+ n1 = record_operation(
21
+ "make_line_redge", {"start": (0, 0, 0), "end": (1, 0, 0)}
22
+ )
23
+ n2 = record_operation(
24
+ "make_line_redge", {"start": (1, 0, 0), "end": (1, 1, 0)}
25
+ )
26
+ record_operation(
27
+ "make_wire_from_edges_rwire", {"edge_count": 2}, inputs=[n1, n2]
28
+ )
29
+
30
+ # Access the graph after the session
31
+ print(session.graph.topological_order())