Model
类型: 类
领域: 核心运行时
推荐导入: from cadflow import Model
签名
class Model(session: 'NativeSession | None' = None) -> 'None'
功能说明
拥有原生 Session,并提供构造、变换、检查和导出 Shape 的现代入口。
原始 API 说明
Explicit-session frontend analogous to a small CAD model context.
参数
| 名称 | 类型 | 必需 | 默认值 | 源码说明 |
|---|---|---|---|---|
session | 'NativeSession | None' | 否 | None | 源码 Docstring 未单独说明。 |
返回值
类型: 'None'
源码 Docstring 未声明更多返回语义。
异常
源码 Docstring 未声明更窄的异常契约。类型、数值、所有权、路径或后端状态无效时,仍可能抛出相应公共异常。
公共成员
| 成员 | 类型 | 签名 | 说明 |
|---|---|---|---|
apply | method | (self, operation: 'str', *args: 'object', **kwargs: 'object') -> 'OperationResult' | Invoke a named Model operation and return its result with a report. |
arc | method | (self, start: 'Sequence[float]', middle: 'Sequence[float]', end: 'Sequence[float]') -> 'Shape' | 见成员签名。 |
bezier_surface | method | (self, points: 'Sequence[Sequence[Sequence[float]]]', *, weights: 'Sequence[Sequence[float]] | None' = None) -> 'Shape' | 见成员签名。 |
box | method | (self, width: 'float', depth: 'float', height: 'float') -> 'Shape' | 见成员签名。 |
bspline | method | (self, control_points, *, degree, knots, multiplicities, weights=None, periodic=False) -> 'Shape' | 见成员签名。 |
capabilities | method | (self) -> 'dict[str, object]' | Describe available operations without exposing private handles. |
chamfer | method | (self, shape: 'Shape', distance: 'float', edge_indices: 'Sequence[int] | None' = None, *, edges: 'Sequence[int] | None' = None) -> 'Shape' | 见成员签名。 |
circle_profile | method | (self, radius: 'float', center: 'tuple[float, float, float]' = (0, 0, 0), normal: 'tuple[float, float, float]' = (0, 0, 1)) -> 'Shape' | 见成员签名。 |
close | method | (self) -> 'None' | 见成员签名。 |
cone | method | (self, radius1: 'float', radius2: 'float', height: 'float') -> 'Shape' | 见成员签名。 |
cut | method | (self, body: 'Shape', tool: 'Shape') -> 'Shape' | 见成员签名。 |
cylinder | method | (self, radius: 'float', height: 'float') -> 'Shape' | 见成员签名。 |
distance | method | (self, left: 'Shape', right: 'Shape') -> 'float' | 见成员签名。 |
extrude | method | (self, profile: 'Shape', x: 'float', y: 'float', z: 'float') -> 'Shape' | 见成员签名。 |
face | method | (self, wire: 'Shape') -> 'Shape' | 见成员签名。 |
faces | method | (self, shape: 'Shape') -> 'tuple[Shape, ...]' | Return deterministic zero-based OCCT face handles for a shape. |
fillet | method | (self, shape: 'Shape', radius: 'float', edge_indices: 'Sequence[int] | None' = None, *, edges: 'Sequence[int] | None' = None) -> 'Shape' | 见成员签名。 |
filling_surface | method | (self, edges, *, tolerance: 'float' = 1e-06) -> 'Shape' | 见成员签名。 |
fit_surface | method | (self, points: 'Sequence[Sequence[Sequence[float]]]', *, tolerance: 'float' = 0.001, degree_min: 'int' = 3, degree_max: 'int' = 8) -> 'Shape' | 见成员签名。 |
free_boundaries | method | (self, shape: 'Shape', *, tolerance: 'float' = 1e-06) -> 'tuple[Shape, ...]' | 见成员签名。 |
gordon_surface | method | (self, profiles, guides, *, tolerance: 'float' = 1e-06) -> 'Shape' | 见成员签名。 |
helix | method | (self, pitch: 'float', height: 'float', radius: 'float', center: 'tuple[float, float, float]' = (0, 0, 0), direction: 'tuple[float, float, float]' = (0, 0, 1)) -> 'Shape' | 见成员签名。 |
import_brep | method | (self, path: 'str') -> 'Shape' | 见成员签名。 |
import_step | method | (self, path: 'str') -> 'Shape' | 见成员签名。 |
import_stl | method | (self, path: 'str') -> 'Shape' | 见成员签名。 |
interpolate | method | (self, points: 'Sequence[Sequence[float]]', *, periodic: 'bool' = False, tolerance: 'float' = 1e-06) -> 'Shape' | 见成员签名。 |
intersect | method | (self, left: 'Shape', right: 'Shape') -> 'Shape' | 见成员签名。 |
loft | method | (self, profiles: 'Sequence[Shape]', *, solid: 'bool' = True, ruled: 'bool' = False) -> 'Shape' | 见成员签名。 |
mirror | method | (self, shape: 'Shape', normal: 'tuple[float, float, float]', origin: 'tuple[float, float, float]' = (0, 0, 0)) -> 'Shape' | 见成员签名。 |
polyline | method | (self, points: 'Sequence[Sequence[float]]', *, closed: 'bool' = False) -> 'Shape' | 见成员签名。 |
preflight | method | (self, operation: 'str', *args: 'object', **kwargs: 'object') -> 'OperationReport' | Check common Agent mistakes before invoking a native operation. |
revolve | method | (self, profile: 'Shape', degrees: 'float' = 360.0, axis: 'tuple[float, float, float]' = (0, 0, 1), origin: 'tuple[float, float, float]' = (0, 0, 0)) -> 'Shape' | 见成员签名。 |
rotate | method | (self, shape: 'Shape', degrees: 'float', axis: 'tuple[float, float, float]' = (0, 0, 1), origin: 'tuple[float, float, float]' = (0, 0, 0)) -> 'Shape' | 见成员签名。 |
ruled_surface | method | (self, edge_a: 'Shape', edge_b: 'Shape') -> 'Shape' | 见成员签名。 |
scale | method | (self, shape: 'Shape', factor: 'float', center: 'tuple[float, float, float]' = (0, 0, 0)) -> 'Shape' | 见成员签名。 |
sew | method | (self, faces, *, tolerance: 'float' = 1e-06) -> 'Shape' | 见成员签名。 |
shell | method | (self, shape: 'Shape', thickness: 'float', face_indices: 'Sequence[int] | None' = None, *, tolerance: 'float' = 0.001, faces: 'Sequence[int] | None' = None) -> 'Shape' | 见成员签名。 |
shell_to_solid | method | (self, shell: 'Shape') -> 'Shape' | 见成员签名。 |
sketch | method | (self, name: 'str | None' = None, *, workplane: 'Workplane | None' = None) | 见成员签名。 |
sphere | method | (self, radius: 'float') -> 'Shape' | 见成员签名。 |
subshapes | method | (self, shape: 'Shape', shape_type: 'int') -> 'tuple[Shape, ...]' | 见成员签名。 |
sweep | method | (self, profile: 'Shape', path: 'Shape', *, solid: 'bool' = True, frenet: 'bool' = False) -> 'Shape' | 见成员签名。 |
translate | method | (self, shape: 'Shape', x: 'float', y: 'float', z: 'float') -> 'Shape' | 见成员签名。 |
twisted_sweep | method | (self, profile: 'Shape', distance: 'float', twist_degrees: 'float', *, origin=(0, 0, 0), axis=(0, 0, 1), guide_radius=1.0) -> 'Shape' | 见成员签名。 |
union | method | (self, left: 'Shape', right: 'Shape') -> 'Shape' | 见成员签名。 |
workplane | method | (self, origin: 'Sequence[float]' = (0, 0, 0), normal: 'Sequence[float]' = (0, 0, 1), x_dir: 'Sequence[float]' = (1, 0, 0)) -> 'Workplane' | 见成员签名。 |
行为与约束
- Shape 值始终绑定到其所属 Session;Session 关闭后不得继续使用。
导入检查
from cadflow import Model