// Code generated by scripts/generate-mbt-picogk-sdk.py — DO NOT EDIT.
// === Booleans ===
///|
/// boolean_add — boolean_add
/// Boolean UNION: combine two voxel objects. Both volumes are kept, overlapping regions are merged. Returns a new object ID.
///
/// Parameters:
/// - a : String (required) — ID of first object
/// - b : String (required) — ID of second object
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::boolean_add(
self : Client,
a : String,
b : String,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("a", Json::string(a))
args.set("b", Json::string(b))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("boolean_add", args)
}
///|
/// boolean_subtract — boolean_subtract
/// Boolean SUBTRACTION: subtract voxels of B from A. Removes the volume of B from A. Returns a new object ID.
///
/// Parameters:
/// - a : String (required) — ID of the object to subtract FROM
/// - b : String (required) — ID of the object to subtract
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::boolean_subtract(
self : Client,
a : String,
b : String,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("a", Json::string(a))
args.set("b", Json::string(b))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("boolean_subtract", args)
}
///|
/// boolean_intersect — boolean_intersect
/// Boolean INTERSECTION: keep only the overlapping volume of two voxel objects. Returns a new object ID.
///
/// Parameters:
/// - a : String (required) — ID of first object
/// - b : String (required) — ID of second object
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::boolean_intersect(
self : Client,
a : String,
b : String,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("a", Json::string(a))
args.set("b", Json::string(b))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("boolean_intersect", args)
}
///|
/// boolean_add_all — boolean_add_all
/// Combine multiple voxel objects into one. All volumes are merged. Returns a new object ID.
///
/// Parameters:
/// - objectIds : Array[String] (required) — List of object IDs to combine
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::boolean_add_all(
self : Client,
objectIds : Array[String],
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("objectIds", Json::array(objectIds.map(fn(s) { Json::string(s) })))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("boolean_add_all", args)
}
///|
/// boolean_subtract_all — boolean_subtract_all
/// Subtract multiple voxel objects from a single object in one call. Equivalent to calling boolean_subtract repeatedly, but more efficient for multi-hole drilling or multi-cutout operations. Returns a new object ID.
///
/// Parameters:
/// - a : String (required) — ID of the object to subtract FROM
/// - subtractIds : Array[String] (required) — List of object IDs to subtract from A
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::boolean_subtract_all(
self : Client,
a : String,
subtractIds : Array[String],
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("a", Json::string(a))
args.set(
"subtractIds",
Json::array(subtractIds.map(fn(s) { Json::string(s) })),
)
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("boolean_subtract_all", args)
}
// === IO ===
///|
/// save_stl — save_stl
/// Save a mesh to an STL file. The mesh is typically obtained from voxels_to_mesh. Units are millimeters by default.
///
/// Parameters:
/// - meshId : String (required) — ID of the mesh object
/// - path : String (required) — Full path for the output STL file
/// - units : String? (optional) — Units: MM, CM, M, FT, IN (default: MM)
///
pub async fn Client::save_stl(
self : Client,
meshId : String,
path : String,
units : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("meshId", Json::string(meshId))
args.set("path", Json::string(resolve_path(path)))
match units {
Some(v) => args.set("units", Json::string(v))
None => ()
}
self.call_tool("save_stl", args)
}
///|
/// save_vdb — save_vdb
/// Save voxels to an OpenVDB file. VDB files preserve the full voxel field data.
///
/// Parameters:
/// - voxelsId : String (required) — ID of the voxel object
/// - path : String (required) — Full path for the output VDB file
/// - fieldName : String? (optional) — Optional name for the field inside the VDB file
///
pub async fn Client::save_vdb(
self : Client,
voxelsId : String,
path : String,
fieldName : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("voxelsId", Json::string(voxelsId))
args.set("path", Json::string(resolve_path(path)))
match fieldName {
Some(v) => args.set("fieldName", Json::string(v))
None => ()
}
self.call_tool("save_vdb", args)
}
///|
/// load_vdb — load_vdb
/// Load voxels from an OpenVDB file. Returns the object ID.
///
/// Parameters:
/// - path : String (required) — Full path to the VDB file
/// - fieldName : String? (optional) — Optional field name to load (loads first field if not specified)
/// - id : String? (optional) — Optional ID to assign
///
pub async fn Client::load_vdb(
self : Client,
path : String,
fieldName : String?,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("path", Json::string(resolve_path(path)))
match fieldName {
Some(v) => args.set("fieldName", Json::string(v))
None => ()
}
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("load_vdb", args)
}
///|
/// list_vdb_fields — list_vdb_fields
/// List all fields in a VDB file with their names, types, and indices. Useful for inspecting multi-field VDB files before loading a specific field with load_vdb. Returns field count and a table of index, name, type, and PicoGK compatibility.
///
/// Parameters:
/// - path : String (required) — Full path to the VDB file
///
pub async fn Client::list_vdb_fields(self : Client, path : String) -> String {
let args : Map[String, Json] = {}
args.set("path", Json::string(resolve_path(path)))
self.call_tool("list_vdb_fields", args)
}
///|
/// save_svg — save_svg
/// Vectorize voxels into 2D slice contours and save as SVG. Each slice is written to its own file: .NNNN.svg (zero-padded 4 digits). Useful for 2D manufacturing or visualization. Returns the count of files written.
///
/// Parameters:
/// - voxelsId : String (required) — ID of the voxel object
/// - path : String (required) — Output path. The slice index is inserted before the extension: 'out.svg' -> 'out.0001.svg'; if no extension, '.NNNN.svg' is appended
/// - layerHeight : Double? (optional) — Layer height in mm for slicing
///
pub async fn Client::save_svg(
self : Client,
voxelsId : String,
path : String,
layerHeight : Double?,
) -> String {
let args : Map[String, Json] = {}
args.set("voxelsId", Json::string(voxelsId))
args.set("path", Json::string(resolve_path(path)))
match layerHeight {
Some(v) => args.set("layerHeight", Json::number(v))
None => ()
}
self.call_tool("save_svg", args)
}
///|
/// save_cli — save_cli
/// Save voxels to a CLI (Common Layer Interface) file for 3D printing. Vectorizes the voxel field into 2D layers and writes the CLI format. Returns the file path and slice count.
///
/// Parameters:
/// - voxelsId : String (required) — ID of the voxel object
/// - path : String (required) — Full path for the output CLI file
/// - layerHeight : Double? (optional) — Layer height in mm for slicing (0 = use voxel size)
/// - format : String? (optional) — Format: 'FirstLayerWithContent' (default) or 'UseEmptyFirstLayer' (adds an empty zero-height layer so readers can infer layer height)
/// - useAbsXYOrigin : Bool? (optional) — If true, use absolute X/Y origin; if false (default), slices are relative to the voxel field boundaries
///
pub async fn Client::save_cli(
self : Client,
voxelsId : String,
path : String,
layerHeight : Double?,
format : String?,
useAbsXYOrigin : Bool?,
) -> String {
let args : Map[String, Json] = {}
args.set("voxelsId", Json::string(voxelsId))
args.set("path", Json::string(resolve_path(path)))
match layerHeight {
Some(v) => args.set("layerHeight", Json::number(v))
None => ()
}
match format {
Some(v) => args.set("format", Json::string(v))
None => ()
}
match useAbsXYOrigin {
Some(v) => args.set("useAbsXYOrigin", Json::boolean(v))
None => ()
}
self.call_tool("save_cli", args)
}
// === Lattice ===
///|
/// create_lattice — create_lattice
/// Create an empty lattice structure. Add beams and sphere nodes to build it, then convert to voxels. Returns the object ID.
///
/// Parameters:
/// - id : String? (optional) — Optional ID to assign
///
pub async fn Client::create_lattice(self : Client, id : String?) -> String {
let args : Map[String, Json] = {}
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("create_lattice", args)
}
///|
/// lattice_add_beam — lattice_add_beam
/// Add a tapered beam (strut) between two points in a lattice. Each end has its own radius. Returns a confirmation.
///
/// Parameters:
/// - latticeId : String (required) — ID of the lattice object
/// - x1 : Double (required) — Start point X
/// - y1 : Double (required) — Start point Y
/// - z1 : Double (required) — Start point Z
/// - radius1 : Double (required) — Start radius in mm
/// - x2 : Double (required) — End point X
/// - y2 : Double (required) — End point Y
/// - z2 : Double (required) — End point Z
/// - radius2 : Double (required) — End radius in mm
/// - roundCap : Bool? (optional) — Use round caps (default true)
///
pub async fn Client::lattice_add_beam(
self : Client,
latticeId : String,
x1 : Double,
y1 : Double,
z1 : Double,
radius1 : Double,
x2 : Double,
y2 : Double,
z2 : Double,
radius2 : Double,
roundCap : Bool?,
) -> String {
let args : Map[String, Json] = {}
args.set("latticeId", Json::string(latticeId))
args.set("x1", Json::number(x1))
args.set("y1", Json::number(y1))
args.set("z1", Json::number(z1))
args.set("radius1", Json::number(radius1))
args.set("x2", Json::number(x2))
args.set("y2", Json::number(y2))
args.set("z2", Json::number(z2))
args.set("radius2", Json::number(radius2))
match roundCap {
Some(v) => args.set("roundCap", Json::boolean(v))
None => ()
}
self.call_tool("lattice_add_beam", args)
}
///|
/// lattice_add_sphere — lattice_add_sphere
/// Add a sphere node at a point in a lattice. Returns a confirmation.
///
/// Parameters:
/// - latticeId : String (required) — ID of the lattice object
/// - x : Double (required) — Center X
/// - y : Double (required) — Center Y
/// - z : Double (required) — Center Z
/// - radius : Double (required) — Radius in mm
///
pub async fn Client::lattice_add_sphere(
self : Client,
latticeId : String,
x : Double,
y : Double,
z : Double,
radius : Double,
) -> String {
let args : Map[String, Json] = {}
args.set("latticeId", Json::string(latticeId))
args.set("x", Json::number(x))
args.set("y", Json::number(y))
args.set("z", Json::number(z))
args.set("radius", Json::number(radius))
self.call_tool("lattice_add_sphere", args)
}
///|
/// lattice_to_voxels — lattice_to_voxels
/// Convert a lattice to voxels. Renders the lattice beams and nodes into a voxel field. Returns a new voxel object ID.
///
/// Parameters:
/// - latticeId : String (required) — ID of the lattice object
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::lattice_to_voxels(
self : Client,
latticeId : String,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("latticeId", Json::string(latticeId))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("lattice_to_voxels", args)
}
// === Mesh ===
///|
/// create_mesh — create_mesh
/// Create an empty mesh. Add vertices and triangles to build geometry. Returns the object ID.
///
/// Parameters:
/// - id : String? (optional) — Optional ID to assign
///
pub async fn Client::create_mesh(self : Client, id : String?) -> String {
let args : Map[String, Json] = {}
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("create_mesh", args)
}
///|
/// mesh_add_vertex — mesh_add_vertex
/// Add a vertex to a mesh. Returns the vertex index (0-based) for use in triangle creation.
///
/// Parameters:
/// - meshId : String (required) — ID of the mesh
/// - x : Double (required) — X coordinate
/// - y : Double (required) — Y coordinate
/// - z : Double (required) — Z coordinate
///
pub async fn Client::mesh_add_vertex(
self : Client,
meshId : String,
x : Double,
y : Double,
z : Double,
) -> String {
let args : Map[String, Json] = {}
args.set("meshId", Json::string(meshId))
args.set("x", Json::number(x))
args.set("y", Json::number(y))
args.set("z", Json::number(z))
self.call_tool("mesh_add_vertex", args)
}
///|
/// mesh_add_triangle — mesh_add_triangle
/// Add a triangle to a mesh using vertex indices. Returns the triangle index.
///
/// Parameters:
/// - meshId : String (required) — ID of the mesh
/// - a : Int (required) — Index of first vertex
/// - b : Int (required) — Index of second vertex
/// - c : Int (required) — Index of third vertex
///
pub async fn Client::mesh_add_triangle(
self : Client,
meshId : String,
a : Int,
b : Int,
c : Int,
) -> String {
let args : Map[String, Json] = {}
args.set("meshId", Json::string(meshId))
args.set("a", Json::number(a.to_double()))
args.set("b", Json::number(b.to_double()))
args.set("c", Json::number(c.to_double()))
self.call_tool("mesh_add_triangle", args)
}
///|
/// mesh_add_triangle_vertices — mesh_add_triangle_vertices
/// Add a triangle to a mesh by specifying three vertex positions directly. The vertices are added automatically. Returns the triangle index.
///
/// Parameters:
/// - meshId : String (required) — ID of the mesh
/// - x1 : Double (required) — Vertex 1 X
/// - y1 : Double (required) — Vertex 1 Y
/// - z1 : Double (required) — Vertex 1 Z
/// - x2 : Double (required) — Vertex 2 X
/// - y2 : Double (required) — Vertex 2 Y
/// - z2 : Double (required) — Vertex 2 Z
/// - x3 : Double (required) — Vertex 3 X
/// - y3 : Double (required) — Vertex 3 Y
/// - z3 : Double (required) — Vertex 3 Z
///
pub async fn Client::mesh_add_triangle_vertices(
self : Client,
meshId : String,
x1 : Double,
y1 : Double,
z1 : Double,
x2 : Double,
y2 : Double,
z2 : Double,
x3 : Double,
y3 : Double,
z3 : Double,
) -> String {
let args : Map[String, Json] = {}
args.set("meshId", Json::string(meshId))
args.set("x1", Json::number(x1))
args.set("y1", Json::number(y1))
args.set("z1", Json::number(z1))
args.set("x2", Json::number(x2))
args.set("y2", Json::number(y2))
args.set("z2", Json::number(z2))
args.set("x3", Json::number(x3))
args.set("y3", Json::number(y3))
args.set("z3", Json::number(z3))
self.call_tool("mesh_add_triangle_vertices", args)
}
///|
/// mesh_add_quad — mesh_add_quad
/// Add a quad to a mesh by specifying four vertex positions directly. The vertices are added automatically and two triangles are created. Use bFlipped=true to reverse the winding order. Returns the starting triangle index.
///
/// Parameters:
/// - meshId : String (required) — ID of the mesh
/// - x0 : Double (required) — Vertex 0 X
/// - y0 : Double (required) — Vertex 0 Y
/// - z0 : Double (required) — Vertex 0 Z
/// - x1 : Double (required) — Vertex 1 X
/// - y1 : Double (required) — Vertex 1 Y
/// - z1 : Double (required) — Vertex 1 Z
/// - x2 : Double (required) — Vertex 2 X
/// - y2 : Double (required) — Vertex 2 Y
/// - z2 : Double (required) — Vertex 2 Z
/// - x3 : Double (required) — Vertex 3 X
/// - y3 : Double (required) — Vertex 3 Y
/// - z3 : Double (required) — Vertex 3 Z
/// - flipped : Bool? (optional) — If true, reverse the winding order of the two triangles
///
pub async fn Client::mesh_add_quad(
self : Client,
meshId : String,
x0 : Double,
y0 : Double,
z0 : Double,
x1 : Double,
y1 : Double,
z1 : Double,
x2 : Double,
y2 : Double,
z2 : Double,
x3 : Double,
y3 : Double,
z3 : Double,
flipped : Bool?,
) -> String {
let args : Map[String, Json] = {}
args.set("meshId", Json::string(meshId))
args.set("x0", Json::number(x0))
args.set("y0", Json::number(y0))
args.set("z0", Json::number(z0))
args.set("x1", Json::number(x1))
args.set("y1", Json::number(y1))
args.set("z1", Json::number(z1))
args.set("x2", Json::number(x2))
args.set("y2", Json::number(y2))
args.set("z2", Json::number(z2))
args.set("x3", Json::number(x3))
args.set("y3", Json::number(y3))
args.set("z3", Json::number(z3))
match flipped {
Some(v) => args.set("flipped", Json::boolean(v))
None => ()
}
self.call_tool("mesh_add_quad", args)
}
///|
/// voxels_to_mesh — voxels_to_mesh
/// Convert a voxel object to a mesh using marching cubes. Returns a new mesh object ID.
///
/// Parameters:
/// - voxelsId : String (required) — ID of the voxel object
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::voxels_to_mesh(
self : Client,
voxelsId : String,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("voxelsId", Json::string(voxelsId))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("voxels_to_mesh", args)
}
///|
/// mesh_to_voxels — mesh_to_voxels
/// Convert a mesh to voxels. Returns a new voxel object ID.
///
/// Parameters:
/// - meshId : String (required) — ID of the mesh object
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::mesh_to_voxels(
self : Client,
meshId : String,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("meshId", Json::string(meshId))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("mesh_to_voxels", args)
}
///|
/// mesh_from_stl — mesh_from_stl
/// Load a mesh from an STL file on disk. Returns the object ID.
///
/// Parameters:
/// - path : String (required) — Full path to the STL file
/// - id : String? (optional) — Optional ID to assign
///
pub async fn Client::mesh_from_stl(
self : Client,
path : String,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("path", Json::string(resolve_path(path)))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("mesh_from_stl", args)
}
///|
/// mesh_transform — mesh_transform
/// Transform a mesh: apply uniform scale and/or translation. Returns a new mesh object ID.
///
/// Parameters:
/// - meshId : String (required) — ID of the source mesh
/// - scale : Double? (optional) — Scale factor (1.0 = no scale)
/// - translateX : Double? (optional) — Translation X
/// - translateY : Double? (optional) — Translation Y
/// - translateZ : Double? (optional) — Translation Z
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::mesh_transform(
self : Client,
meshId : String,
scale : Double?,
translateX : Double?,
translateY : Double?,
translateZ : Double?,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("meshId", Json::string(meshId))
match scale {
Some(v) => args.set("scale", Json::number(v))
None => ()
}
match translateX {
Some(v) => args.set("translateX", Json::number(v))
None => ()
}
match translateY {
Some(v) => args.set("translateY", Json::number(v))
None => ()
}
match translateZ {
Some(v) => args.set("translateZ", Json::number(v))
None => ()
}
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("mesh_transform", args)
}
///|
/// mesh_mirror — mesh_mirror
/// Mirror a mesh across a plane defined by a point and normal. Returns a new mesh object ID.
///
/// Parameters:
/// - meshId : String (required) — ID of the source mesh
/// - ptX : Double (required) — A point on the mirror plane X
/// - ptY : Double (required) — A point on the mirror plane Y
/// - ptZ : Double (required) — A point on the mirror plane Z
/// - nX : Double (required) — Mirror plane normal X
/// - nY : Double (required) — Mirror plane normal Y
/// - nZ : Double (required) — Mirror plane normal Z
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::mesh_mirror(
self : Client,
meshId : String,
ptX : Double,
ptY : Double,
ptZ : Double,
nX : Double,
nY : Double,
nZ : Double,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("meshId", Json::string(meshId))
args.set("ptX", Json::number(ptX))
args.set("ptY", Json::number(ptY))
args.set("ptZ", Json::number(ptZ))
args.set("nX", Json::number(nX))
args.set("nY", Json::number(nY))
args.set("nZ", Json::number(nZ))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("mesh_mirror", args)
}
///|
/// mesh_append — mesh_append
/// Append one mesh into another (modifies the target). Returns the target mesh ID.
///
/// Parameters:
/// - targetId : String (required) — ID of the target mesh (will be modified)
/// - sourceId : String (required) — ID of the source mesh (will be appended)
///
pub async fn Client::mesh_append(
self : Client,
targetId : String,
sourceId : String,
) -> String {
let args : Map[String, Json] = {}
args.set("targetId", Json::string(targetId))
args.set("sourceId", Json::string(sourceId))
self.call_tool("mesh_append", args)
}
// === Primitives ===
///|
/// create_sphere — create_sphere
/// Create a sphere voxel object. Returns the object ID.
///
/// Parameters:
/// - x : Double (required) — X coordinate of center in mm
/// - y : Double (required) — Y coordinate of center in mm
/// - z : Double (required) — Z coordinate of center in mm
/// - radius : Double (required) — Radius in mm
/// - id : String? (optional) — Optional ID to assign to this object
///
pub async fn Client::create_sphere(
self : Client,
x : Double,
y : Double,
z : Double,
radius : Double,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("x", Json::number(x))
args.set("y", Json::number(y))
args.set("z", Json::number(z))
args.set("radius", Json::number(radius))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("create_sphere", args)
}
///|
/// create_box — create_box
/// Create a box (axis-aligned cuboid) from minimum and maximum corner coordinates. Returns the object ID.
///
/// Parameters:
/// - minX : Double (required) — Minimum X
/// - minY : Double (required) — Minimum Y
/// - minZ : Double (required) — Minimum Z
/// - maxX : Double (required) — Maximum X
/// - maxY : Double (required) — Maximum Y
/// - maxZ : Double (required) — Maximum Z
/// - id : String? (optional) — Optional ID to assign to this object
///
pub async fn Client::create_box(
self : Client,
minX : Double,
minY : Double,
minZ : Double,
maxX : Double,
maxY : Double,
maxZ : Double,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("minX", Json::number(minX))
args.set("minY", Json::number(minY))
args.set("minZ", Json::number(minZ))
args.set("maxX", Json::number(maxX))
args.set("maxY", Json::number(maxY))
args.set("maxZ", Json::number(maxZ))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("create_box", args)
}
///|
/// create_cylinder — create_cylinder
/// Create a cylinder. By default it runs along the +Z axis from (x,y,z) to (x,y,z+height). Pass dirX/dirY/dirZ to orient the axis differently (the vector is normalized automatically). The cylinder has flat end caps. Returns the object ID.
///
/// Parameters:
/// - x : Double (required) — X coordinate of the bottom center
/// - y : Double (required) — Y coordinate of the bottom center
/// - z : Double (required) — Z coordinate of the bottom center
/// - radius : Double (required) — Radius in mm
/// - height : Double (required) — Height in mm (along the axis)
/// - dirX : Double? (optional) — Axis direction X (default 0 = +Z)
/// - dirY : Double? (optional) — Axis direction Y (default 0 = +Z)
/// - dirZ : Double? (optional) — Axis direction Z (default 1 = +Z). If all three are 0, +Z is used.
/// - id : String? (optional) — Optional ID to assign
///
pub async fn Client::create_cylinder(
self : Client,
x : Double,
y : Double,
z : Double,
radius : Double,
height : Double,
dirX : Double?,
dirY : Double?,
dirZ : Double?,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("x", Json::number(x))
args.set("y", Json::number(y))
args.set("z", Json::number(z))
args.set("radius", Json::number(radius))
args.set("height", Json::number(height))
match dirX {
Some(v) => args.set("dirX", Json::number(v))
None => ()
}
match dirY {
Some(v) => args.set("dirY", Json::number(v))
None => ()
}
match dirZ {
Some(v) => args.set("dirZ", Json::number(v))
None => ()
}
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("create_cylinder", args)
}
///|
/// create_capsule — create_capsule
/// Create a capsule (a sphere-swept line segment). Returns the object ID.
///
/// Parameters:
/// - x1 : Double (required) — Start point X
/// - y1 : Double (required) — Start point Y
/// - z1 : Double (required) — Start point Z
/// - x2 : Double (required) — End point X
/// - y2 : Double (required) — End point Y
/// - z2 : Double (required) — End point Z
/// - radius : Double (required) — Radius in mm
/// - id : String? (optional) — Optional ID to assign
///
pub async fn Client::create_capsule(
self : Client,
x1 : Double,
y1 : Double,
z1 : Double,
x2 : Double,
y2 : Double,
z2 : Double,
radius : Double,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("x1", Json::number(x1))
args.set("y1", Json::number(y1))
args.set("z1", Json::number(z1))
args.set("x2", Json::number(x2))
args.set("y2", Json::number(y2))
args.set("z2", Json::number(z2))
args.set("radius", Json::number(radius))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("create_capsule", args)
}
///|
/// create_torus — create_torus
/// Create a torus (donut shape) by revolving a circle around the Z axis. Returns the object ID.
///
/// Parameters:
/// - majorRadius : Double (required) — Major radius (distance from center to tube center) in mm
/// - minorRadius : Double (required) — Minor radius (tube radius) in mm
/// - x : Double? (optional) — X offset of center
/// - y : Double? (optional) — Y offset of center
/// - z : Double? (optional) — Z offset of center
/// - id : String? (optional) — Optional ID to assign
///
pub async fn Client::create_torus(
self : Client,
majorRadius : Double,
minorRadius : Double,
x : Double?,
y : Double?,
z : Double?,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("majorRadius", Json::number(majorRadius))
args.set("minorRadius", Json::number(minorRadius))
match x {
Some(v) => args.set("x", Json::number(v))
None => ()
}
match y {
Some(v) => args.set("y", Json::number(v))
None => ()
}
match z {
Some(v) => args.set("z", Json::number(v))
None => ()
}
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("create_torus", args)
}
// === Query ===
///|
/// get_bounding_box — get_bounding_box
/// Get the axis-aligned bounding box of any object. Returns min/max corners in mm. Retries internally with exponential backoff if the object was just created/transformed and the internal mesh conversion is not yet settled.
///
/// Parameters:
/// - objectId : String (required) — ID of the object to query
///
pub async fn Client::get_bounding_box(
self : Client,
objectId : String,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
self.call_tool("get_bounding_box", args)
}
///|
/// get_volume — get_volume
/// Calculate the volume and bounding box of a voxel object. Retries internally with exponential backoff if the object was just created/transformed.
///
/// Parameters:
/// - objectId : String (required) — ID of the voxel object
///
pub async fn Client::get_volume(self : Client, objectId : String) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
self.call_tool("get_volume", args)
}
///|
/// get_mesh_info — get_mesh_info
/// Get information about a mesh: vertex count, triangle count, bounding box.
///
/// Parameters:
/// - objectId : String (required) — ID of the mesh object
///
pub async fn Client::get_mesh_info(self : Client, objectId : String) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
self.call_tool("get_mesh_info", args)
}
///|
/// point_inside — point_inside
/// Check if a 3D point is inside a voxel object.
///
/// Parameters:
/// - objectId : String (required) — ID of the voxel object
/// - x : Double (required) — X coordinate
/// - y : Double (required) — Y coordinate
/// - z : Double (required) — Z coordinate
///
pub async fn Client::point_inside(
self : Client,
objectId : String,
x : Double,
y : Double,
z : Double,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("x", Json::number(x))
args.set("y", Json::number(y))
args.set("z", Json::number(z))
self.call_tool("point_inside", args)
}
///|
/// surface_normal — surface_normal
/// Get the surface normal vector at a point on a voxel object's surface.
///
/// Parameters:
/// - objectId : String (required) — ID of the voxel object
/// - x : Double (required) — X coordinate
/// - y : Double (required) — Y coordinate
/// - z : Double (required) — Z coordinate
///
pub async fn Client::surface_normal(
self : Client,
objectId : String,
x : Double,
y : Double,
z : Double,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("x", Json::number(x))
args.set("y", Json::number(y))
args.set("z", Json::number(z))
self.call_tool("surface_normal", args)
}
///|
/// closest_point — closest_point
/// Find the closest point on a voxel object's surface to a given point.
///
/// Parameters:
/// - objectId : String (required) — ID of the voxel object
/// - x : Double (required) — X coordinate of query point
/// - y : Double (required) — Y coordinate of query point
/// - z : Double (required) — Z coordinate of query point
///
pub async fn Client::closest_point(
self : Client,
objectId : String,
x : Double,
y : Double,
z : Double,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("x", Json::number(x))
args.set("y", Json::number(y))
args.set("z", Json::number(z))
self.call_tool("closest_point", args)
}
///|
/// list_objects — list_objects
/// List all objects in the current session with their IDs, types, and descriptions.
///
pub async fn Client::list_objects(self : Client) -> String {
let args : Map[String, Json] = {}
self.call_tool("list_objects", args)
}
///|
/// delete_object — delete_object
/// Delete an object from the session. Frees memory and removes the object from the registry.
///
/// Parameters:
/// - objectId : String (required) — ID of the object to delete
///
pub async fn Client::delete_object(self : Client, objectId : String) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
self.call_tool("delete_object", args)
}
///|
/// get_voxel_dimensions — get_voxel_dimensions
/// Get the voxel dimensions (grid size) of a voxel object.
///
/// Parameters:
/// - objectId : String (required) — ID of the voxel object
///
pub async fn Client::get_voxel_dimensions(
self : Client,
objectId : String,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
self.call_tool("get_voxel_dimensions", args)
}
///|
/// voxels_is_empty — voxels_is_empty
/// Check if a voxel object is empty (contains no volume). Useful for detecting failed operations — e.g. an intersection that produced no overlap, or a subtraction that removed all material.
///
/// Parameters:
/// - objectId : String (required) — ID of the voxel object
///
pub async fn Client::voxels_is_empty(
self : Client,
objectId : String,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
self.call_tool("voxels_is_empty", args)
}
///|
/// voxels_mem_usage — voxels_mem_usage
/// Get the memory usage of a voxel object in bytes. Useful for monitoring memory consumption when building complex models.
///
/// Parameters:
/// - objectId : String (required) — ID of the voxel object
///
pub async fn Client::voxels_mem_usage(
self : Client,
objectId : String,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
self.call_tool("voxels_mem_usage", args)
}
///|
/// voxels_is_equal — voxels_is_equal
/// Compare two voxel objects for equality. Returns true if they contain the same voxel data. Useful for verifying that a transform or round-trip preserved the shape.
///
/// Parameters:
/// - objectIdA : String (required) — ID of the first voxel object
/// - objectIdB : String (required) — ID of the second voxel object
///
pub async fn Client::voxels_is_equal(
self : Client,
objectIdA : String,
objectIdB : String,
) -> String {
let args : Map[String, Json] = {}
args.set("objectIdA", Json::string(objectIdA))
args.set("objectIdB", Json::string(objectIdB))
self.call_tool("voxels_is_equal", args)
}
///|
/// ray_cast — ray_cast
/// Cast a ray from a point in a given direction and find where it hits the surface of a voxel object. Useful for measuring wall thickness, checking bore clearance, and probing internal geometry. Returns the hit point and the distance from the origin, or an error if no intersection is found.
///
/// Parameters:
/// - objectId : String (required) — ID of the voxel object
/// - x : Double (required) — Origin X of the ray
/// - y : Double (required) — Origin Y of the ray
/// - z : Double (required) — Origin Z of the ray
/// - dirX : Double (required) — Ray direction X (need not be normalized)
/// - dirY : Double (required) — Ray direction Y
/// - dirZ : Double (required) — Ray direction Z
///
pub async fn Client::ray_cast(
self : Client,
objectId : String,
x : Double,
y : Double,
z : Double,
dirX : Double,
dirY : Double,
dirZ : Double,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("x", Json::number(x))
args.set("y", Json::number(y))
args.set("z", Json::number(z))
args.set("dirX", Json::number(dirX))
args.set("dirY", Json::number(dirY))
args.set("dirZ", Json::number(dirZ))
self.call_tool("ray_cast", args)
}
///|
/// measure_thickness — measure_thickness
/// Cast a ray from a point in both +direction and -direction and report both hit points and the total span between them. Measures the through-thickness of the object along the ray axis (surface to surface through the interior, which may cross internal cavities). For local wall thickness of a shell, place the origin inside the wall material and note that the total span includes all internal voids.
///
/// Parameters:
/// - objectId : String (required) — ID of the voxel object
/// - x : Double (required) — Origin X (ideally inside the wall/material)
/// - y : Double (required) — Origin Y
/// - z : Double (required) — Origin Z
/// - dirX : Double (required) — Measurement direction X (need not be normalized)
/// - dirY : Double (required) — Measurement direction Y
/// - dirZ : Double (required) — Measurement direction Z
///
pub async fn Client::measure_thickness(
self : Client,
objectId : String,
x : Double,
y : Double,
z : Double,
dirX : Double,
dirY : Double,
dirZ : Double,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("x", Json::number(x))
args.set("y", Json::number(y))
args.set("z", Json::number(z))
args.set("dirX", Json::number(dirX))
args.set("dirY", Json::number(dirY))
args.set("dirZ", Json::number(dirZ))
self.call_tool("measure_thickness", args)
}
///|
/// duplicate_object — duplicate_object
/// Create a duplicate (deep copy) of an existing object. Works with voxel and mesh objects. Returns the new object ID.
///
/// Parameters:
/// - objectId : String (required) — ID of the object to duplicate
/// - id : String? (optional) — Optional ID for the copy
///
pub async fn Client::duplicate_object(
self : Client,
objectId : String,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("duplicate_object", args)
}
///|
/// delete_objects — delete_objects
/// Delete multiple objects from the session in one call. Useful for cleaning up intermediate objects after a complex build. Returns the count of objects actually deleted.
///
/// Parameters:
/// - objectIds : Array[String] (required) — List of object IDs to delete
/// - keepOnly : Bool? (optional) — If true, delete ALL objects EXCEPT those in objectIds (keep-only mode). Default false = delete the listed objects.
///
pub async fn Client::delete_objects(
self : Client,
objectIds : Array[String],
keepOnly : Bool?,
) -> String {
let args : Map[String, Json] = {}
args.set("objectIds", Json::array(objectIds.map(fn(s) { Json::string(s) })))
match keepOnly {
Some(v) => args.set("keepOnly", Json::boolean(v))
None => ()
}
self.call_tool("delete_objects", args)
}
// === Render ===
///|
/// render_to_image — render_to_image
/// Render an object to a PNG image using an isometric projection with Lambertian shading. The agent can use this to visually inspect geometry. Returns the file path of the rendered image.
///
/// Parameters:
/// - objectId : String (required) — ID of the object to render (voxels or mesh)
/// - path : String (required) — Full path for the output PNG file
/// - width : Int? (optional) — Image width in pixels
/// - height : Int? (optional) — Image height in pixels
/// - backgroundColor : String? (optional) — Background color as hex (default: white)
/// - objectColor : String? (optional) — Object color as hex (default: steel blue)
///
pub async fn Client::render_to_image(
self : Client,
objectId : String,
path : String,
width : Int?,
height : Int?,
backgroundColor : String?,
objectColor : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("path", Json::string(resolve_path(path)))
match width {
Some(v) => args.set("width", Json::number(v.to_double()))
None => ()
}
match height {
Some(v) => args.set("height", Json::number(v.to_double()))
None => ()
}
match backgroundColor {
Some(v) => args.set("backgroundColor", Json::string(v))
None => ()
}
match objectColor {
Some(v) => args.set("objectColor", Json::string(v))
None => ()
}
self.call_tool("render_to_image", args)
}
///|
/// render_slice — render_slice
/// Render a Z-slice of a voxel object to a PNG image. Shows the cross-section at a specific height. Returns the file path.
///
/// Parameters:
/// - voxelsId : String (required) — ID of the voxel object
/// - zPosition : Double (required) — Z position in mm
/// - path : String (required) — Full path for the output PNG file
/// - mode : String? (optional) — Slice mode: Sdf, Bw, or Antialiased (default: Antialiased)
///
pub async fn Client::render_slice(
self : Client,
voxelsId : String,
zPosition : Double,
path : String,
mode : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("voxelsId", Json::string(voxelsId))
args.set("zPosition", Json::number(zPosition))
args.set("path", Json::string(resolve_path(path)))
match mode {
Some(v) => args.set("mode", Json::string(v))
None => ()
}
self.call_tool("render_slice", args)
}
// === Session ===
///|
/// picogk_init — picogk_init
/// Initialize the PicoGK geometry kernel. Must be called before any other tool. Sets the voxel resolution in millimeters. Smaller values = higher resolution but more memory. Typical range: 0.1mm (fine) to 5.0mm (coarse).
///
/// Parameters:
/// - voxelSizeMM : Double? (optional) — Voxel size in millimeters. Controls resolution. Use 0.5 for general purpose, 0.1 for fine detail, 2.0+ for large parts.
///
pub async fn Client::picogk_init(
self : Client,
voxelSizeMM : Double?,
) -> String {
let args : Map[String, Json] = {}
match voxelSizeMM {
Some(v) => args.set("voxelSizeMM", Json::number(v))
None => ()
}
self.call_tool("picogk_init", args)
}
///|
/// picogk_info — picogk_info
/// Get information about the PicoGK library and current session state. Returns version, memory usage, and counts of allocated objects.
///
pub async fn Client::picogk_info(self : Client) -> String {
let args : Map[String, Json] = {}
self.call_tool("picogk_info", args)
}
///|
/// picogk_shutdown — picogk_shutdown
/// Shut down the PicoGK session and release all resources. All object references become invalid after this call.
///
pub async fn Client::picogk_shutdown(self : Client) -> String {
let args : Map[String, Json] = {}
self.call_tool("picogk_shutdown", args)
}
// === Transforms ===
///|
/// offset — offset
/// Offset a voxel surface outward (positive) or inward (negative) by a distance. Use for thickening, thinning, or creating clearance. Returns a new object ID.
///
/// Parameters:
/// - objectId : String (required) — ID of the source object
/// - distance : Double (required) — Offset distance in mm. Positive = expand, negative = shrink.
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::offset(
self : Client,
objectId : String,
distance : Double,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("distance", Json::number(distance))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("offset", args)
}
///|
/// double_offset — double_offset
/// Offset a voxel surface twice: first by offset1, then by offset2. Enables precise morphological operations not possible with a single offset — e.g. offset out by 2mm then back by 1.5mm to remove thin features while preserving wall thickness. Returns a new object ID.
///
/// Parameters:
/// - objectId : String (required) — ID of the source object
/// - offset1 : Double (required) — First offset distance in mm (positive = expand, negative = shrink)
/// - offset2 : Double (required) — Second offset distance in mm (applied after the first offset)
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::double_offset(
self : Client,
objectId : String,
offset1 : Double,
offset2 : Double,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("offset1", Json::number(offset1))
args.set("offset2", Json::number(offset2))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("double_offset", args)
}
///|
/// over_offset — over_offset
/// Offset a voxel surface by a first distance, then settle the surface at a specified final distance from the original. More precise than fillet: lets you say 'offset by 3mm, then move the surface to exactly 0.5mm from where it started.' Useful for controlled material removal. Returns a new object ID.
///
/// Parameters:
/// - objectId : String (required) — ID of the source object
/// - firstOffset : Double (required) — First offset distance in mm (positive = expand)
/// - finalSurfaceDist : Double? (optional) — Final surface distance from the original surface in mm (default 0 = settle back to original)
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::over_offset(
self : Client,
objectId : String,
firstOffset : Double,
finalSurfaceDist : Double?,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("firstOffset", Json::number(firstOffset))
match finalSurfaceDist {
Some(v) => args.set("finalSurfaceDist", Json::number(v))
None => ()
}
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("over_offset", args)
}
///|
/// smooth — smooth
/// Smooth/round a voxel surface by applying triple offset. Good for removing sharp edges. Returns a new object ID.
///
/// Parameters:
/// - objectId : String (required) — ID of the source object
/// - distance : Double (required) — Smoothing distance in mm. Larger = smoother.
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::smooth(
self : Client,
objectId : String,
distance : Double,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("distance", Json::number(distance))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("smooth", args)
}
///|
/// trim — trim
/// Trim a voxel object to fit within a bounding box. Everything outside the box is removed. Returns a new object ID.
///
/// Parameters:
/// - objectId : String (required) — ID of the source object
/// - minX : Double (required) — Minimum X of trim box
/// - minY : Double (required) — Minimum Y of trim box
/// - minZ : Double (required) — Minimum Z of trim box
/// - maxX : Double (required) — Maximum X of trim box
/// - maxY : Double (required) — Maximum Y of trim box
/// - maxZ : Double (required) — Maximum Z of trim box
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::trim(
self : Client,
objectId : String,
minX : Double,
minY : Double,
minZ : Double,
maxX : Double,
maxY : Double,
maxZ : Double,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("minX", Json::number(minX))
args.set("minY", Json::number(minY))
args.set("minZ", Json::number(minZ))
args.set("maxX", Json::number(maxX))
args.set("maxY", Json::number(maxY))
args.set("maxZ", Json::number(maxZ))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("trim", args)
}
///|
/// shell — shell
/// Create a hollow shell from a voxel object. Both positive and negative offsets are applied. Returns a new object ID.
///
/// Parameters:
/// - objectId : String (required) — ID of the source object
/// - innerOffset : Double (required) — Inner wall offset in mm (positive = thinner walls)
/// - outerOffset : Double (required) — Outer wall offset in mm (positive = thicker walls)
/// - smooth : Double? (optional) — Smoothing for the shell walls in mm (0 = no smoothing)
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::shell(
self : Client,
objectId : String,
innerOffset : Double,
outerOffset : Double,
smooth : Double?,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("innerOffset", Json::number(innerOffset))
args.set("outerOffset", Json::number(outerOffset))
match smooth {
Some(v) => args.set("smooth", Json::number(v))
None => ()
}
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("shell", args)
}
///|
/// fillet — fillet
/// Fillets (rounds) the surface of a voxel object. Same as smooth but semantically for rounding edges. Returns a new object ID.
///
/// Parameters:
/// - objectId : String (required) — ID of the source object
/// - radius : Double (required) — Fillet radius in mm
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::fillet(
self : Client,
objectId : String,
radius : Double,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("radius", Json::number(radius))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("fillet", args)
}
///|
/// project_z_slice — project_z_slice
/// Project voxels onto a Z-plane (top-down silhouette). Useful for creating 2D cross-sections. Returns a new object ID.
///
/// Parameters:
/// - objectId : String (required) — ID of the source object
/// - startZ : Double (required) — Start Z position in mm
/// - endZ : Double (required) — End Z position in mm
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::project_z_slice(
self : Client,
objectId : String,
startZ : Double,
endZ : Double,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("startZ", Json::number(startZ))
args.set("endZ", Json::number(endZ))
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("project_z_slice", args)
}
///|
/// transform_voxels — transform_voxels
/// Transform a voxel object by translating, rotating, and/or scaling it. Rotations are applied first (around the world origin 0,0,0 — not the object's center), then translation. To rotate an object in place, first translate it to the origin, rotate, then translate back. Uses native PicoGK signed-distance-field re-rasterization (no expensive mesh round-trip), so it is efficient for large voxel fields. Returns a new object ID.
///
/// Parameters:
/// - objectId : String (required) — ID of the source voxel object
/// - translateX : Double? (optional) — Translation X in mm
/// - translateY : Double? (optional) — Translation Y in mm
/// - translateZ : Double? (optional) — Translation Z in mm
/// - rotateX : Double? (optional) — Rotation around X axis in degrees (pitch)
/// - rotateY : Double? (optional) — Rotation around Y axis in degrees (yaw)
/// - rotateZ : Double? (optional) — Rotation around Z axis in degrees (roll)
/// - scale : Double? (optional) — Uniform scale factor (1.0 = no change). Applied before rotation/translation.
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::transform_voxels(
self : Client,
objectId : String,
translateX : Double?,
translateY : Double?,
translateZ : Double?,
rotateX : Double?,
rotateY : Double?,
rotateZ : Double?,
scale : Double?,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
match translateX {
Some(v) => args.set("translateX", Json::number(v))
None => ()
}
match translateY {
Some(v) => args.set("translateY", Json::number(v))
None => ()
}
match translateZ {
Some(v) => args.set("translateZ", Json::number(v))
None => ()
}
match rotateX {
Some(v) => args.set("rotateX", Json::number(v))
None => ()
}
match rotateY {
Some(v) => args.set("rotateY", Json::number(v))
None => ()
}
match rotateZ {
Some(v) => args.set("rotateZ", Json::number(v))
None => ()
}
match scale {
Some(v) => args.set("scale", Json::number(v))
None => ()
}
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("transform_voxels", args)
}
///|
/// circular_pattern — circular_pattern
/// Create a circular (polar) pattern of a voxel object: rotate copies around an axis through a center point and union them into a single result. Uses SDF re-rasterization (no mesh round-trips) for each copy. Returns a new object ID containing all copies combined. Example: 4 bolt holes around a flange center at 90° intervals.
///
/// Parameters:
/// - objectId : String (required) — ID of the source voxel object to pattern
/// - count : Int (required) — Number of copies (including the original at angle 0)
/// - totalAngle : Double? (optional) — Total angular span in degrees (default 360 = full circle)
/// - centerX : Double? (optional) — Center point X of the rotation axis
/// - centerY : Double? (optional) — Center point Y of the rotation axis
/// - centerZ : Double? (optional) — Center point Z of the rotation axis
/// - axisX : Double? (optional) — Rotation axis direction X (default 0 = +Z axis)
/// - axisY : Double? (optional) — Rotation axis direction Y (default 0 = +Z axis)
/// - axisZ : Double? (optional) — Rotation axis direction Z (default 1 = +Z axis)
/// - id : String? (optional) — Optional ID for the result
///
pub async fn Client::circular_pattern(
self : Client,
objectId : String,
count : Int,
totalAngle : Double?,
centerX : Double?,
centerY : Double?,
centerZ : Double?,
axisX : Double?,
axisY : Double?,
axisZ : Double?,
id : String?,
) -> String {
let args : Map[String, Json] = {}
args.set("objectId", Json::string(objectId))
args.set("count", Json::number(count.to_double()))
match totalAngle {
Some(v) => args.set("totalAngle", Json::number(v))
None => ()
}
match centerX {
Some(v) => args.set("centerX", Json::number(v))
None => ()
}
match centerY {
Some(v) => args.set("centerY", Json::number(v))
None => ()
}
match centerZ {
Some(v) => args.set("centerZ", Json::number(v))
None => ()
}
match axisX {
Some(v) => args.set("axisX", Json::number(v))
None => ()
}
match axisY {
Some(v) => args.set("axisY", Json::number(v))
None => ()
}
match axisZ {
Some(v) => args.set("axisZ", Json::number(v))
None => ()
}
match id {
Some(v) => args.set("id", Json::string(v))
None => ()
}
self.call_tool("circular_pattern", args)
}