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).
| Parameter | Type | |
|---|---|---|
layer_name | str | required |
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.
| Parameter | Type | |
|---|---|---|
gem_id | IdLike | required |
prongs | int | optional — None = the tool default |
height | float | optional — None = the tool default |
thickness | float | optional — None = the tool default |
girdle_width | float | optional — None = the tool default |
over_girdle_height | float | optional — None = the tool default |
gem_inside | float | optional — None = the tool default |
profile | str | optional — None = the tool default |
element | str | optional — None = the tool default |
thickness_bottom | float | optional — None = the tool default |
prong_rotation | float | optional — None = the tool default |
seat | Optional[bool] | optional — None = the tool default |
seat_angle | float | optional — None = the tool default |
gallery_rail | Optional[bool] | optional — None = the tool default |
gallery_position | float | optional — None = the tool default |
gallery_height | float | optional — None = the tool default |
gallery_width | float | optional — 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.
| Parameter | Type | |
|---|---|---|
id | IdLike | required |
ra.peghead.for_gem()
ra.peghead.for_gem(gem_id: IdLike) -> List[Peghead]
Peghead handles whose mother gem is gem_id (empty for None).
| Parameter | Type | |
|---|---|---|
gem_id | IdLike | required |
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)
| Property | Type | Settable | |
|---|---|---|---|
gallery_height | float | yes | |
gallery_position | float | yes | The 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_rail | bool | yes | True when the peghead has a gallery rail tying the prongs together. |
gallery_width | float | yes | |
gem_carat_weight | float | ||
gem_inside | float | yes | |
gem_material | str | ||
gem_shape | str | ||
girdle_width | float | yes | |
height | float | yes | |
layer_name | str | ||
mother_gem_id | str | ||
object_type | str | ||
over_girdle_height | float | yes | |
position | Point3d | ||
profile_name | str | PEGHEAD_PROFILE asset name, "" when unset | |
prong_rotation | float | yes | Degrees the prongs are turned around the axis of the stone, from the positions the shape gives them (counter-clockwise from above). |
prongs | int | yes | Current values (millimetres, except Prongs). negative = the rotated variant |
seat | bool | yes | True when the seat of the stone is cut into the prongs. |
seat_angle | float | yes | Angle of the seat below the girdle, in degrees from the girdle plane. |
thickness | float | yes | |
thickness_bottom | float | yes | Thickness 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).