feat: integrate SimpleCADAPI 2.0.2 CAD workflows
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
## API Definition
|
||||
|
||||
```python
|
||||
def var(name: str, default: int | float, comment: str | None = None) -> Var
|
||||
def var(name: str, default: int | float, comment: str | None = None, tolerance: ToleranceLike | None = None, *, unit: UnitLike | None = None, tolerance_unit: UnitLike | None = None) -> Var
|
||||
```
|
||||
|
||||
*Source: expr.py*
|
||||
@@ -14,4 +14,13 @@ def var(name: str, default: int | float, comment: str | None = None) -> Var
|
||||
|
||||
## Description
|
||||
|
||||
Create a named variable node for v2 expression-driven parameters.
|
||||
Create a physical or legacy scalar variable.
|
||||
|
||||
``tolerance=0.1`` declares a symmetric ``+/-0.1`` tolerance. Use a
|
||||
``(lower_deviation, upper_deviation)`` pair for an asymmetric tolerance.
|
||||
``tolerance_unit`` defaults to ``unit`` when a nominal unit is declared.
|
||||
Values are converted to canonical CAD units only when evaluated, so the
|
||||
declaration and serialized expression node preserve the user's units.
|
||||
|
||||
Variables without ``unit`` retain legacy unitless behavior. A unit-aware
|
||||
expression cannot mix declared-unit variables with legacy variables.
|
||||
|
||||
Reference in New Issue
Block a user