dymokomi/luced-3d
Source of release 0.11.6
0.11.6 / src / tool_solid_box.luc
## Solid Box: luce-cad's analytic solid (CadSolids), its faces named for
## the node. A node of a CAD network.
from luce_cad.cad_geometry import CadGeometry
from luce_cad.solids import CadSolids
from luce_cad.modeling import CadModeling
from tool_record import Tool, ToolEntry, Pick, Invocation
from geometry_data import GeometryData
from parameter_rows import Parameter, vector
import cad_cook
pub func entry() -> ToolEntry:
return ToolEntry("Solid Box", "Solid Box", "cube", "Create", [cad_cook.context], [], made)
func made() -> Tool:
let none_picked: list[Pick] = []
let rows: list[Parameter] = [vector("Size", 0, [20.0, 20.0, 20.0], "Width (X), height (Y) and depth (Z), centered on the origin.", 0.001, 100000.0)]
return entry().tool("Create", "Solids", "A box centered on the origin", none_picked, rows, cook)
func cook(call: Invocation, data: GeometryData, tag: str) -> GeometryData!:
let v = call.numbers
return GeometryData(geometry = CadGeometry.of_model(CadModeling.tagged(CadSolids.box(v[0], v[1], v[2]), tag)))