Python package
ra.martini
Martini settings.
import rhinoartisan as ra
Wraps ArtisanPlugin.Scripting.MartiniApi.
Functions
| Function | |
|---|---|
all() | Martini handles for every object of this kind in the active document (empty when there is no document). |
by_layer() | Martini 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 martini setting — four tapering prongs meeting in a point below an existing gem, with an optional upper rail and two lateral side gems — the ArtisanMartini tool, headless. |
find() | The handle for id, or None when the id does not belong to an object of this kind. |
for_gem() | Martini handles whose mother gem is gem_id (empty for None). |
selected() | Martinis currently selected in the active doc. |
ra.martini.all()
ra.martini.all() -> List[Martini]
Martini handles for every object of this kind in the active document (empty when there is no document).
ra.martini.by_layer()
ra.martini.by_layer(layer_name: str) -> List[Martini]
Martini handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | |
|---|---|---|
layer_name | str | required |
ra.martini.count()
ra.martini.count() -> int
Number of objects of this kind in the active document.
ra.martini.create()
ra.martini.create(gem_id: IdLike, prong_height=None, prong_diameter_top=None, prong_diameter_bottom=None, upper_rail=None, side_gems=None, side_gem_size=None, prong_mode=None, face_tangent=None, prong_profile_name=None, rail_width=None, rail_height=None, rail_height_under_girdle=None, rail_profile_name=None, side_gem_shape=None, side_bezel_width=None, side_distance=None) -> Martini
Builds a martini setting — four tapering prongs meeting in a point below an existing gem, with an optional upper rail and two lateral side gems — the ArtisanMartini tool, headless. gem_id must be a gem in the active document with a martini-friendly shape (any shape except TRIANGLE and COFFIN). Millimetres; 0 (or None) keeps the tool default (or the user’s saved defaults): prong_height 5.40, prong_diameter_top 1.30, prong_diameter_bottom 1.30, side_gem_size 1.40; upper_rail and side_gems are both enabled by default. As in the panel, the prong “face tangent” behaviour is seeded from the gem’s symmetry unless face_tangent says otherwise. prong_mode picks the prong construction: DEFAULT, CUSTOM or CLAW. The claw tips are shaped through the returned handle (martini.claw_cap_height = … and friends), because their defaults are signed and this signature reads 0 as “keep the default”. Returns an Martini handle to the new martini group.
| Parameter | Type | |
|---|---|---|
gem_id | IdLike | required |
prong_height | float | optional — None = the tool default |
prong_diameter_top | float | optional — None = the tool default |
prong_diameter_bottom | float | optional — None = the tool default |
upper_rail | Optional[bool] | optional — None = the tool default |
side_gems | Optional[bool] | optional — None = the tool default |
side_gem_size | float | optional — None = the tool default |
prong_mode | str | optional — None = the tool default |
face_tangent | Optional[bool] | optional — None = the tool default |
prong_profile_name | str | optional — None = the tool default |
rail_width | float | optional — None = the tool default |
rail_height | float | optional — None = the tool default |
rail_height_under_girdle | float | optional — None = the tool default |
rail_profile_name | str | optional — None = the tool default |
side_gem_shape | str | optional — None = the tool default |
side_bezel_width | float | optional — None = the tool default |
side_distance | float | optional — None = the tool default |
ra.martini.find()
ra.martini.find(id: IdLike) -> Martini
The handle for id, or None when the id does not belong to an object of this kind.
| Parameter | Type | |
|---|---|---|
id | IdLike | required |
ra.martini.for_gem()
ra.martini.for_gem(gem_id: IdLike) -> List[Martini]
Martini handles whose mother gem is gem_id (empty for None).
| Parameter | Type | |
|---|---|---|
gem_id | IdLike | required |
ra.martini.selected()
ra.martini.selected() -> List[Martini]
Martinis 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().
Martini (handle)
| Property | Type | Settable | |
|---|---|---|---|
claw_cap_distance | float | yes | |
claw_cap_height | float | yes | |
claw_tip_smoothness | float | yes | |
claw_tip_width | float | yes | |
face_tangent | bool | yes | |
gem_carat_weight | float | ||
gem_material | str | ||
gem_shape | str | ||
layer_name | str | ||
mother_gem_id | str | ||
object_type | str | ||
position | Point3d | ||
prong_diameter_bottom | float | yes | |
prong_diameter_top | float | yes | |
prong_height | float | yes | Prongs (4, tapering to a point below the gem). Millimetres. |
prong_mode | str | yes | Prong construction: “DEFAULT”, “CUSTOM” or “CLAW”. The claw values only shape the prong tips in CLAW mode; ClawCapHeight is signed. |
side_gem_size | float | yes | |
side_gems_enabled | bool | yes | |
upper_rail_enabled | bool | yes | Upper rail and lateral side gems |
| Method | |
|---|---|
delete() | |
move(translation: VectorLike) |
Plus what every handle has: id, delete(), update(**kwargs), parameters(), equality and hashing by id, and raw (the underlying .NET object).