.NET API
CurveApi
Scriptable versions of the Artisan curve helpers that do not have a facade of their own (ring curve, text on curve, raster to vector, patterns and profile sweeps live in their own *Api classes): Advanced ArtisanAdvancedCurve symmetric control-point curve with offset AutoJoin ArtisanAutoJoin joins every open curve of the document Cross ArtisanCrossBuilder parametric cross outline (CrossCustomObject) Connect ArtisanCurveConnect arc blend between two points on solids Infinite ArtisanInfiniteCurve very long construction line / ray InfiniteLoop ArtisanInfiniteLoopCurve lemniscate (“infinity symbol”) curve IsoCurves ArtisanIsoCurve smart isocurves of a surface at a point Waves ArtisanWaves sine-like wave flowed along a curve AddSketches ArtisanAddSketches reference images on a 10 mm box (top/front/side) Millimetres everywhere; numeric 0 (or null/omitted) keeps the tool’s default. Every method returns the Guid(s) of the curves it added.
from ArtisanPlugin.Scripting import CurveApi
See also the Python package, ra.curve.
Methods
| Method | |
|---|---|
AddSketches | 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). |
AutoJoin | 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 firstId at the point of its surface closest to firstPoint (along the normal) and arriving at secondId near secondPoint 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 basePoint) or ray (RAY, starting at basePoint) used as a construction reference. |
InfiniteLoop | Replicates ArtisanInfiniteLoopCurve: a closed lemniscate (“infinity symbol”) interpolated through sampled points, centred at center. |
IsoCurves | Replicates ArtisanIsoCurve: extracts the isocurve(s) of surfaceId (a surface, or the face of a solid nearest to point) 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 curveId from its start to its end. |
AddSketches
IReadOnlyList<Guid> CurveApi.AddSketches(
string topImagePath = null,
string frontImagePath = null,
string sideImagePath = null)
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 | Default |
|---|---|---|
topImagePath | string | null |
frontImagePath | string | null |
sideImagePath | string | null |
Returns IReadOnlyList<Guid>.
Advanced
IReadOnlyList<Guid> CurveApi.Advanced(
IEnumerable<Point3d> points,
IEnumerable<int> sharpIndices = null,
string symmetry = "NONE",
bool close = false,
double offset = double.NaN,
Plane? plane = null)
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). sharpIndices 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 | Default |
|---|---|---|
points | IEnumerable<Point3d> | required |
sharpIndices | IEnumerable<int> | null |
symmetry | string | "NONE" |
close | bool | false |
offset | double | double.NaN |
plane | Plane? | null |
Returns IReadOnlyList<Guid>.
AutoJoin
IReadOnlyList<Guid> CurveApi.AutoJoin(IEnumerable<Guid> curveIds = null)
Replicates ArtisanAutoJoin: joins the open, visible curves of the document whose ends touch (document tolerance), like running _Join on all of them. curveIds restricts the candidates (closed curves are always skipped); null/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 | Default |
|---|---|---|
curveIds | IEnumerable<Guid> | null |
Returns IReadOnlyList<Guid>.
Connect
Guid CurveApi.Connect(Guid firstId, Point3d firstPoint, Guid secondId, Point3d secondPoint)
Replicates ArtisanCurveConnect: an arc blend leaving firstId at the point of its surface closest to firstPoint (along the normal) and arriving at secondId near secondPoint 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 | Default |
|---|---|---|
firstId | Guid | required |
firstPoint | Point3d | required |
secondId | Guid | required |
secondPoint | Point3d | required |
Returns Guid.
Cross
Guid CurveApi.Cross(
double width = 0,
double height = 0,
double thickness = 0,
double displacement = 0,
double radius = 0,
string mode = null)
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 | Default |
|---|---|---|
width | double | 0 |
height | double | 0 |
thickness | double | 0 |
displacement | double | 0 |
radius | double | 0 |
mode | string | null |
Returns Guid.
Infinite
Guid CurveApi.Infinite(
Point3d basePoint,
string mode = "TWO_POINTS",
Point3d? secondPoint = null,
Point3d? thirdPoint = null,
double angle = 0,
double length = 0,
string type = "LINE",
bool useCPlane = true)
Replicates ArtisanInfiniteCurve: a very long line (type LINE, centred on basePoint) or ray (RAY, starting at basePoint) used as a construction reference. mode chooses the direction: TWO_POINTS (needs secondPoint) | HORIZONTAL | VERTICAL | ANGLE (uses angle in degrees) | AXIS_X | AXIS_Y | AXIS_Z | BISECTOR (needs secondPoint and thirdPoint: bisector of the angle they form at basePoint) 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 | Default |
|---|---|---|
basePoint | Point3d | required |
mode | string | "TWO_POINTS" |
secondPoint | Point3d? | null |
thirdPoint | Point3d? | null |
angle | double | 0 |
length | double | 0 |
type | string | "LINE" |
useCPlane | bool | true |
Returns Guid.
InfiniteLoop
Guid CurveApi.InfiniteLoop(
Point3d center,
string kind = "BERNOULLI",
double width = 0,
double heightRatio = 0,
double height = 0,
bool flatBottom = false,
int samples = 0,
double rotation = 0,
bool useCPlane = true)
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); heightRatio 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); flatBottom 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 | Default |
|---|---|---|
center | Point3d | required |
kind | string | "BERNOULLI" |
width | double | 0 |
heightRatio | double | 0 |
height | double | 0 |
flatBottom | bool | false |
samples | int | 0 |
rotation | double | 0 |
useCPlane | bool | true |
Returns Guid.
IsoCurves
IReadOnlyList<Guid> CurveApi.IsoCurves(
Guid surfaceId,
Point3d point,
string direction = "U")
Replicates ArtisanIsoCurve: extracts the isocurve(s) of surfaceId (a surface, or the face of a solid nearest to point) 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 | Default |
|---|---|---|
surfaceId | Guid | required |
point | Point3d | required |
direction | string | "U" |
Returns IReadOnlyList<Guid>.
Waves
Guid CurveApi.Waves(Guid curveId, int waves = 0, double height = 0)
Replicates ArtisanWaves: a smooth wave (waves full periods, default 3, peak-to-peak height mm, default 3) flowed along curveId 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 | Default |
|---|---|---|
curveId | Guid | required |
waves | int | 0 |
height | double | 0 |
Returns Guid.