Skip to content

Python package

ra.cluster

Cluster settings around a centre stone.

import rhinoartisan as ra

Wraps ArtisanPlugin.Scripting.ClusterApi.

Functions

Function
all()Cluster handles for every object of this kind in the active document (empty when there is no document).
by_layer()Cluster 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()Builds a cluster of small stones around an existing gem — the ArtisanCluster tool, headless.
find()The handle for id, or None when the id does not belong to an object of this kind.
for_gem()Cluster handles whose mother gem is gem_id (empty for None).
selected()Clusters currently selected in the active doc.

ra.cluster.all()

ra.cluster.all() -> List[Cluster]

Cluster handles for every object of this kind in the active document (empty when there is no document).

ra.cluster.by_layer()

ra.cluster.by_layer(layer_name: str) -> List[Cluster]

Cluster handles on the layer with the given full path (empty when the layer does not exist).

ParameterType
layer_namestrrequired

ra.cluster.count()

ra.cluster.count() -> int

Number of objects of this kind in the active document.

ra.cluster.create()

ra.cluster.create(gem_id: IdLike, stone_size=None, stone_distance=None, distance_to_gem=None, prong_number=None, prong_diameter=None, rail_diameter=None, double_rail=None, rail_diameter2=None, prong_orientation=None, internal_prong_diameter=None, external_prong_diameter=None, central_prong_diameter=None, stones_z_position=None, stones_rotation=None, element=None, center_prongs=None, center_prong_mode=None, center_prong_type=None, center_prong_count=None, center_prong_diameter=None, center_prong_overlap=None) -> Cluster

Builds a cluster of small stones around an existing gem — the ArtisanCluster tool, headless. gem_id must be a gem in the active document with a cluster-friendly shape (ROUND, CUSHION, EMERALD, OVAL, RADIANT, ASSCHER); the kernel picks the matching shape variant internally. Millimetres; omitting keeps the tool default (or the user’s saved defaults): stone_size 1.6, stone_distance 0.2, distance_to_gem 1.0, prong_diameter 0.8 (applied to the internal, external and central prongs alike), rail_diameter 1.0. prong_number is 3, 4 or 5 (default 4). element = name of a saved Cluster element (ra.elements.list(“Cluster”)) to start from instead of the defaults; explicit arguments override it. The centre stone’s own prongs (the Halo’s, off by default): center_prongs True turns them on (any other center_prong* value implies it). center_prong_mode ROUND, CUSTOM or CLAW; center_prong_type SINGLE, DOUBLE or TRIPLE (CLAW takes SINGLE or DOUBLE, CUSTOM SINGLE); center_prong_count positions, center_prong_diameter mm, center_prong_overlap mm (pairs). They run down from the stone and curve into the main gem rail; the rest through handle.CenterProngs. Returns an Cluster handle to the new cluster group.

ParameterType
gem_idIdLikerequired
stone_sizefloatoptional — None = the tool default
stone_distancefloatoptional — None = the tool default
distance_to_gemfloatoptional — None = the tool default
prong_numberintoptional — None = the tool default
prong_diameterfloatoptional — None = the tool default
rail_diameterfloatoptional — None = the tool default
double_railOptional[bool]optional — None = the tool default
rail_diameter2floatoptional — None = the tool default
prong_orientationstroptional — None = the tool default
internal_prong_diameterfloatoptional — None = the tool default
external_prong_diameterfloatoptional — None = the tool default
central_prong_diameterfloatoptional — None = the tool default
stones_z_positionfloatoptional — None = the tool default
stones_rotationfloatoptional — None = the tool default
elementstroptional — None = the tool default
center_prongsOptional[bool]optional — None = the tool default
center_prong_modestroptional — None = the tool default
center_prong_typestroptional — None = the tool default
center_prong_countintoptional — None = the tool default
center_prong_diameterfloatoptional — None = the tool default
center_prong_overlapfloatoptional — None = the tool default

