跳到主要内容

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 未声明更窄的异常契约。类型、数值、所有权、路径或后端状态无效时,仍可能抛出相应公共异常。

公共成员

成员类型签名说明
applymethod(self, operation: 'str', *args: 'object', **kwargs: 'object') -> 'OperationResult'Invoke a named Model operation and return its result with a report.
arcmethod(self, start: 'Sequence[float]', middle: 'Sequence[float]', end: 'Sequence[float]') -> 'Shape'见成员签名。
bezier_surfacemethod(self, points: 'Sequence[Sequence[Sequence[float]]]', *, weights: 'Sequence[Sequence[float]] | None' = None) -> 'Shape'见成员签名。
boxmethod(self, width: 'float', depth: 'float', height: 'float') -> 'Shape'见成员签名。
bsplinemethod(self, control_points, *, degree, knots, multiplicities, weights=None, periodic=False) -> 'Shape'见成员签名。
capabilitiesmethod(self) -> 'dict[str, object]'Describe available operations without exposing private handles.
chamfermethod(self, shape: 'Shape', distance: 'float', edge_indices: 'Sequence[int] | None' = None, *, edges: 'Sequence[int] | None' = None) -> 'Shape'见成员签名。
circle_profilemethod(self, radius: 'float', center: 'tuple[float, float, float]' = (0, 0, 0), normal: 'tuple[float, float, float]' = (0, 0, 1)) -> 'Shape'见成员签名。
closemethod(self) -> 'None'见成员签名。
conemethod(self, radius1: 'float', radius2: 'float', height: 'float') -> 'Shape'见成员签名。
cutmethod(self, body: 'Shape', tool: 'Shape') -> 'Shape'见成员签名。
cylindermethod(self, radius: 'float', height: 'float') -> 'Shape'见成员签名。
distancemethod(self, left: 'Shape', right: 'Shape') -> 'float'见成员签名。
extrudemethod(self, profile: 'Shape', x: 'float', y: 'float', z: 'float') -> 'Shape'见成员签名。
facemethod(self, wire: 'Shape') -> 'Shape'见成员签名。
facesmethod(self, shape: 'Shape') -> 'tuple[Shape, ...]'Return deterministic zero-based OCCT face handles for a shape.
filletmethod(self, shape: 'Shape', radius: 'float', edge_indices: 'Sequence[int] | None' = None, *, edges: 'Sequence[int] | None' = None) -> 'Shape'见成员签名。
filling_surfacemethod(self, edges, *, tolerance: 'float' = 1e-06) -> 'Shape'见成员签名。
fit_surfacemethod(self, points: 'Sequence[Sequence[Sequence[float]]]', *, tolerance: 'float' = 0.001, degree_min: 'int' = 3, degree_max: 'int' = 8) -> 'Shape'见成员签名。
free_boundariesmethod(self, shape: 'Shape', *, tolerance: 'float' = 1e-06) -> 'tuple[Shape, ...]'见成员签名。
gordon_surfacemethod(self, profiles, guides, *, tolerance: 'float' = 1e-06) -> 'Shape'见成员签名。
helixmethod(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_brepmethod(self, path: 'str') -> 'Shape'见成员签名。
import_stepmethod(self, path: 'str') -> 'Shape'见成员签名。
import_stlmethod(self, path: 'str') -> 'Shape'见成员签名。
interpolatemethod(self, points: 'Sequence[Sequence[float]]', *, periodic: 'bool' = False, tolerance: 'float' = 1e-06) -> 'Shape'见成员签名。
intersectmethod(self, left: 'Shape', right: 'Shape') -> 'Shape'见成员签名。
loftmethod(self, profiles: 'Sequence[Shape]', *, solid: 'bool' = True, ruled: 'bool' = False) -> 'Shape'见成员签名。
mirrormethod(self, shape: 'Shape', normal: 'tuple[float, float, float]', origin: 'tuple[float, float, float]' = (0, 0, 0)) -> 'Shape'见成员签名。
polylinemethod(self, points: 'Sequence[Sequence[float]]', *, closed: 'bool' = False) -> 'Shape'见成员签名。
preflightmethod(self, operation: 'str', *args: 'object', **kwargs: 'object') -> 'OperationReport'Check common Agent mistakes before invoking a native operation.
revolvemethod(self, profile: 'Shape', degrees: 'float' = 360.0, axis: 'tuple[float, float, float]' = (0, 0, 1), origin: 'tuple[float, float, float]' = (0, 0, 0)) -> 'Shape'见成员签名。
rotatemethod(self, shape: 'Shape', degrees: 'float', axis: 'tuple[float, float, float]' = (0, 0, 1), origin: 'tuple[float, float, float]' = (0, 0, 0)) -> 'Shape'见成员签名。
ruled_surfacemethod(self, edge_a: 'Shape', edge_b: 'Shape') -> 'Shape'见成员签名。
scalemethod(self, shape: 'Shape', factor: 'float', center: 'tuple[float, float, float]' = (0, 0, 0)) -> 'Shape'见成员签名。
sewmethod(self, faces, *, tolerance: 'float' = 1e-06) -> 'Shape'见成员签名。
shellmethod(self, shape: 'Shape', thickness: 'float', face_indices: 'Sequence[int] | None' = None, *, tolerance: 'float' = 0.001, faces: 'Sequence[int] | None' = None) -> 'Shape'见成员签名。
shell_to_solidmethod(self, shell: 'Shape') -> 'Shape'见成员签名。
sketchmethod(self, name: 'str | None' = None, *, workplane: 'Workplane | None' = None)见成员签名。
spheremethod(self, radius: 'float') -> 'Shape'见成员签名。
subshapesmethod(self, shape: 'Shape', shape_type: 'int') -> 'tuple[Shape, ...]'见成员签名。
sweepmethod(self, profile: 'Shape', path: 'Shape', *, solid: 'bool' = True, frenet: 'bool' = False) -> 'Shape'见成员签名。
translatemethod(self, shape: 'Shape', x: 'float', y: 'float', z: 'float') -> 'Shape'见成员签名。
twisted_sweepmethod(self, profile: 'Shape', distance: 'float', twist_degrees: 'float', *, origin=(0, 0, 0), axis=(0, 0, 1), guide_radius=1.0) -> 'Shape'见成员签名。
unionmethod(self, left: 'Shape', right: 'Shape') -> 'Shape'见成员签名。
workplanemethod(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

相关内容