dymokomi/luced-3d
Source of release 0.11.7
0.11.7 / examples / scripts / verb_chain.prisma
#prisma 4.0
def luced3d "scene" {
int display = 3
int next_id = 4
int scope = 2
int selected = 3
int take = 0
float64[4] time = [1, 1, 240, 24]
float64[4] tolerances = [0.01, 0.001, 0.0017453292519943296, 0.0050000000000000001]
str units = "mm"
int version = 1
def network "nodes" {
def Geo "n2" {
int edit_count = 0
bool enabled = true
str frozen = ""
int guard = 0
int held_actions = 0
str held_aligns = ""
str held_failure = ""
str held_file = ""
int held_input = 0
int held_key = 0
str held_note = ""
str[0] hidden = []
int id = 2
float64[0] inputs = []
str name = "Geo 2"
float64[48] parameters = [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
int parent = -1
float64[2] position = [40, 70]
float64[0] sources = []
str[3] texts = ["", "weight", "renamed"]
bool time_dependent = false
bool visible = true
def recipes "edits" {
}
}
def Script "n3" {
int edit_count = 0
bool enabled = true
str frozen = ""
int guard = 0
int held_actions = 0
str held_aligns = ""
str held_failure = ""
str held_file = ""
int held_input = 0
int held_key = 0
str held_note = ""
str[0] hidden = []
int id = 3
float64[2] inputs = [-1, -1]
str name = "Script 3"
float64[64] parameters = [30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0.14999999999999999, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
int parent = 2
float64[2] position = [0, 0]
float64[2] sources = [0, 0]
str[13] texts = ["", "## Verbs from code: a sphere, subdivided, its upper faces extruded, colored by height.\nfrom luce_geocore.script import Cook, Geometry, Verb, GroupKind\n\npub func cook(k: Cook*) -> !:\n var g = try Geometry.sphere(1.0, 12)\n var subdivide = try Verb.named(\"Subdivide\")\n try subdivide.parm(\"Levels\", (f64)k.i32(\"levels\", 2))\n var smooth = try subdivide.run(&g)\n # The sphere sits on the ground (y 0 to 2): extrude its upper faces, each on its own.\n var extrude = try Verb.named(\"PolyExtrude\")\n try extrude.parm(\"Distance\", (f64)k.f32(\"distance\", 0.15))\n try extrude.parm(\"Inset\", 0.02)\n try extrude.parm(\"Individual faces\", 1.0)\n try extrude.group(\"@P.y>1.3\", GroupKind.prims)\n var spiky = try extrude.run(&smooth)\n # Blue at the bottom to orange at the top.\n let box = try spiky.bounds()\n let low = (f32)box.minimum.y\n let span = (f32)(box.maximum.y - box.minimum.y)\n let colors = try spiky.point_vec3s(\"Cd\")\n let positions = try spiky.positions_view()\n for i in 0..<colors.length:\n let t = (positions[i].y - low) / span\n colors[i].x = t\n colors[i].y = 0.3\n colors[i].z = 1.0 - t\n print(f\"{spiky.prim_count()} faces\")\n try k.set_geometry(spiky)\n", "", "levels\t16\t1\t1\ndistance\t17\t1\t0", "", "", "", "", "", "", "", "", ""]
bool time_dependent = false
bool visible = true
def recipes "edits" {
}
}
}
def takes "takes" {
def take "t0" {
str[2] cameras = ["", ""]
float64[2] counts = [12, 0]
float64[2] enabled = [1, 1]
str[2] hidden = ["", ""]
float64[2] ids = [2, 3]
str name = "Main"
float64[12] transforms = [0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0]
float64[2] visible = [1, 1]
}
}
def editor_view "view" {
float64[3] network = [1, 0, 0]
float64[46] panes = [0, 1, 1, -1, 0, 1.5707963267948966, 9, 0, 0.80000000000000004, 0, 0, 1, 45, 0, -1, 0.69999999999999996, 0.55000000000000004, 6.4063071472109163, 0, 1.0669498248025775, 0, 0, 0, 45, 3, -1, 0, 0, 9, 0, 0.80000000000000004, 0, 0, 1, 45, 6, -1, 1.5707963267948966, 0, 9, 0, 0.80000000000000004, 0, 0, 1, 45]
}
}