跳到主要内容

Sketch

类型:
领域: 草图
推荐导入: from cadflow import Sketch

签名

class Sketch(curves: 'Iterable[Edge | Wire] | None' = None, *, name: 'Optional[str]' = None, plane: 'Any' = 'XY', sketch_id: 'Optional[str]' = None) -> 'None'

功能说明

Sketch 是 CadFlow 草图领域的公共类。

原始 API 说明

Declarative constrained sketch container.

Use make_sketch_rsketch(...), add_point_rsketch(...), add_line_rsketch(...), add_circle_rsketch(...), and constrain_*_rsketch(...) as the canonical API for building sketch profiles. Public sketch construction APIs are functional and return an updated Sketch document. The legacy curves constructor remains only for reading already-built wire/edge containers.

参数

名称类型必需默认值源码说明
curves'Iterable[Edge | Wire] | None'None源码 Docstring 未单独说明。
name'Optional[str]'None源码 Docstring 未单独说明。
plane'Any''XY'源码 Docstring 未单独说明。
sketch_id'Optional[str]'None源码 Docstring 未单独说明。

返回值

类型: 'None'

源码 Docstring 未声明更多返回语义。

异常

源码 Docstring 未声明更窄的异常契约。类型、数值、所有权、路径或后端状态无效时,仍可能抛出相应公共异常。

公共成员

成员类型签名说明
add_arcmethod(self, entity_id: 'str', start: 'SketchRef', end: 'SketchRef', center: 'SketchRef', *, construction: 'bool' = False) -> "'Sketch'"Add an arc edge defined by start point, end point, and center point.
add_bsplinemethod(self, entity_id: 'str', start: 'SketchRef', end: 'SketchRef', control_points: 'Sequence[Any]', degree: 'int' = 3, knots: 'Optional[Sequence[float]]' = None, multiplicities: 'Optional[Sequence[int]]' = None, weights: 'Optional[Sequence[float]]' = None, periodic: 'bool' = False, *, construction: 'bool' = False) -> "'Sketch'"Add a B-spline whose poles participate in sketch solving.
add_circlemethod(self, entity_id: 'str', center: 'SketchRef', radius: 'ScalarLike', *, construction: 'bool' = False) -> "'Sketch'"见成员签名。
add_constraintmethod(self, kind: 'str', targets: 'Sequence[SketchRef]', *, value: 'Any' = None, constraint_id: 'Optional[str]' = None, driving: 'bool' = True, metadata: 'Optional[Dict[str, Any]]' = None) -> "'Sketch'"见成员签名。
add_curvemethod(self, curve: 'Edge | Wire') -> "'Sketch'"见成员签名。
add_linemethod(self, entity_id: 'str', start: 'SketchRef', end: 'SketchRef', *, construction: 'bool' = False) -> "'Sketch'"见成员签名。
add_pointmethod(self, point_id: 'str', x: 'ScalarLike', y: 'ScalarLike') -> 'SketchRef'见成员签名。
clonemethod(self, *, include_solve: 'bool' = True) -> "'Sketch'"见成员签名。
closed_wiresmethod(self) -> 'List[Wire]'见成员签名。
curvesmethod(self) -> 'List[Edge | Wire]'见成员签名。
from_dictclass method(cls, data: 'Mapping[str, Any]') -> "'Sketch'"见成员签名。
make_facemethod(self, profile: 'int | str' = 0, *, inner_profiles: 'Sequence[int | str]' = (), solve_result: 'Optional[SketchSolveResult]' = None) -> 'Face'见成员签名。
make_wiremethod(self, profile: 'int | str' = 0, *, solve_result: 'Optional[SketchSolveResult]' = None) -> 'Wire'见成员签名。
point_refmethod(self, path: 'str') -> 'SketchRef'见成员签名。
refmethod(self, entity_id: 'str', *, kind: 'Optional[str]' = None, subentity: 'str' = 'geometry') -> 'SketchRef'见成员签名。
resolve_point_idmethod(self, ref: 'SketchRef') -> 'str'见成员签名。
resolve_targetmethod(self, target: 'Union[SketchRef, str]', *, expected: 'Optional[Union[str, Sequence[str]]]' = None) -> 'SketchRef'见成员签名。
solvemethod(self, *, require_fully_constrained: 'bool' = False, strict: 'bool' = True, tolerance: 'float' = 1e-07, max_iterations: 'int' = 80, backend: 'Any' = None) -> 'SketchSolveResult'见成员签名。
solved_resultmethod(self) -> 'SketchSolveResult'见成员签名。
to_dictmethod(self) -> 'Dict[str, Any]'见成员签名。
to_facemethod(self, profile: 'int | str' = 0, *, inner_profiles: 'Sequence[int | str]' = ()) -> 'Face'见成员签名。
to_facesmethod(self) -> 'List[Face]'见成员签名。
validate_refmethod(self, ref: 'SketchRef') -> 'None'见成员签名。

行为与约束

  • 以下契约由当前公共运行时签名生成;所有权与工作流限制见对应领域说明。

导入检查

from cadflow import Sketch

相关内容