Python package
ra.twisted_shank
Twisted shanks - a solitaire band with plain shoulders under the head, two twisted strands on the sides, a plain back and a smooth inside (the ArtisanTwistedShank tool).
import rhinoartisan as ra
Wraps ArtisanPlugin.Scripting.TwistedShankApi.
Functions
| Function | |
|---|---|
all() | TwistedShank handles for every object of this kind in the active document (empty when there is no document). |
by_layer() | TwistedShank 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 twisted shank — the ArtisanTwistedShank tool, headless. |
find() | The handle for id, or None when the id does not belong to an object of this kind. |
selected() | TwistedShank handles for the objects of this kind currently selected in the active document. |
ra.twisted_shank.all()
ra.twisted_shank.all() -> List[TwistedShank]
TwistedShank handles for every object of this kind in the active document (empty when there is no document).
ra.twisted_shank.by_layer()
ra.twisted_shank.by_layer(layer_name: str) -> List[TwistedShank]
TwistedShank handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | |
|---|---|---|
layer_name | str | required |
ra.twisted_shank.count()
ra.twisted_shank.count() -> int
Number of objects of this kind in the active document.
ra.twisted_shank.create()
ra.twisted_shank.create(finger_diameter=None, top_width=None, top_height=None, bottom_width=None, bottom_height=None, profile=None, interior=None, twist=None, start_angle=None, end_angle=None, transition=None, pitch=None, depth=None, mirror=None, interior_smooth=None, opening=None, cut_length=None, cut_bumping=None, strangle_opening=None, strangle_base_x=None, strangle_base_y=None, strangle_base_z=None, plane=None, element=None) -> TwistedShank
Builds a twisted shank — the ArtisanTwistedShank tool, headless. Millimetres; omitting keeps the tool default (or the user’s saved defaults): top profile 1.8 x 1.6 (under the head), bottom profile 2.2 x 1.5 (the back), the band blending between them. finger_diameter 0 = the document’s finger size. profile picks a RING_PROFILE asset by name for both sections; interior SOLID or COMFORT (both sections). The twist: twist False = a plain band. start_angle / end_angle (degrees from the top, both sides alike; defaults 40 / 140) bound the twisted stretch, fading in and out over transition degrees (12); pitch mm between two grooves (2.2), depth mm deep (0.45); mirror (default True) twists the two sides as mirror images; interior_smooth (default True) keeps the inside smooth. NaN / None keep the value. opening NONE (default, closed), CUT (open over cut_length mm, caps bulged by cut_bumping) or STRANGLE (narrowed to a strangleBaseY x strangleBaseZ base over strangleBaseX mm, back to the band strangle_opening mm apart) - Classic’s opening. element = name of a saved TwistedShank element (ra.elements.list(“TwistedShank”)) to start from; explicit arguments override it. Returns the TwistedShank handle.
| Parameter | Type | |
|---|---|---|
finger_diameter | float | optional — None = the tool default |
top_width | float | optional — None = the tool default |
top_height | float | optional — None = the tool default |
bottom_width | float | optional — None = the tool default |
bottom_height | float | optional — None = the tool default |
profile | str | optional — None = the tool default |
interior | str | optional — None = the tool default |
twist | Optional[bool] | optional — None = the tool default |
start_angle | float | optional — None = the tool default |
end_angle | float | optional — None = the tool default |
transition | float | optional — None = the tool default |
pitch | float | optional — None = the tool default |
depth | float | optional — None = the tool default |
mirror | Optional[bool] | optional — None = the tool default |
interior_smooth | Optional[bool] | optional — None = the tool default |
opening | str | optional — None = the tool default |
cut_length | float | optional — None = the tool default |
cut_bumping | float | optional — None = the tool default |
strangle_opening | float | optional — None = the tool default |
strangle_base_x | float | optional — None = the tool default |
strangle_base_y | float | optional — None = the tool default |
strangle_base_z | float | optional — None = the tool default |
plane | Optional[PlaneLike] | optional — None = the tool default |
element | str | optional — None = the tool default |
ra.twisted_shank.find()
ra.twisted_shank.find(id: IdLike) -> TwistedShank
The handle for id, or None when the id does not belong to an object of this kind.
| Parameter | Type | |
|---|---|---|
id | IdLike | required |
ra.twisted_shank.selected()
ra.twisted_shank.selected() -> List[TwistedShank]
TwistedShank handles for the objects of this kind currently selected in the active document.
Handles
Objects returned by the functions above. Assigning a settable property regenerates the object; the change is one undo step inside ra.transaction().
TwistedShank (handle)
Twisted solitaire shank: plain shoulders under the head, two twisted strands on the sides, a plain back and a smooth inside. The head is a separate setting.
| Property | Type | Settable | |
|---|---|---|---|
bottom_profile | TwistedShankProfile | ||
layer_name | str | ||
mother_gem_id | str | ||
object_type | str | ||
opening | TwistedShankOpening | ||
position | Point3d | ||
ring_diameter_mm | float | ||
ring_size_label | str | ||
ring_size_region | str | ||
top_profile | TwistedShankProfile | ||
twist | TwistedShankTwist |
| Method | |
|---|---|
delete() | |
move(translation: VectorLike) | |
set_element(element: str) | Applies a saved TwistedShank element (ra.elements.list(“TwistedShank”)) to this shank: its parameters replace the current ones, the ring size stays, and the shank regenerates in place (same id). |
Plus what every handle has: id, delete(), update(**kwargs), parameters(), equality and hashing by id, and raw (the underlying .NET object).
TwistedShankProfile (section)
One of the twisted shank’s two sections: Top (under the head) and Bottom (the back of the ring); the band blends between them.
| Property | Type | Settable | |
|---|---|---|---|
comfort | float | yes | mm, the comfort dome’s depth (used when Type is “COMFORT”) |
height | float | yes | mm, radial |
profile_name | str | RING_PROFILE asset name, "" when unset | |
type | str | yes | ”SOLID” or “COMFORT” |
width | float | yes | mm, along the finger |
| Method | |
|---|---|
set_profile(asset_name: str) | RING_PROFILE asset by name |
TwistedShankOpening (section)
The top of the band under the head, as Classic’s opening: NONE (closed), CUT (open, the ends capped flat or bulged) or STRANGLE (narrowed to a small base).
| Property | Type | Settable | |
|---|---|---|---|
cut_bumping | float | yes | mm, bulge of the CUT caps (0 = flat) |
cut_length | float | yes | mm of arc on the finger, CUT |
strangle_base_x | float | mm, STRANGLE base length along the finger curve | |
strangle_base_y | float | mm, STRANGLE base width across the band | |
strangle_base_z | float | mm, STRANGLE base thickness | |
strangle_opening | float | mm, STRANGLE: where the band starts narrowing | |
type | str | yes | ”NONE”, “CUT” or “STRANGLE” |
| Method | |
|---|---|
set_strangle(opening: float, base_x: float, base_y: float, base_z: float) | STRANGLE: opening (mm) must stay greater than baseX |
TwistedShankTwist (section)
The twisted stretch on each side: two strands whose groove turns round the outer part of the band. Angles in degrees from the top (the head), 0-180, the same on both sides.
| Property | Type | Settable | |
|---|---|---|---|
depth | float | yes | mm, groove depth |
enabled | bool | yes | |
end_angle | float | degrees from the top where it starts fading out | |
interior_smooth | bool | yes | True = only the outer part twists, the inside stays smooth |
mirror | bool | yes | True = the two sides twist as mirror images |
pitch | float | yes | mm along the band between two grooves |
start_angle | float | degrees from the top where the twist is fully in | |
transition | float | yes | degrees over which it fades in / out at each end |
| Method | |
|---|---|
set_angles(start_angle: float, end_angle: float) | degrees from the top, 0 <= start < end <= 180 |