Python package
ra.gems_on_curve
A run of stones along one curve, with prongs and cutters, editable afterwards.
import rhinoartisan as ra
Wraps ArtisanPlugin.Scripting.GemsOnCurveApi.
Functions
| Function | |
|---|---|
all() | GemsOnCurve handles for every object of this kind in the active document (empty when there is no document). |
by_layer() | GemsOnCurve handles on the layer with the given full path (empty when the layer does not exist). |
count() | Number of objects of this kind in the active document. |
create() | Distributes a row of identical gems along an existing curve — the ArtisanGemsOnCurve tool, headless. |
find() | The handle for id, or None when the id does not belong to an object of this kind. |
for_curve() | |
selected() | GemsOnCurves currently selected in the active doc. |
ra.gems_on_curve.all()
ra.gems_on_curve.all() -> List[GemsOnCurve]
GemsOnCurve handles for every object of this kind in the active document (empty when there is no document).
ra.gems_on_curve.by_layer()
ra.gems_on_curve.by_layer(layer_name: str) -> List[GemsOnCurve]
GemsOnCurve handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | |
|---|---|---|
layer_name | str | required |
ra.gems_on_curve.count()
ra.gems_on_curve.count() -> int
Number of objects of this kind in the active document.
ra.gems_on_curve.create()
ra.gems_on_curve.create(curve_id: IdLike, gem_size=None, distance=None, gem_shape=None, gem_material=None, prongs=None, cutters=None, orientation_ids=None) -> GemsOnCurve
Distributes a row of identical gems along an existing curve — the ArtisanGemsOnCurve tool, headless. curve_id must be a curve in the active document; it becomes the row’s parent (see ForCurve). Millimetres; omitting keeps the tool default (or the user’s saved defaults): gem_size 1.5, distance 0.2. gem_shape/gem_material accept the GemApi vocabularies (default ROUND Diamond). prongs True also builds the shared prongs; cutters True bakes one cutter per gem into a separate group. orientation_ids optionally orient the gems onto those surfaces/breps. Returns an GemsOnCurve handle to the new row.
| Parameter | Type | |
|---|---|---|
curve_id | IdLike | required |
gem_size | float | optional — None = the tool default |
distance | float | optional — None = the tool default |
gem_shape | str | optional — None = the tool default |
gem_material | str | optional — None = the tool default |
prongs | bool | optional — None = the tool default |
cutters | bool | optional — None = the tool default |
orientation_ids | Sequence[IdLike] | optional — None = the tool default |
ra.gems_on_curve.find()
ra.gems_on_curve.find(id: IdLike) -> GemsOnCurve
The handle for id, or None when the id does not belong to an object of this kind.
| Parameter | Type | |
|---|---|---|
id | IdLike | required |
ra.gems_on_curve.for_curve()
ra.gems_on_curve.for_curve(curve_id: IdLike) -> List[GemsOnCurve]
| Parameter | Type | |
|---|---|---|
curve_id | IdLike | required |
ra.gems_on_curve.selected()
ra.gems_on_curve.selected() -> List[GemsOnCurve]
GemsOnCurves currently selected in the active doc.
Handles
Objects returned by the functions above. Assigning a settable property regenerates the object; the change is one undo step inside ra.transaction().
GemsOnCurve (handle)
A row of identical gems distributed along a parent curve. The “Mother” here is the curve, not a single gem — accessible via CurveId. GemShape/Material/CaratWeight describe the gem template that gets repeated along the curve.
| Property | Type | Settable | |
|---|---|---|---|
alignment_vertical | str | yes | ”TOP” | “ON_GIRDLE” |
curve_id | str | ||
cutters_enabled | bool | yes | |
distance | float | yes | |
flip_curve | bool | yes | |
gem_carat_weight | float | ||
gem_material | str | yes | |
gem_orientation | str | yes | ”NATURAL” | “UPSIDE_DOWN” |
gem_shape | str | yes | |
gem_size | float | yes | Current values (millimetres / degrees; several are signed). |
gem_size_y | float | yes | 0 = symmetric; only used by asymmetric shapes |
layer_name | str | ||
mother_gem_id | str | ||
move_by_z | float | yes | signed |
object_type | str | ||
position | Point3d | ||
prong_diameter | float | yes | |
prong_end_mode | str | yes | ”SINGLE” | “DOUBLE” |
prong_height_over_girdle | float | yes | |
prong_height_under_girdle | float | yes | |
prong_type | str | yes | ”INDIVIDUAL” | “SHARED” |
prongs_enabled | bool | yes | |
rotate90 | bool | yes | |
rotation_on_curve | float | yes | degrees, signed |
starting_point | str | yes | ”BOUNDARY” | “CENTER” |
stone_count | int |
| Method | |
|---|---|
delete() | |
move(translation: VectorLike) | |
set_prong_distance_shared(distance: float) |
Plus what every handle has: id, delete(), update(**kwargs), parameters(), equality and hashing by id, and raw (the underlying .NET object).