Shape
类型: 类
领域: 核心运行时
推荐导入: from cadflow import Shape
签名
class Shape(_session: 'NativeSession', _handle: 'ShapeHandle') -> None
功能说明
表示由某个 Model Session 拥有的不可变几何句柄。
原始 API 说明
Shape(_session: 'NativeSession', _handle: 'ShapeHandle')
参数
| 名称 | 类型 | 必需 | 默认值 | 源码说明 |
|---|---|---|---|---|
_session | 'NativeSession' | 是 | - | 源码 Docstring 未单独说明。 |
_handle | 'ShapeHandle' | 是 | - | 源码 Docstring 未单独说明。 |
返回值
类型: None
源码 Docstring 未声明更多返回语义。
异常
源码 Docstring 未声明更窄的异常契约。类型、数值、所有权、路径或后端状态无效时,仍可能抛出相应公共异常。
数据字段
| 名称 | 类型 | 默认值 |
|---|---|---|
_session | 'NativeSession' | required |
_handle | 'ShapeHandle' | required |
公共成员
| 成员 | 类型 | 签名 | 说明 |
|---|---|---|---|
area | property | - | 见成员签名。 |
bbox | property | - | 见成员签名。 |
center_of_mass | property | - | 见成员签名。 |
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' | 见成员签名。 |
export_preview_glb | method | (self, path: 'str', deflection: 'float' = 0.35) -> 'None' | 见成员签名。 |
export_step | method | (self, path: 'str') -> 'None' | 见成员签名。 |
export_stl | method | (self, path: 'str', *, binary: 'bool' = True) -> 'None' | 见成员签名。 |
face_properties | method | (self, *, u: 'float' = 0.5, v: 'float' = 0.5) -> 'dict[str, tuple[float, ...]]' | 见成员签名。 |
kind | property | - | 见成员签名。 |
length | property | - | 见成员签名。 |
mesh | method | (self, deflection: 'float' = 0.1) -> 'dict[str, list[float] | list[int]]' | 见成员签名。 |
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 | - | 见成员签名。 |
validate | method | (self) -> 'OperationReport' | Perform inexpensive, backend-neutral checks on a native shape. |
volume | property | - | 见成员签名。 |
行为与约束
- Shape 值始终绑定到其所属 Session;Session 关闭后不得继续使用。
- 实例是不可变 dataclass 值;更新式工作流会返回替代值。
导入检查
from cadflow import Shape