ra.cluster.find()

ra.cluster.find(id: IdLike) -> Cluster

The handle for id, or None when the id does not belong to an object of this kind.

ParameterType
idIdLikerequired

ra.cluster.for_gem()

ra.cluster.for_gem(gem_id: IdLike) -> List[Cluster]

Cluster handles whose mother gem is gem_id (empty for None).

ParameterType
gem_idIdLikerequired

ra.cluster.selected()

ra.cluster.selected() -> List[Cluster]

Clusters 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().

Cluster (handle)

PropertyTypeSettable
center_prongsClusterCenterProngsThe optional prongs of the centre stone itself (the Halo’s), see ClusterCenterProngs.
central_prong_diameterfloatyes
cluster_stone_countintStones forming the cluster (around the center gem)
cluster_stone_sizefloat
cluster_stone_weightfloat
cluster_total_weightfloat
distance_to_gemfloatyes
double_railboolyes
external_prong_diameterfloatyes
fillet_factorfloatyes
gem_carat_weightfloat
gem_materialstr
gem_shapestr
internal_prong_diameterfloatyes
layer_namestr
mother_gem_idstr
object_typestr
positionPoint3d
prong_countintyes3, 4 or 5
prong_orientationstryes”CURVE” | “CENTER”
rail_diameter1floatyes
rail_diameter2floatyes
stone_distancefloatyes
stone_sizefloatyesCurrent values. Millimetres / degrees; several are signed.
stones_rotationfloatyessigned
stones_z_positionfloatyessigned
Method
delete()
move(translation: VectorLike)
set_base_height(height: float)
set_base_move_in_z(move_in_z: float)signed
set_base_width(width: float)
set_element(element: str)Applies a saved Cluster element (ra.elements.list(“Cluster”)) to this cluster: its parameters replace the current ones, the mother gem stays, and the cluster regenerates in place (same id).
set_prong_diameter(diameter: float)all three families at once
set_rail_move_in_z1(move_in_z: float)signed
set_rail_move_in_z2(move_in_z: float)signed

Plus what every handle has: id, delete(), update(**kwargs), parameters(), equality and hashing by id, and raw (the underlying .NET object).

ClusterCenterProngs (section)

The cluster’s optional prongs of the centre stone itself - the Halo’s (round, Double, Triple, Claw, Double Claw or a custom section) - on top of the internal prongs the cluster stones share with it. They run down from the stone and curve into the main gem rail. Off by default.

PropertyTypeSettable
bridge_modestryes”CURVED” | “STRAIGHT”: how the prongs run into the main gem rail
cap_bumpfloatyesmm, the bulge of the round cap
claw_gem_insidefloatyesCLAW, mm: how far the tip reaches in toward the stone centre
claw_heightfloatyesCLAW, mm, signed: the tip moved up or down
claw_on_curveintyesCLAW, % of the prong below the girdle where the hook starts (Smoothness, 1-30)
claw_tensionfloatyesCLAW, degrees the hook bends down (the panel’s Tip direction, 10-60)
countintyesprong positions round the stone
diameterfloatyesmm
enabledboolyes
extension_for_manufacturingfloatyesmm, MANUFACTURING extension
gem_insidefloatyesmm into the stone, signed
height_over_girdlefloatyesmm above the girdle
modestryes”ROUND” | “CUSTOM” | “CLAW”
move_in_zfloatyesmm, signed
overlapfloatyesmm the prongs of a pair, and the Triple’s middle, cross: 0 = they touch
profile_namestrCLOSED_PROFILE asset name of the CUSTOM section, "" when unset
rotationfloatyesdegrees (CUSTOM section)
typestryes”SINGLE” | “DOUBLE” | “TRIPLE”: prongs per position. ROUND takes all three, CLAW SINGLE or DOUBLE (the Double Claw), CUSTOM SINGLE.
Method
set_profile(asset_name: str)CLOSED_PROFILE asset; switches the mode to CUSTOM