Skip to content

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

ParameterType
layer_namestrrequired

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.

ParameterType
finger_diameterfloatoptional — None = the tool default
top_widthfloatoptional — None = the tool default
top_heightfloatoptional — None = the tool default
bottom_widthfloatoptional — None = the tool default
bottom_heightfloatoptional — None = the tool default
profilestroptional — None = the tool default
interiorstroptional — None = the tool default
twistOptional[bool]optional — None = the tool default
start_anglefloatoptional — None = the tool default
end_anglefloatoptional — None = the tool default
transitionfloatoptional — None = the tool default
pitchfloatoptional — None = the tool default
depthfloatoptional — None = the tool default
mirrorOptional[bool]optional — None = the tool default
interior_smoothOptional[bool]optional — None = the tool default
openingstroptional — None = the tool default
cut_lengthfloatoptional — None = the tool default
cut_bumpingfloatoptional — None = the tool default
strangle_openingfloatoptional — None = the tool default
strangle_base_xfloatoptional — None = the tool default
strangle_base_yfloatoptional — None = the tool default
strangle_base_zfloatoptional — None = the tool default
planeOptional[PlaneLike]optional — None = the tool default
elementstroptional — 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.

ParameterType
idIdLikerequired

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.

PropertyTypeSettable
bottom_profileTwistedShankProfile
layer_namestr
mother_gem_idstr
object_typestr
openingTwistedShankOpening
positionPoint3d
ring_diameter_mmfloat
ring_size_labelstr
ring_size_regionstr
top_profileTwistedShankProfile
twistTwistedShankTwist
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.

PropertyTypeSettable
comfortfloatyesmm, the comfort dome’s depth (used when Type is “COMFORT”)
heightfloatyesmm, radial
profile_namestrRING_PROFILE asset name, "" when unset
typestryes”SOLID” or “COMFORT”
widthfloatyesmm, 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).

PropertyTypeSettable
cut_bumpingfloatyesmm, bulge of the CUT caps (0 = flat)
cut_lengthfloatyesmm of arc on the finger, CUT
strangle_base_xfloatmm, STRANGLE base length along the finger curve
strangle_base_yfloatmm, STRANGLE base width across the band
strangle_base_zfloatmm, STRANGLE base thickness
strangle_openingfloatmm, STRANGLE: where the band starts narrowing
typestryes”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.

PropertyTypeSettable
depthfloatyesmm, groove depth
enabledboolyes
end_anglefloatdegrees from the top where it starts fading out
interior_smoothboolyesTrue = only the outer part twists, the inside stays smooth
mirrorboolyesTrue = the two sides twist as mirror images
pitchfloatyesmm along the band between two grooves
start_anglefloatdegrees from the top where the twist is fully in
transitionfloatyesdegrees 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