Python client API ​

Generated from packages/sketchforge-py/src/sketchforge3d/__init__.py by node scripts/docs/generate-package-references.mjs. Do not edit this file directly.

The exported names below are the supported import surface. Signatures and summaries are read from the installed package source; details and examples are in the Python package README.

ALIGN_AXES ​

Source

ALIGN_AXES = ('x', 'y', 'z')

ALIGN_TARGETS ​

Source

ALIGN_TARGETS = ('min', 'center', 'max')

API_ERROR_CODES ​

Source

Align(transport: 'Transport') -> 'None' ​

Source

Puts one edge or one centre of every named shape on the same coordinate.

AlignResult(moved: 'int', axis: 'str', target: 'str', anchor_id: 'Optional[str]', shapes: 'List[ShapeSummary]', revision: 'int') -> None ​

Source

What an alignment did.

BASE_URL_ENV ​

Source

BASE_URL_ENV = 'SKETCHFORGE_URL'

BakedMirrorResult(moved: 'int', axis: 'str', shapes: 'List[ShapeSummary]', revision: 'int') -> None ​

Source

Exact reflection of selected parameter-built solids across their shared bounds plane.

BooleanCutResult(shape: 'ShapeSummary', triangles: 'int', revision: 'int') -> None ​

Source

Booleans(transport: 'Transport') -> 'None' ​

Source

Subtracts one or more cutter shapes from one or more solids.

BoxShapeRequest ​

Source

python
class BoxShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['box']

ConeShapeRequest ​

Source

python
class ConeShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['cone']
    sides: int
    topRadius: float
    baseRadius: float

CubeShapeRequest ​

Source

python
class CubeShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['cube']

CylinderShapeRequest ​

Source

python
class CylinderShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['cylinder']
    sides: int

DEFAULT_BASE_URL ​

Source

DEFAULT_BASE_URL = 'http://127.0.0.1:3000'

DISTRIBUTE_SPACINGS ​

Source

DISTRIBUTE_SPACINGS = ('gaps', 'centers')

Distribute(transport: 'Transport') -> 'None' ​

Source

Spreads three or more shapes evenly along an axis.

DistributeResult(moved: 'int', axis: 'str', spacing: 'str', shapes: 'List[ShapeSummary]', revision: 'int') -> None ​

Source

What a distribution did, and along which axis it decided to work.

EXPORT_SECTION_PLANES ​

Source

EXPORT_SECTION_PLANES = ('xy', 'xz', 'yz')

EXPORT_VIEWS ​

Source

EXPORT_VIEWS = ('multiview', 'front', 'back', 'top', 'bottom', 'left', 'right', 'iso')

EdgeSummary(index: 'int', length: 'float', curve_type: 'str', midpoint: 'EdgeMidpoint', filletable: 'bool') -> None ​

Source

Edges(transport: 'Transport') -> 'None' ​

Source

Explosions(transport: 'Transport') -> 'None' ​

Source

Explodes an imported STEP assembly into its component solids.

ExportFormat ​

Source

ExportResult(format: 'ExportFormat', filename: 'str', mime_type: 'str', data: 'bytes', shape_count: 'int', exported_count: 'Optional[int]' = None, skipped: 'List[Dict[str, Any]]' = ...) -> None ​

Source

ExportSection ​

Source

python
class ExportSection:
    plane: Literal['xy', 'xz', 'yz']
    offset: float

ExportSectionPlane ​

Source

ExportView ​

Source

Exports(transport: 'Transport') -> 'None' ​

Source

Exports a server-stored project or selected shapes to a local file format.

FACE_DIRECTIONS ​

Source

FACE_DIRECTIONS = ('top', 'bottom', 'left', 'right', 'front', 'back')

FaceSummary(id: 'Optional[str]', index: 'int', surface_type: 'str', area: 'float', centroid: 'Vector3', normal: 'Optional[Vector3]', facing: 'Optional[str]') -> None ​

Source

Faces(transport: 'Transport') -> 'None' ​

Source

GearShapeRequest ​

Source

python
class GearShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['gear']
    teeth: int
    toothSize: float
    toothWidth: float
    centerHoleSize: float
    gearType: str
    helixAngle: float

Groups(transport: 'Transport') -> 'None' ​

Source

Groups shapes, including subtracting members marked as holes.

HalfSphereShapeRequest ​

Source

python
class HalfSphereShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['halfSphere']
    steps: int

IMPORTABLE_MESH_FORMATS ​

Source

