Python package
ra.curve
Curve helpers for jewelry layouts.
import rhinoartisan as ra
Wraps ArtisanPlugin.Scripting.CurveApi.
Functions
| Function | |
|---|---|
add_sketches() | Replicates the ArtisanAddSketches panel’s Accept: places reference sketch images on the faces of a 10 x 10 x 10 mm box at the origin — two textured surfaces per image (top: z=0 and z=10; front: y=0 and y=10; side: x=0 and x=10, the far one mirrored), rendered display mode, all in one group. |
advanced() | Replicates ArtisanAdvancedCurve: a degree-3 control-point curve through points, mirrored by symmetry (NONE | X | Y | XY — the “Quad” option), optionally closed, plus an offset copy with connecting lines when offset != 0 (default 1 mm; NaN/omitted = default, 0 = no offset). |
auto_join() | Replicates ArtisanAutoJoin: joins the open, visible curves of the document whose ends touch (document tolerance), like running _Join on all of them. |
connect() | Replicates ArtisanCurveConnect: an arc blend leaving first_id at the point of its surface closest to first_point (along the normal) and arriving at second_id near second_point against its normal. |
cross() | Replicates the ArtisanCrossBuilder panel’s Accept: a closed cross outline centred at the world origin (the panel does the same), stored as a parametric CrossCustomObject on the primary user layer. |
infinite() | Replicates ArtisanInfiniteCurve: a very long line (type LINE, centred on base_point) or ray (RAY, starting at base_point) used as a construction reference. |
infinite_loop() | Replicates ArtisanInfiniteLoopCurve: a closed lemniscate (“infinity symbol”) interpolated through sampled points, centred at center. |
iso_curves() | Replicates ArtisanIsoCurve: extracts the isocurve(s) of surface_id (a surface or single-face solid) passing through the point of the surface closest to point. |
waves() | Replicates ArtisanWaves: a smooth wave (waves full periods, default 3, peak-to-peak height mm, default 3) flowed along curve_id from its start to its end. |
ra.curve.add_sketches()
ra.curve.add_sketches(top_image_path=None, front_image_path=None, side_image_path=None) -> List[str]
Replicates the ArtisanAddSketches panel’s Accept: places reference sketch images on the faces of a 10 x 10 x 10 mm box at the origin — two textured surfaces per image (top: z=0 and z=10; front: y=0 and y=10; side: x=0 and x=10, the far one mirrored), rendered display mode, all in one group. Give at least one image path (PNG/JPG). Returns the ids of the surfaces added.
| Parameter | Type | |
|---|---|---|
top_image_path | str | optional — None = the tool default |
front_image_path | str | optional — None = the tool default |
side_image_path | str | optional — None = the tool default |
ra.curve.advanced()
ra.curve.advanced(points: Sequence[PointLike], sharp_indices=None, symmetry=None, close=None, offset=None, plane=None) -> List[str]
Replicates ArtisanAdvancedCurve: a degree-3 control-point curve through points, mirrored by symmetry (NONE | X | Y | XY — the “Quad” option), optionally closed, plus an offset copy with connecting lines when offset != 0 (default 1 mm; NaN/omitted = default, 0 = no offset). sharp_indices are 0-based indices of the points picked with Shift in the command (kinks). plane is the symmetry/offset plane; omitted = the active view’s construction plane. Returns the ids of the curves added to the primary user layer.
| Parameter | Type | |
|---|---|---|
points | Sequence[PointLike] | required |
sharp_indices | Sequence[int] | optional — None = the tool default |
symmetry | str | optional — None = the tool default |
close | bool | optional — None = the tool default |
offset | float | optional — None = the tool default |
plane | Optional[PlaneLike] | optional — None = the tool default |
ra.curve.auto_join()
ra.curve.auto_join(curve_ids=None) -> List[str]
Replicates ArtisanAutoJoin: joins the open, visible curves of the document whose ends touch (document tolerance), like running _Join on all of them. curve_ids restricts the candidates (closed curves are always skipped); None/empty = every visible curve. Curves that do not touch anything are left untouched. Each joined result keeps the attributes of its first member. Returns the ids of the NEW joined curves.
| Parameter | Type | |
|---|---|---|
curve_ids | Sequence[IdLike] | optional — None = the tool default |
ra.curve.connect()
ra.curve.connect(first_id: IdLike, first_point: PointLike, second_id: IdLike, second_point: PointLike) -> str
Replicates ArtisanCurveConnect: an arc blend leaving first_id at the point of its surface closest to first_point (along the normal) and arriving at second_id near second_point against its normal. Both ids must be solids/surfaces (breps); the two may be the same object. The result is a ConnectCurveCustomObject that remembers both parents. Returns the curve id.
| Parameter | Type | |
|---|---|---|
first_id | IdLike | required |
first_point | PointLike | required |
second_id | IdLike | required |
second_point | PointLike | required |
ra.curve.cross()
ra.curve.cross(width=None, height=None, thickness=None, displacement=None, radius=None, mode=None) -> str
Replicates the ArtisanCrossBuilder panel’s Accept: a closed cross outline centred at the world origin (the panel does the same), stored as a parametric CrossCustomObject on the primary user layer. Defaults come from the user’s saved Cross Builder defaults, else width 4, height 6, thickness 1, displacement 1, mode ROUND. mode is NONE | ROUND | CHAMFER; radius is the corner radius for ROUND/CHAMFER (0 = saved default, minimum 0.1 like the panel). Returns the curve id.
| Parameter | Type | |
|---|---|---|
width | float | optional — None = the tool default |
height | float | optional — None = the tool default |
thickness | float | optional — None = the tool default |
displacement | float | optional — None = the tool default |
radius | float | optional — None = the tool default |
mode | str | optional — None = the tool default |
ra.curve.infinite()
ra.curve.infinite(base_point: PointLike, mode=None, second_point=None, third_point=None, angle=None, length=None, type=None, use_c_plane=None) -> str
Replicates ArtisanInfiniteCurve: a very long line (type LINE, centred on base_point) or ray (RAY, starting at base_point) used as a construction reference. mode chooses the direction: TWO_POINTS (needs second_point) | HORIZONTAL | VERTICAL | ANGLE (uses angle in degrees) | AXIS_X | AXIS_Y | AXIS_Z | BISECTOR (needs second_point and third_point: bisector of the angle they form at base_point) HORIZONTAL/VERTICAL/ANGLE follow the active construction plane when useCPlane is True, else World XY. length 0 = 10x the scene’s bounding-box diagonal (minimum 1000 mm). Returns the line id.
| Parameter | Type | |
|---|---|---|
base_point | PointLike | required |
mode | str | optional — None = the tool default |
second_point | Optional[PointLike] | optional — None = the tool default |
third_point | Optional[PointLike] | optional — None = the tool default |
angle | float | optional — None = the tool default |
length | float | optional — None = the tool default |
type | str | optional — None = the tool default |
use_c_plane | bool | optional — None = the tool default |
ra.curve.infinite_loop()
ra.curve.infinite_loop(center: PointLike, kind=None, width=None, height_ratio=None, height=None, flat_bottom=None, samples=None, rotation=None, use_c_plane=None) -> str
Replicates ArtisanInfiniteLoopCurve: a closed lemniscate (“infinity symbol”) interpolated through sampled points, centred at center. kind BERNOULLI (default) or GERONO; width total width in mm (default 100); height_ratio scales the natural lobe height (default 0.5); height lifts the strands in Z at the crossing so one passes over the other (0 = flat; signed); flat_bottom raises only the upper lobe; samples points per loop (default 180); rotation in degrees around the plane normal; plane = active CPlane or World XY. Returns the curve id.
| Parameter | Type | |
|---|---|---|
center | PointLike | required |
kind | str | optional — None = the tool default |
width | float | optional — None = the tool default |
height_ratio | float | optional — None = the tool default |
height | float | optional — None = the tool default |
flat_bottom | bool | optional — None = the tool default |
samples | int | optional — None = the tool default |
rotation | float | optional — None = the tool default |
use_c_plane | bool | optional — None = the tool default |
ra.curve.iso_curves()
ra.curve.iso_curves(surface_id: IdLike, point: PointLike, direction=None) -> List[str]
Replicates ArtisanIsoCurve: extracts the isocurve(s) of surface_id (a surface or single-face solid) passing through the point of the surface closest to point. direction U | V | BOTH (default U). Each result is a smart IsoCurveCustomObject (remembers its surface) on the primary user layer. Returns the ids (1 or 2 curves).
| Parameter | Type | |
|---|---|---|
surface_id | IdLike | required |
point | PointLike | required |
direction | str | optional — None = the tool default |
ra.curve.waves()
ra.curve.waves(curve_id: IdLike, waves=None, height=None) -> str
Replicates ArtisanWaves: a smooth wave (waves full periods, default 3, peak-to-peak height mm, default 3) flowed along curve_id from its start to its end. Plain curve added with the document’s current attributes; the source curve is left untouched. Returns the new curve id.
| Parameter | Type | |
|---|---|---|
curve_id | IdLike | required |
waves | int | optional — None = the tool default |
height | float | optional — None = the tool default |