Python package
ra.cabochon
Cabochon stones and their settings.
import rhinoartisan as ra
Wraps ArtisanPlugin.Scripting.CabochonApi.
Functions
| Function | |
|---|---|
all() | Cabochon handles for every object of this kind in the active document (empty when there is no document). |
by_layer() | Cabochon 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() | Creates a cabochon stone (the ArtisanCabochon tool, headless) and adds it to the active document. |
find() | The handle for id, or None when the id does not belong to an object of this kind. |
selected() | Cabochons currently selected in the active doc. |
ra.cabochon.all()
ra.cabochon.all() -> List[Cabochon]
Cabochon handles for every object of this kind in the active document (empty when there is no document).
ra.cabochon.by_layer()
ra.cabochon.by_layer(layer_name: str) -> List[Cabochon]
Cabochon handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | |
|---|---|---|
layer_name | str | required |
ra.cabochon.count()
ra.cabochon.count() -> int
Number of objects of this kind in the active document.
ra.cabochon.create()
ra.cabochon.create(x=None, y=None, z=None, shape=None, type=None, angle=None, girdle_height=None, plane=None, girdle_angle=None) -> Cabochon
Creates a cabochon stone (the ArtisanCabochon tool, headless) and adds it to the active document. Unlike Bezel/AdvancedBezel, a cabochon does NOT wrap a mother gem: it is its own stone, placed on plane (omitted = world XY, like the panel’s “add on plane”). All dimensional arguments are millimetres. Omit (None) to keep the tool’s default — or the user’s saved defaults — for that parameter (x 4, y 8, z 2, angle 15 degrees, girdle_height 1). shape accepts case-insensitive CabochonShape names (“Round”, “Oval”, “Rectangular”, “Heart”, “Pear”, “Marquise”, “Diamond”); type accepts CabochonType names (“Cabochon”, “FlatTopSingleBevel”, “FlatTopDoubleBevel”, “BuffTopSingleBevel”, “BuffTopDoubleBevel”). Omitted/None keeps the default (Round / Cabochon or the saved defaults). Throws ArgumentException for an unknown shape/type name and InvalidOperationException when the geometry fails to compute.
| Parameter | Type | |
|---|---|---|
x | float | optional — None = the tool default |
y | float | optional — None = the tool default |
z | float | optional — None = the tool default |
shape | str | optional — None = the tool default |
type | str | optional — None = the tool default |
angle | Optional[float] | optional — None = the tool default |
girdle_height | Optional[float] | optional — None = the tool default |
plane | Optional[PlaneLike] | optional — None = the tool default |
girdle_angle | Optional[float] | optional — None = the tool default |
ra.cabochon.find()
ra.cabochon.find(id: IdLike) -> Cabochon
The handle for id, or None when the id does not belong to an object of this kind.
| Parameter | Type | |
|---|---|---|
id | IdLike | required |
ra.cabochon.selected()
ra.cabochon.selected() -> List[Cabochon]
Cabochons currently selected in the active doc. Empty list if nothing is selected or the selection contains no cabochons.
Handles
Objects returned by the functions above. Assigning a settable property regenerates the object; the change is one undo step inside ra.transaction().
Cabochon (handle)
A cabochon is its own stone (round / oval / rectangular / … dome cut): it is not built around a mother gem, so it extends ParametricObject directly and MotherGemId is always None. The setters recompute the stone and replace it in place, keeping its Guid (the same thing the panel does on accept), and take LITERAL values: a 0 angle is a straight wall and a 0 girdle height is no girdle.
| Property | Type | Settable | |
|---|---|---|---|
angle | float | yes | degrees |
cut_type | str | yes | CabochonType name (“Cabochon”, “FlatTopSingleBevel”, …) |
girdle_angle | float | yes | degrees |
girdle_height | float | yes | millimetres |
layer_name | str | ||
mother_gem_id | str | ||
object_type | str | ||
position | Point3d | ||
shape | str | yes | CabochonShape name (“Round”, “Oval”, …) |
size_x | float | yes | millimetres |
size_y | float | yes | millimetres |
size_z | float | yes | dome height, millimetres |
| Method | |
|---|---|
delete() | |
move(translation: VectorLike) | |
set_size(x: float, y: float, z: float) |
Plus what every handle has: id, delete(), update(**kwargs), parameters(), equality and hashing by id, and raw (the underlying .NET object).