跳到主要内容

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

公共成员

成员类型签名说明
areaproperty-见成员签名。
bboxproperty-见成员签名。
center_of_massproperty-见成员签名。
contact_metricsmethod(self, other: "'Shape'") -> 'dict[str, object]'Measure face-to-face proximity and relative orientation in C++.
describemethod(self, *, detail: 'str' = 'summary') -> 'dict[str, object]'Return a JSON-safe shape summary for inspection and Agent feedback.
distance_tomethod(self, other: "'Shape'") -> 'float'见成员签名。
export_preview_glbmethod(self, path: 'str', deflection: 'float' = 0.35) -> 'None'见成员签名。
export_stepmethod(self, path: 'str') -> 'None'见成员签名。
export_stlmethod(self, path: 'str', *, binary: 'bool' = True) -> 'None'见成员签名。
face_propertiesmethod(self, *, u: 'float' = 0.5, v: 'float' = 0.5) -> 'dict[str, tuple[float, ...]]'见成员签名。
kindproperty-见成员签名。
lengthproperty-见成员签名。
meshmethod(self, deflection: 'float' = 0.1) -> 'dict[str, list[float] | list[int]]'见成员签名。
preview_glbmethod(self, deflection: 'float' = 0.35) -> 'bytes'Return a browser-ready GLB assembled from the native mesh buffer.
preview_mesh_buffermethod(self, deflection: 'float' = 0.35) -> 'bytes'Return a compact C++-generated mesh buffer for real-time preview.
surface_metricsmethod(self) -> 'dict[str, object]'Return C++-measured properties needed by simulation preprocessors.
topologyproperty-见成员签名。
validatemethod(self) -> 'OperationReport'Perform inexpensive, backend-neutral checks on a native shape.
volumeproperty-见成员签名。

行为与约束

  • Shape 值始终绑定到其所属 Session;Session 关闭后不得继续使用。
  • 实例是不可变 dataclass 值;更新式工作流会返回替代值。

导入检查

from cadflow import Shape

相关内容