Skip to content

Python package

ra.solid

Solid modelling helpers: caps, shells, sweeps, offsets.

import rhinoartisan as ra

Wraps ArtisanPlugin.Scripting.SolidApi.

Functions

Function
cap_round()Rounded (domed) cap over a closed planar curve (the ArtisanCapRound command): a RoundCapCustomObject linked to the curve, on the metal layer with the metal material.
curve_shell()Hollow shell (a wall + a floor) built from one or more closed planar curves (the ArtisanCurveShell command): one CurveShellCustomObject per curve on the metal layer with the metal material.
cut()Cuts solids with planar closed curves (the ArtisanCut command): each curve is extruded through the solids (twice the bounding-box diagonal, centred on the curve plane) and subtracted.
recess()Recess (default) or protrusion of the region a closed curve marks on a solid’s face (the ArtisanRecess command): the curve is pulled onto the face, the face is split and the inner piece is offset height mm (default 0.5) and subtracted (recess) or united (protrusion).
sweep_one_rail()Orients profile curves along one rail and sweeps them (the ArtisanCurves1Rail command).
sweep_two_rails()Orients profile curves between two rails and sweeps them (the ArtisanCurves2Rails command).

ra.solid.cap_round()

ra.solid.cap_round(curve_id: IdLike, height=None, flip=None) -> str

Rounded (domed) cap over a closed planar curve (the ArtisanCapRound command): a RoundCapCustomObject linked to the curve, on the metal layer with the metal material. height 0 = the user’s saved default or 5 mm; flip None = saved default (False = along the curve normal). Returns the id of the cap object.

ParameterType
curve_idIdLikerequired
heightfloatoptional — None = the tool default
flipOptional[bool]optional — None = the tool default

ra.solid.curve_shell()

ra.solid.curve_shell(curve_ids: Sequence[IdLike], height=None, width_thickness=None, height_thickness=None, profile=None, flip=None) -> List[str]

Hollow shell (a wall + a floor) built from one or more closed planar curves (the ArtisanCurveShell command): one CurveShellCustomObject per curve on the metal layer with the metal material. 0 = the user’s saved default or the tool default: height 3, width_thickness 1 (wall), height_thickness 2 (floor; must be < height). profile ROUND | SHARP (offset corners); flip None = saved default. Returns the new ids.

ParameterType
curve_idsSequence[IdLike]required
heightfloatoptional — None = the tool default
width_thicknessfloatoptional — None = the tool default
height_thicknessfloatoptional — None = the tool default
profilestroptional — None = the tool default
flipOptional[bool]optional — None = the tool default

ra.solid.cut()

ra.solid.cut(solid_ids: Sequence[IdLike], curve_ids: Sequence[IdLike]) -> List[str]

Cuts solids with planar closed curves (the ArtisanCut command): each curve is extruded through the solids (twice the bounding-box diagonal, centred on the curve plane) and subtracted. The originals are replaced by the results, which keep their layer / material. Returns the ids of the resulting breps.

ParameterType
solid_idsSequence[IdLike]required
curve_idsSequence[IdLike]required

ra.solid.recess()

ra.solid.recess(curve_id: IdLike, solid_id: IdLike, height=None, protrusion=None, face_index=None) -> List[str]

Recess (default) or protrusion of the region a closed curve marks on a solid’s face (the ArtisanRecess command): the curve is pulled onto the face, the face is split and the inner piece is offset height mm (default 0.5) and subtracted (recess) or united (protrusion). face_index -1 = the face closest to the curve. The original is replaced by the result (same layer / material). Returns the new ids.

ParameterType
curve_idIdLikerequired
solid_idIdLikerequired
heightfloatoptional — None = the tool default
protrusionbooloptional — None = the tool default
face_indexintoptional — None = the tool default

ra.solid.sweep_one_rail()

ra.solid.sweep_one_rail(rail_id: IdLike, profile_ids: Sequence[IdLike], mode=None, thickness=None, flip=None, sweep=None, positions=None) -> SweepResult

Orients profile curves along one rail and sweeps them (the ArtisanCurves1Rail command). Profiles are drawn flat on World XY (base = bottom of their bounding box) and distributed evenly from the rail start, or at positions (normalized 0..1, one per profile). mode OPEN | CLOSE (chord) | COMFORT (curved inner) | THICKNESS (inner offset by thickness, NaN = 0.6 mm; negative allowed). flip mirrors the profiles across the rail; sweep False = only the oriented curves. Returns the ids of the swept breps and of the baked curves.

ParameterType
rail_idIdLikerequired
profile_idsSequence[IdLike]required
modestroptional — None = the tool default
thicknessfloatoptional — None = the tool default
flipbooloptional — None = the tool default
sweepbooloptional — None = the tool default
positionsSequence[float]optional — None = the tool default

ra.solid.sweep_two_rails()

ra.solid.sweep_two_rails(rail1_id: IdLike, rail2_id: IdLike, profile_ids: Sequence[IdLike], mode=None, thickness=None, keep_proportion=None, sweep=None, positions=None) -> SweepResult

Orients profile curves between two rails and sweeps them (the ArtisanCurves2Rails command). Each profile’s endpoints land on rail 1 and rail 2 (start->end), scaled to the distance between the rails: keep_proportion False = uniform scale, True = the height is kept. Profiles spread evenly along rail 1 (rail 2 by closest point) or at positions (normalized 0..1 on rail 1). mode / thickness / sweep as in SweepOneRail. Returns the swept brep ids and the baked curve ids.

ParameterType
rail1_idIdLikerequired
rail2_idIdLikerequired
profile_idsSequence[IdLike]required
modestroptional — None = the tool default
thicknessfloatoptional — None = the tool default
keep_proportionbooloptional — None = the tool default
sweepbooloptional — None = the tool default
positionsSequence[float]optional — None = the tool default