Part
类型: 类
领域: 装配
推荐导入: from cadflow import Part
签名
class Part(part_id: 'str', body: 'Solid', name: 'Optional[str]' = None, material: 'Optional[Material]' = None, connectors: 'Tuple[Connector, ...]' = (), _metadata: 'Dict[str, Any]' = <factory>, _runtime: 'Dict[str, Any]' = <factory>) -> None
功能说明
Part 是 CadFlow 装配领域的公共类。
原始 API 说明
Single-body product item wrapping exactly one Solid.
其他公共导入路径
from cadflow.assembly import Part
参数
| 名称 | 类型 | 必需 | 默认值 | 源码说明 |
|---|---|---|---|---|
part_id | 'str' | 是 | - | 源码 Docstring 未单独说明。 |
body | 'Solid' | 是 | - | 源码 Docstring 未单独说明。 |
name | 'Optional[str]' | 否 | None | 源码 Docstring 未单独说明。 |
material | 'Optional[Material]' | 否 | None | 源码 Docstring 未单独说明。 |
connectors | 'Tuple[Connector, ...]' | 否 | () | 源码 Docstring 未单独说明。 |
_metadata | 'Dict[str, Any]' | 否 | <factory> | 源码 Docstring 未单独说明。 |
_runtime | 'Dict[str, Any]' | 否 | <factory> | 源码 Docstring 未单独说明。 |
返回值
类型: None
源码 Docstring 未声明更多返回语义。
异常
源码 Docstring 未声明更窄的异常契约。类型、数值、所有权、路径或后端状态无效时,仍可能抛出相应公共异常。
数据字段
| 名称 | 类型 | 默认值 |
|---|---|---|
part_id | 'str' | required |
body | 'Solid' | required |
name | 'Optional[str]' | None |
material | 'Optional[Material]' | None |
connectors | 'Tuple[Connector, ...]' | () |
_metadata | 'Dict[str, Any]' | factory |
_runtime | 'Dict[str, Any]' | factory |
公共成员
| 成员 | 类型 | 签名 | 说明 |
|---|---|---|---|
connector_ids | method | (self) -> 'Tuple[str, ...]' | 见成员签名。 |
get_connector | method | (self, connector_id: 'str') -> 'Connector' | 见成员签名。 |
to_dict | method | (self) -> 'Dict[str, Any]' | 见成员签名。 |
with_connector | method | (self, connector: 'Connector') -> "'Part'" | 见成员签名。 |
with_material | method | (self, material: 'Material') -> "'Part'" | 见成员签名。 |
行为与约束
- 实例是不可变 dataclass 值;更新式工作流会返回替代值。
导入检查
from cadflow import Part