IMPORTABLE_MESH_FORMATS = ('stl', 'obj', 'svg')

IcosahedronShapeRequest ​

Source

python
class IcosahedronShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['icosahedron']

Imports(transport: 'Transport') -> 'None' ​

Source

Adds the model a file describes, and keeps the file with the project.

InterferencePair(a: 'Mapping[str, str]', b: 'Mapping[str, str]', gap: 'float', overlap_volume: 'float', precision: "Literal['exact', 'tessellated']") -> None ​

Source

InterferenceReport(shapes_checked: 'int', candidate_pairs_checked: 'int', clearance: 'float', method: 'str', pairs: 'List[InterferencePair]') -> None ​

Source

ListPage(items: 'List[TPageItem]', next_cursor: 'Optional[str]') -> None ​

Source

LoftShapeRequest ​

Source

python
class LoftShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['loft']
    loftBottomShape: str
    loftTopShape: str
    loftTopWidth: float
    loftTopDepth: float
    loftBottomRotation: float
    loftTopRotation: float
    loftSegments: int
    loftLayers: int

MAX_PATTERN_COUNT ​

Source

MAX_PATTERN_COUNT = 200

MAX_SHAPES_PER_REQUEST ​

Source

MAX_SHAPES_PER_REQUEST = 200

MEASUREMENT_ANGLE_UNAVAILABLE_CODES ​

Source

MEASUREMENT_ANGLE_UNAVAILABLE_CODES = ('notPlanar', 'degenerateNormal')

MEASUREMENT_END_ENTITIES ​

Source

MEASUREMENT_END_ENTITIES = ('edge', 'face', 'shape')

MEASUREMENT_ENTITIES ​

Source

MEASUREMENT_ENTITIES = ('edge', 'face')

MEASUREMENT_RADIUS_UNAVAILABLE_CODES ​

Source

MEASUREMENT_RADIUS_UNAVAILABLE_CODES = ('notCircular', 'ellipseHasNoSingleRadius', 'degenerateCurve', 'notCurved', 'radiusVariesOverSurface', 'radiusNotReportedByKernel', 'degenerateSurface')

MEASUREMENT_UNAVAILABLE_CODES ​

Source

MEASUREMENT_UNAVAILABLE_CODES = ('notCircular', 'ellipseHasNoSingleRadius', 'degenerateCurve', 'notCurved', 'radiusVariesOverSurface', 'radiusNotReportedByKernel', 'degenerateSurface', 'notPlanar', 'degenerateNormal')

MIN_PATTERN_COUNT ​

Source

MIN_PATTERN_COUNT = 2

Macro(name: 'str', run: 'Callable[[MacroContext], Any]', project: 'Union[str, Sequence[str]]' = 'fresh', description: 'str' = '', params: 'Dict[str, MacroParameterValue]' = ...) -> None ​

Source

MacroContext(client: 'SketchForgeClient', project: 'ProjectHandle', params: 'Dict[str, MacroParameterValue]', layout: 'ModuleType', log: 'Callable[[str], None]') -> None ​

Source

MacroRunReport(macro: 'str', project_id: 'str', project_created: 'bool', shapes_cleared: 'int', shape_count: 'int', duration_ms: 'int', result: 'Any') -> None ​

Source

MeasurementPair(distance: 'float', angle_degrees: 'Optional[float]', angle_unavailable: 'Optional[str]') -> None ​

Source

MeasurementSummary(entity: 'str', index: 'int', geometry_type: 'str', length: 'Optional[float]', area: 'Optional[float]', radius: 'Optional[float]', diameter: 'Optional[float]', sweep_degrees: 'Optional[float]', radius_unavailable: 'Optional[str]') -> None ​

Source

One edge or face, measured from the exact B-rep rather than the mesh.

Measurements(transport: 'Transport') -> 'None' ​

Source

MeshImportResult(shape: 'ShapeSummary', triangles: 'int', revision: 'int') -> None ​

Source

TreatmentResult(shape: 'ShapeSummary', triangles: 'int', revision: 'int')

Mirrors(transport: 'Transport') -> 'None' ​

Source

Exact CAD mirror operations for parameter-built solids.

MissingConfigurationError ​

Source

The environment does not say how to reach the server.

PARAMETRIC_SHAPE_KINDS ​

Source

PARAMETRIC_SHAPE_KINDS = ('box', 'cube', 'cylinder', 'cone', 'sphere', 'halfSphere', 'torus', 'tube', 'ring', 'polygon', 'pyramid', 'roof', 'roundRoof', 'wedge', 'icosahedron', 'text', 'loft', 'gear')

