Skip to content

Python package

ra.peghead

Peghead seats under a stone: prongs, height, thickness.

import rhinoartisan as ra

Wraps ArtisanPlugin.Scripting.PegheadApi.

Functions

Function
all()Peghead handles for every object of this kind in the active document (empty when there is no document).
by_layer()Peghead 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 peghead (prong head) around an existing gem — the ArtisanPeghead tool, headless.
find()The handle for id, or None when the id does not belong to an object of this kind.
for_gem()Peghead handles whose mother gem is gem_id (empty for None).
selected()Pegheads currently selected in the active doc.

ra.peghead.all()

ra.peghead.all() -> List[Peghead]

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

ra.peghead.by_layer()

ra.peghead.by_layer(layer_name: str) -> List[Peghead]

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

ParameterType
layer_namestrrequired

ra.peghead.count()

ra.peghead.count() -> int

Number of objects of this kind in the active document.

ra.peghead.create()

ra.peghead.create(gem_id: IdLike, prongs=None, height=None, thickness=None, girdle_width=None, over_girdle_height=None, gem_inside=None, profile=None, element=None, thickness_bottom=None, prong_rotation=None, seat=None, seat_angle=None, gallery_rail=None, gallery_position=None, gallery_height=None, gallery_width=None) -> Peghead

Builds a peghead (prong head) around an existing gem — the ArtisanPeghead tool, headless. gem_id must be a gem in the active document; the peghead is a parametric child of that gem. Millimetres; omitting keeps the tool default (or the user’s saved defaults): height 5, thickness 1, girdle_width 0.8, over_girdle_height 1. prongs 0 keeps the default (4); use 3, 4, 6… or a negative count for the rotated variant (-4 = 4 prongs at 45 degrees). gem_inside defaults to 0 and accepts negatives. profile picks a PEGHEAD_PROFILE asset by name (see ra.assets.list(“PEGHEAD_PROFILE”)); omitted = the default profile. thickness_bottom tapers the prongs: thickness is the one at the top and this the one at the bottom of the peghead (0 = the same, no taper). prong_rotation turns the prongs around the axis of the stone, in degrees from the positions the shape gives them (counter-clockwise seen from above; default 0). seat True cuts the seat of the stone into the prongs: what the stone occupies is taken out of them, straight above the girdle and at seat_angle below it (degrees from the girdle plane, default 41). It shows where the stone sits inside the prongs (gem_inside above 0). gallery_rail True adds a rail around the peghead, under the stone, that ties the prongs together: gallery_position mm below the girdle (0 = a little above the middle of the body), gallery_height high and gallery_width wide (0 = 0.8 mm each). element = name of a saved Peghead element (ra.elements.list(“Peghead”)) to start from instead of the defaults; explicit arguments (profile included) override it.

ParameterType
gem_idIdLikerequired
prongsintoptional — None = the tool default
heightfloatoptional — None = the tool default
thicknessfloatoptional — None = the tool default
girdle_widthfloatoptional — None = the tool default
over_girdle_heightfloatoptional — None = the tool default
gem_insidefloatoptional — None = the tool default
profilestroptional — None = the tool default
elementstroptional — None = the tool default
thickness_bottomfloatoptional — None = the tool default
prong_rotationfloatoptional — None = the tool default
seatOptional[bool]optional — None = the tool default
seat_anglefloatoptional — None = the tool default
gallery_railOptional[bool]optional — None = the tool default
gallery_positionfloatoptional — None = the tool default
gallery_heightfloatoptional — None = the tool default
gallery_widthfloatoptional — None = the tool default

ra.peghead.find()

ra.peghead.find(id: IdLike) -> Peghead

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

ParameterType
idIdLikerequired

ra.peghead.for_gem()

ra.peghead.for_gem(gem_id: IdLike) -> List[Peghead]

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

ParameterType
gem_idIdLikerequired

ra.peghead.selected()

ra.peghead.selected() -> List[Peghead]

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

Peghead (handle)

PropertyTypeSettable
gallery_heightfloatyes
gallery_positionfloatyesThe gallery rail, in mm: how far below the girdle its middle is (0 = a little above the middle of the body), its height and its width.
gallery_railboolyesTrue when the peghead has a gallery rail tying the prongs together.
gallery_widthfloatyes
gem_carat_weightfloat
gem_insidefloatyes
gem_materialstr
gem_shapestr
girdle_widthfloatyes
heightfloatyes
layer_namestr
mother_gem_idstr
object_typestr
over_girdle_heightfloatyes
positionPoint3d
profile_namestrPEGHEAD_PROFILE asset name, "" when unset
prong_rotationfloatyesDegrees the prongs are turned around the axis of the stone, from the positions the shape gives them (counter-clockwise from above).
prongsintyesCurrent values (millimetres, except Prongs). negative = the rotated variant
seatboolyesTrue when the seat of the stone is cut into the prongs.
seat_anglefloatyesAngle of the seat below the girdle, in degrees from the girdle plane.
thicknessfloatyes
thickness_bottomfloatyesThickness of the prongs at the bottom of the peghead, in mm (Thickness is the one at the top). 0 = the same: no taper.
Method
delete()
move(translation: VectorLike)
set_element(element: str)Applies a saved Peghead element (ra.elements.list(“Peghead”)) to this peghead: its parameters replace the current ones, the mother gem stays, and the peghead regenerates in place (same Guid).
set_profile(asset_name: str)PEGHEAD_PROFILE asset name

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