Skip to main content

Sketch

Kind: Class
Domain: Sketch
Canonical import: from cadflow import Sketch

Signature

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

Description

Declarative constrained sketch container.

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.

Parameters

NameTypeRequiredDefaultSource description
curves'Iterable[Edge | Wire] | None'noNoneNot explicitly described in the source docstring.
name'Optional[str]'noNoneNot explicitly described in the source docstring.
plane'Any'no'XY'Not explicitly described in the source docstring.
sketch_id'Optional[str]'noNoneNot explicitly described in the source docstring.

Returns

Type: 'None'

The source docstring does not declare additional return semantics.

Errors

The source docstring does not declare a narrower exception contract. Invalid types, values, ownership, paths, or backend state may still raise the corresponding public error.

Public members

MemberKindSignatureDescription
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'"See the member signature.
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'"See the member signature.
add_curvemethod(self, curve: 'Edge | Wire') -> "'Sketch'"See the member signature.
add_linemethod(self, entity_id: 'str', start: 'SketchRef', end: 'SketchRef', *, construction: 'bool' = False) -> "'Sketch'"See the member signature.
add_pointmethod(self, point_id: 'str', x: 'ScalarLike', y: 'ScalarLike') -> 'SketchRef'See the member signature.
clonemethod(self, *, include_solve: 'bool' = True) -> "'Sketch'"See the member signature.
closed_wiresmethod(self) -> 'List[Wire]'See the member signature.
curvesmethod(self) -> 'List[Edge | Wire]'See the member signature.
from_dictclass method(cls, data: 'Mapping[str, Any]') -> "'Sketch'"See the member signature.
make_facemethod(self, profile: 'int | str' = 0, *, inner_profiles: 'Sequence[int | str]' = (), solve_result: 'Optional[SketchSolveResult]' = None) -> 'Face'See the member signature.
make_wiremethod(self, profile: 'int | str' = 0, *, solve_result: 'Optional[SketchSolveResult]' = None) -> 'Wire'See the member signature.
point_refmethod(self, path: 'str') -> 'SketchRef'See the member signature.
refmethod(self, entity_id: 'str', *, kind: 'Optional[str]' = None, subentity: 'str' = 'geometry') -> 'SketchRef'See the member signature.
resolve_point_idmethod(self, ref: 'SketchRef') -> 'str'See the member signature.
resolve_targetmethod(self, target: 'Union[SketchRef, str]', *, expected: 'Optional[Union[str, Sequence[str]]]' = None) -> 'SketchRef'See the member signature.
solvemethod(self, *, require_fully_constrained: 'bool' = False, strict: 'bool' = True, tolerance: 'float' = 1e-07, max_iterations: 'int' = 80, backend: 'Any' = None) -> 'SketchSolveResult'See the member signature.
solved_resultmethod(self) -> 'SketchSolveResult'See the member signature.
to_dictmethod(self) -> 'Dict[str, Any]'See the member signature.
to_facemethod(self, profile: 'int | str' = 0, *, inner_profiles: 'Sequence[int | str]' = ()) -> 'Face'See the member signature.
to_facesmethod(self) -> 'List[Face]'See the member signature.
validate_refmethod(self, ref: 'SketchRef') -> 'None'See the member signature.

Behavior and constraints

  • The contract below is generated from the current public runtime signature. Check domain notes for ownership and workflow constraints.

Import check

from cadflow import Sketch

See also