Import CAD projects and cad-router v1

This commit is contained in:
Jerry
2026-07-22 19:38:36 +08:00
parent e4e0199bd5
commit af9f630c11
2253 changed files with 1994207 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
# GraphSession
## Class Definition
```python
class GraphSession(graph_id: Optional[str] = None)
```
*Source: graph.py*
## Import Surface
- top-level: `from simplecadapi import GraphSession`
## Description
Context manager that records CAD operations into a DAG.
with GraphSession() as session:
n1 = record_operation(
"make_line_redge", {"start": (0, 0, 0), "end": (1, 0, 0)}
)
n2 = record_operation(
"make_line_redge", {"start": (1, 0, 0), "end": (1, 1, 0)}
)
record_operation(
"make_wire_from_edges_rwire", {"edge_count": 2}, inputs=[n1, n2]
)
# Access the graph after the session
print(session.graph.topological_order())