Python package
ra.boolean
Artisan booleans that keep the pieces editable: union, difference, intersection, split, update.
import rhinoartisan as ra
Wraps ArtisanPlugin.Scripting.BooleanApi, ArtisanPlugin.Scripting.BooleanUpdateApi.
Functions
| Function | |
|---|---|
difference() | Subtracts cutter_ids from target_ids. |
intersection() | Intersection of the two sets. |
split() | Splits target_ids with cutter_ids. |
union() | Union of two or more solids. |
list_dismantled() | Read-only: the dismantled Artisan booleans in the document (boolean groups with no members), with their operation, stored operand ids and the operand ids that no longer exist (those need replacements in Update). |
update() | Rebuilds one dismantled boolean by its unique id (see ListDismantled). |
update_all() | Rebuilds every dismantled Artisan boolean (the ArtisanBooleanUpdate command, no prompts): recomputes each one from its stored operands, puts the result breps back in the boolean group and hides the operands. |
ra.boolean.difference()
ra.boolean.difference(target_ids: Sequence[IdLike], cutter_ids: Sequence[IdLike]) -> List[str]
Subtracts cutter_ids from target_ids. Returns the result brep ids.
| Parameter | Type | |
|---|---|---|
target_ids | Sequence[IdLike] | required |
cutter_ids | Sequence[IdLike] | required |
ra.boolean.intersection()
ra.boolean.intersection(target_ids: Sequence[IdLike], cutter_ids: Sequence[IdLike]) -> List[str]
Intersection of the two sets. Returns the result brep ids.
| Parameter | Type | |
|---|---|---|
target_ids | Sequence[IdLike] | required |
cutter_ids | Sequence[IdLike] | required |
ra.boolean.split()
ra.boolean.split(target_ids: Sequence[IdLike], cutter_ids: Sequence[IdLike]) -> List[str]
Splits target_ids with cutter_ids. Returns the result brep ids.
| Parameter | Type | |
|---|---|---|
target_ids | Sequence[IdLike] | required |
cutter_ids | Sequence[IdLike] | required |
ra.boolean.union()
ra.boolean.union(object_ids: Sequence[IdLike]) -> List[str]
Union of two or more solids. Returns the ids of the result breps.
| Parameter | Type | |
|---|---|---|
object_ids | Sequence[IdLike] | required |
ra.boolean.list_dismantled()
ra.boolean.list_dismantled() -> List[DismantledBoolean]
Read-only: the dismantled Artisan booleans in the document (boolean groups with no members), with their operation, stored operand ids and the operand ids that no longer exist (those need replacements in Update). Id is the boolean’s unique id (RaObjectUserData.Unique).
ra.boolean.update()
ra.boolean.update(boolean_id: IdLike, replacements=None) -> UpdateResult
Rebuilds one dismantled boolean by its unique id (see ListDismantled). replacements maps a dead operand id to the object that replaces it (old id -> new id, as strings); the new ids are stored in the boolean so later updates work without them. Returns counts and result ids.
| Parameter | Type | |
|---|---|---|
boolean_id | IdLike | required |
replacements | Dict[str, str] | optional — None = the tool default |
ra.boolean.update_all()
ra.boolean.update_all() -> UpdateResult
Rebuilds every dismantled Artisan boolean (the ArtisanBooleanUpdate command, no prompts): recomputes each one from its stored operands, puts the result breps back in the boolean group and hides the operands. Booleans with a dead operand id or a failed computation are skipped and reported in Messages. Returns counts and the result ids.