PATTERN_KINDS ​

Source

PATTERN_KINDS = ('linear', 'circular')

PROJECT_ENV ​

Source

PROJECT_ENV = 'SKETCHFORGE_PROJECT_ID'

PROJECT_MODES ​

Source

PROJECT_MODES = ('fresh', 'replace', 'reuse', 'target')

Parts(transport: 'Transport') -> 'None' ​

Source

Separates a cut or grouped shape into its independent bodies.

PatternResult(created: 'int', kind: 'str', shapes: 'List[ShapeSummary]', revision: 'int') -> None ​

Source

The copies a pattern added. created excludes the original.

Patterns(transport: 'Transport') -> 'None' ​

Source

Repeats shapes in a row or around a ring, adding the copies.

Point2(x: 'float', z: 'float') -> None ​

Source

PolygonShapeRequest ​

Source

python
class PolygonShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['polygon']

ProjectDetail(id: 'str', name: 'str', created_at: 'int', snap_grid: 'Dict[str, Any]', workspace: 'Dict[str, Any]', shapes: 'List[ShapeSummary]') -> None ​

Source

ProjectHandle(client: 'SketchForgeClient', project_id: 'str') -> 'None' ​

Source

ProjectSummary(id: 'str', name: 'str', shapes: 'int', revision: 'int', updated_at: 'int', package_bytes: 'int') -> None ​

Source

Projects(transport: 'Transport') -> 'None' ​

Source

Properties(transport: 'Transport') -> 'None' ​

Source

PyramidShapeRequest ​

Source

python
class PyramidShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['pyramid']
    sides: int

REQUESTABLE_SHAPE_KINDS ​

Source

REQUESTABLE_SHAPE_KINDS = ('box', 'cube', 'cylinder', 'cone', 'sphere', 'halfSphere', 'torus', 'tube', 'ring', 'polygon', 'pyramid', 'roof', 'roundRoof', 'wedge', 'icosahedron', 'text', 'loft', 'gear', 'revolve', 'thread', 'sketchSweep')

RequestableShapeKind ​

Source

RevolveShapeRequest ​

Source

python
class RevolveShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['revolve']
    profile: Sequence[Sequence[float]]
    pitch: float
    turns: float
    startAngle: float
    sweepAngle: float
    sides: int
    quality: int
    coreRadius: float
    outline: Sequence[Sequence[float]]
    revolve: Mapping[str, Any]

RingShapeRequest ​

Source

python
class RingShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['ring']
    bevel: float

RoofShapeRequest ​

Source

python
class RoofShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['roof']

RoundRoofShapeRequest ​

Source

python
class RoundRoofShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['roundRoof']
    sides: int

SHAPE_DESCRIPTION_FIELDS ​

Source

SHAPE_DESCRIPTION_FIELDS = ('id', 'kind', 'requestKind', 'sketchOperation', 'groupedCount', 'stepAssembly', 'stepComponent')

SHAPE_KINDS ​

Source

SHAPE_KINDS = ('box', 'cube', 'cylinder', 'cone', 'sphere', 'halfSphere', 'torus', 'tube', 'ring', 'polygon', 'pyramid', 'roof', 'roundRoof', 'wedge', 'icosahedron', 'text', 'loft', 'gear', 'revolve', 'thread', 'sketchSweep')

SHAPE_PARAMETER_NAMES ​

Source

ShapeCollectionResult(shapes: 'List[ShapeSummary]', revision: 'int') -> None ​

Source

ShapeGeometryProvenance(source: "Literal['parametric', 'brep', 'mesh']", precision: "Literal['exact', 'tessellated']") -> None ​

Source

ShapeOperationResult(shape: 'ShapeSummary', revision: 'int') -> None ​

Source

ShapeProperties(volume: 'float', area: 'float', center_of_mass: 'Mapping[str, float]', bbox: 'Mapping[str, float]', is_valid: 'bool', provenance: 'ShapeGeometryProvenance') -> None ​

Source

ShapeSpec ​

Source

