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
| Name | Type | Required | Default | Source description |
|---|---|---|---|---|
curves | 'Iterable[Edge | Wire] | None' | no | None | Not explicitly described in the source docstring. |
name | 'Optional[str]' | no | None | Not explicitly described in the source docstring. |
plane | 'Any' | no | 'XY' | Not explicitly described in the source docstring. |
sketch_id | 'Optional[str]' | no | None | Not 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
| Member | Kind | Signature | Description |
|---|---|---|---|
add_arc | method | (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_bspline | method | (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_circle | method | (self, entity_id: 'str', center: 'SketchRef', radius: 'ScalarLike', *, construction: 'bool' = False) -> "'Sketch'" | See the member signature. |
add_constraint | method | (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_curve | method | (self, curve: 'Edge | Wire') -> "'Sketch'" | See the member signature. |
add_line | method | (self, entity_id: 'str', start: 'SketchRef', end: 'SketchRef', *, construction: 'bool' = False) -> "'Sketch'" | See the member signature. |
add_point | method | (self, point_id: 'str', x: 'ScalarLike', y: 'ScalarLike') -> 'SketchRef' | See the member signature. |
clone | method | (self, *, include_solve: 'bool' = True) -> "'Sketch'" | See the member signature. |
closed_wires | method | (self) -> 'List[Wire]' | See the member signature. |
curves | method | (self) -> 'List[Edge | Wire]' | See the member signature. |
from_dict | class method | (cls, data: 'Mapping[str, Any]') -> "'Sketch'" | See the member signature. |
make_face | method | (self, profile: 'int | str' = 0, *, inner_profiles: 'Sequence[int | str]' = (), solve_result: 'Optional[SketchSolveResult]' = None) -> 'Face' | See the member signature. |
make_wire | method | (self, profile: 'int | str' = 0, *, solve_result: 'Optional[SketchSolveResult]' = None) -> 'Wire' | See the member signature. |
point_ref | method | (self, path: 'str') -> 'SketchRef' | See the member signature. |
ref | method | (self, entity_id: 'str', *, kind: 'Optional[str]' = None, subentity: 'str' = 'geometry') -> 'SketchRef' | See the member signature. |
resolve_point_id | method | (self, ref: 'SketchRef') -> 'str' | See the member signature. |
resolve_target | method | (self, target: 'Union[SketchRef, str]', *, expected: 'Optional[Union[str, Sequence[str]]]' = None) -> 'SketchRef' | See the member signature. |
solve | method | (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_result | method | (self) -> 'SketchSolveResult' | See the member signature. |
to_dict | method | (self) -> 'Dict[str, Any]' | See the member signature. |
to_face | method | (self, profile: 'int | str' = 0, *, inner_profiles: 'Sequence[int | str]' = ()) -> 'Face' | See the member signature. |
to_faces | method | (self) -> 'List[Face]' | See the member signature. |
validate_ref | method | (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