Shape
Kind: Class
Domain: Core runtime
Canonical import: from cadflow import Shape
Signature
class Shape(_session: 'NativeSession', _handle: 'ShapeHandle') -> None
Description
Shape(_session: 'NativeSession', _handle: 'ShapeHandle')
Parameters
| Name | Type | Required | Default | Source description |
|---|---|---|---|---|
_session | 'NativeSession' | yes | - | Not explicitly described in the source docstring. |
_handle | 'ShapeHandle' | yes | - | Not explicitly described in the source docstring. |
Returns
Type: None
The source docstring does not declare additional return semantics.
Errors
The source docstring does not declare a narrower exception contract. Invalid types, values, ownership, paths, or backend state may still raise the corresponding public error.
Data fields
| Name | Type | Default |
|---|---|---|
_session | 'NativeSession' | required |
_handle | 'ShapeHandle' | required |
Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
area | property | - | See the member signature. |
bbox | property | - | See the member signature. |
center_of_mass | property | - | See the member signature. |
contact_metrics | method | (self, other: "'Shape'") -> 'dict[str, object]' | Measure face-to-face proximity and relative orientation in C++. |
describe | method | (self, *, detail: 'str' = 'summary') -> 'dict[str, object]' | Return a JSON-safe shape summary for inspection and Agent feedback. |
distance_to | method | (self, other: "'Shape'") -> 'float' | See the member signature. |
export_preview_glb | method | (self, path: 'str', deflection: 'float' = 0.35) -> 'None' | See the member signature. |
export_step | method | (self, path: 'str') -> 'None' | See the member signature. |
export_stl | method | (self, path: 'str', *, binary: 'bool' = True) -> 'None' | See the member signature. |
face_properties | method | (self, *, u: 'float' = 0.5, v: 'float' = 0.5) -> 'dict[str, tuple[float, ...]]' | See the member signature. |
kind | property | - | See the member signature. |
length | property | - | See the member signature. |
mesh | method | (self, deflection: 'float' = 0.1) -> 'dict[str, list[float] | list[int]]' | See the member signature. |
preview_glb | method | (self, deflection: 'float' = 0.35) -> 'bytes' | Return a browser-ready GLB assembled from the native mesh buffer. |
preview_mesh_buffer | method | (self, deflection: 'float' = 0.35) -> 'bytes' | Return a compact C++-generated mesh buffer for real-time preview. |
surface_metrics | method | (self) -> 'dict[str, object]' | Return C++-measured properties needed by simulation preprocessors. |
topology | property | - | See the member signature. |
validate | method | (self) -> 'OperationReport' | Perform inexpensive, backend-neutral checks on a native shape. |
volume | property | - | See the member signature. |
Behavior and constraints
- Shape values remain bound to their owning session; do not use them after the session closes.
- Instances are immutable dataclass values; update workflows return a replacement value.
Import check
from cadflow import Shape