ShapeSummary(id: 'str', name: 'str', kind: 'str', color: 'str', hole: 'bool', locked: 'bool', hidden: 'bool', x: 'float', z: 'float', elevation: 'float', width: 'float', depth: 'float', height: 'float', rotation: 'float', rotation_x: 'float', rotation_z: 'float', request_kind: 'Optional[str]' = None, sketch_operation: 'Optional[str]' = None, sketch_source_id: 'Optional[str]' = None, sketch_profile: 'Optional[Dict[str, Any]]' = None, face_draft: 'Optional[Dict[str, Any]]' = None, parameters: 'Dict[str, Any]' = ..., revolve: 'Optional[Dict[str, Any]]' = None, profile: 'Optional[List[List[float]]]' = None, face_ids: 'List[str]' = ..., face_colors: 'Dict[str, str]' = ..., step_assembly: 'List[StepAssemblyNode]' = ..., step_component: 'Optional[StepComponent]' = None, extra: 'Dict[str, Any]' = ...) -> None ​

Source

A shape as the server reports it.

ShapeWriteResult(shapes: 'List[ShapeSummary]', revision: 'int') -> None ​

Source

Shapes(transport: 'Transport') -> 'None' ​

Source

Shell(transport: 'Transport') -> 'None' ​

Source

ShellResult(shape: 'ShapeSummary', triangles: 'int', revision: 'int') -> None ​

Source

TreatmentResult(shape: 'ShapeSummary', triangles: 'int', revision: 'int')

SketchForgeApiError(method: 'str', url: 'str', status: 'int', detail: 'Optional[str]' = None, body: 'Any' = None, code: 'Optional[str]' = None) -> 'None' ​

Source

The server answered, and refused.

SketchForgeClient(base_url: 'str', token: 'str', timeout: 'float' = 60.0, retry_on_busy: 'int' = 4, headers: 'Optional[Mapping[str, str]]' = None, opener: 'Optional[Any]' = None, expected_revision: 'Optional[Union[int, str]]' = None) -> 'None' ​

Source

SketchForgeError ​

Source

Anything this library raises on its own behalf.

SketchForgeTransportError(method: 'str', url: 'str', cause: 'BaseException') -> 'None' ​

Source

The request never reached the server, or never came back.

SketchSweepPoint ​

Source

python
class SketchSweepPoint:
    id: str
    x: float
    z: float
    sweepDepth: float
    sweepRole: Literal['section', 'spine']
    handleIn: Mapping[str, float]
    handleOut: Mapping[str, float]
    mode: Literal['corner', 'smooth', 'split']

SketchSweepProfile ​

Source

python
class SketchSweepProfile:
    points: Sequence[sketchforge3d.types.SketchSweepPoint]
    segments: Sequence[sketchforge3d.types.SketchSweepSegment]
    constraints: Sequence[Union[sketchforge3d.types.SketchFixedConstraint, sketchforge3d.types.SketchCoincidentConstraint, sketchforge3d.types.SketchAxisConstraint, sketchforge3d.types.SketchSegmentPairConstraint, sketchforge3d.types.SketchAngleConstraint, sketchforge3d.types.SketchSymmetryConstraint, sketchforge3d.types.SketchDistanceConstraint, sketchforge3d.types.SketchRadiusConstraint]]
    sweepFrames: Mapping[str, Any]

SketchSweepSegment ​

Source

python
class SketchSweepSegment:
    id: str
    startId: str
    endId: str
    kind: Literal['line', 'bezier', 'smooth']

SketchSweepShapeRequest ​

Source

python
class SketchSweepShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['sketchSweep']
    profile: SketchSweepProfile

SphereShapeRequest ​

Source

python
class SphereShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['sphere']
    steps: int

StepAssemblyNode(name: 'str', children: "List['StepAssemblyNode']" = ..., id: 'Optional[str]' = None) -> None ​

Source

A named STEP product and its nested component occurrences.

StepComponent(id: 'str', occurrence_id: 'str', path: 'List[StepAssemblyNode]') -> None ​

Source

STEP source occurrence identity and ancestry for an exploded solid.

THREAD_DESIGNATIONS ​

Source

THREAD_DESIGNATIONS = ('M2', 'M2.5', 'M3', 'M4', 'M5', 'M6', 'M8', 'M10', 'M12', 'M16', 'M20', '#4-40', '#6-32', '#8-32', '#10-24', '1/4-20', '5/16-18', '3/8-16', '1/2-13')

TOKEN_ENV ​

Source

TOKEN_ENV = 'SKETCHFORGE_API_TOKEN'

TextShapeRequest ​

Source

python
class TextShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['text']
    text: str
    font: str
    bevel: float
    segments: int

Thickness(transport: 'Transport') -> 'None' ​

Source

Samples opposing surfaces to estimate wall thickness.

ThreadShapeRequest ​

Source

