Luce packages
LuceLuce BaseLuciaOS

dymokomi/luced-3d

Source of release 0.11.3

0.11.3 / examples / scripts / verb_chain.prisma

#prisma 4.0
def luced3d "scene" {
    int display = 2
    int next_id = 3
    bool preview = true
    int scope = -1
    int selected = 2
    int take = 0
    float64[4] time = [1, 1, 240, 24]
    str units = "mm"
    int version = 1
    def network "nodes" {
        def Script "n2" {
            int edit_count = 0
            bool enabled = true
            str frozen = ""
            int guard = 0
            str[0] hidden = []
            int id = 2
            float64[2] inputs = [-1, -1]
            str name = "Script 2"
            int output = 1
            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 = -1
            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[1] cameras = [""]
            float64[1] counts = [0]
            float64[1] enabled = [1]
            str[1] hidden = [""]
            float64[1] ids = [2]
            str name = "Main"
            float64[0] transforms = []
            float64[1] visible = [1]
        }
    }
    def editor_view "view" {
        float64[6] camera = [0.69999999999999996, 0.55000000000000004, 6.4063071472109163, 0, 1.0669498248025775, 0]
        float64[3] network = [1, 0, 0]
    }
}