python
class ThreadShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: str
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['thread']
    diameter: float
    length: float
    pitch: float
    turns: float
    clearance: float
    core: bool
    sides: int
    quality: int
    profile: Sequence[Sequence[float]]
    outline: Sequence[Sequence[float]]
    revolve: Mapping[str, Any]

TorusShapeRequest ​

Source

python
class TorusShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['torus']

TreatmentResult(shape: 'ShapeSummary', triangles: 'int', revision: 'int') -> None ​

Source

Treatments(transport: 'Transport') -> 'None' ​

Source

TubeShapeRequest ​

Source

python
class TubeShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['tube']
    bevel: float

Vector3(x: 'float', y: 'float', z: 'float') -> None ​

Source

WallThicknessEstimate(minimum: 'Optional[float]', unit: "Literal['mm']", method: "Literal['sampled-opposing-surface-distance']", samples_per_face: 'int', faces_checked: 'int') -> None ​

Source

Sampled opposing-surface distance, not a certified minimum thickness.

WedgeShapeRequest ​

Source

python
class WedgeShapeRequest:
    name: str
    color: str
    x: float
    z: float
    elevation: float
    width: float
    depth: float
    height: float
    size: float
    rotation: float
    rotationX: float
    rotationZ: float
    hole: bool
    taperTopWidth: float
    taperTopDepth: float
    taperBottomWidth: float
    taperBottomDepth: float
    kind: Literal['wedge']

angle_of(point: 'Point2', center: 'Optional[Point2]' = None) -> 'float' ​

Source

The position's angle in degrees, the way ring measures one.

centered_offsets(count: 'int', spacing: 'float') -> 'List[float]' ​

Source

chunk(items: 'Sequence[Any]', size: 'int') -> 'List[List[Any]]' ​

Source

Splits into runs of at most size.

client_from_environment(environment: 'Optional[Mapping[str, str]]' = None, **overrides: 'Any') -> 'SketchForgeClient' ​

Source

define_macro(name: 'str', run: 'Callable[[MacroContext], Any]', project: 'Union[str, Sequence[str]]' = 'fresh', description: 'str' = '', params: 'Optional[Mapping[str, MacroParameterValue]]' = None) -> 'Macro' ​

Source

describe_macro_file(path: 'str') -> 'Dict[str, Any]' ​

Source

Read a macro's literal metadata without importing or executing its code.

grid(columns: 'int', rows: 'int', spacing_x: 'float', spacing_z: 'float', center: 'Point2' = Point2(x=0.0, z=0.0)) -> 'List[Point2]' ​

Source

A columns by rows grid, centred, with its own pitch in each direction.

layout ​

Source

load_macro_file(path: 'str') -> 'Macro' ​

Source

Imports a macro file by path, under its own module name.

mm(value: 'float', places: 'int' = 4) -> 'float' ​

Source

Rounded, so a computed position reads as a number rather than a float.

resolve_macro_params(defaults: 'Mapping[str, MacroParameterValue]', overrides: 'Mapping[str, str]') -> 'Dict[str, MacroParameterValue]' ​

Source

A macro's parameters, with overrides coerced to the type of each default.

resolve_macro_project(client: 'SketchForgeClient', macro: 'Macro', target_project_id: 'Optional[str]' = None, now: 'Optional[_datetime.datetime]' = None) -> 'ResolvedProject' ​

Source

The project a macro runs in, per its declared mode.

ring(count: 'int', radius: 'float', center: 'Point2' = Point2(x=0.0, z=0.0), start_angle: 'float' = 0.0) -> 'List[Point2]' ​

Source

count positions evenly spaced on a circle of radius.

row(count: 'int', spacing: 'float', center: 'Point2' = Point2(x=0.0, z=0.0)) -> 'List[Point2]' ​

Source

count positions spacing apart, centred on center.

run_macro(client: 'SketchForgeClient', macro: 'Macro', params: 'Optional[Mapping[str, str]]' = None, target_project_id: 'Optional[str]' = None, log: 'Optional[Callable[[str], None]]' = None, now: 'Optional[_datetime.datetime]' = None) -> 'MacroRunReport' ​

Source

Runs a macro and reports what it did to the project, as the CLI prints it.

run_stamp(now: 'Optional[_datetime.datetime]' = None) -> 'str' ​

Source

A stamp that sorts chronologically and survives a project name: 20260102-114530.

target_project_from_environment(environment: 'Optional[Mapping[str, str]]' = None) -> 'Optional[str]' ​

Source

The project an operator named for a target macro, if any.


Documentation version: 1.30.0 · Repository revision: 1cb9fee8dff4d394684c229dd67a21da539d167f · View source