# A small lit scene, compiled against schema/lmcad.dsl.json. out = ARGV.len() > 0 ? ARGV[0] : "build/still-life.dslb"; if (!file_exists("build")) { mkdir("build"); } if (!file_exists("build/rendered")) { mkdir("build/rendered"); } p = _lmcode_ cli="lmcad" install="github:lmctl-ai/lmcad@latest"; scene.background(0.08, 0.10, 0.16); let red = material().color(0.86, 0.22, 0.16).roughness(0.8); let blue = material().color(0.14, 0.40, 0.88); let gold = material().color(0.94, 0.64, 0.12); let box = scene.box(1.5, 0.9, 1.0, red).name("box"); box.translate(-1.15, -0.15, 0.0).scale(1.0, 1.0, 1.0).visible(true); let ball = scene.sphere(0.65, blue).name("sphere"); ball.translate(0.0, 0.1, 0.0); let can = scene.cylinder(0.48, 1.1, gold).name("cylinder"); can.translate(1.2, -0.05, 0.0).rotate(0.0, 0.15, 0.0); let camera = scene.camera(42.0, 4.8, 3.5, 7.0, 0.0, 0.0, 0.0); camera.look_at(4.8, 3.5, 7.0, 0.0, 0.0, 0.0).clipping(0.1, 100.0); let light = scene.directional_light(-0.6, -1.0, -0.7, 0.72); scene.fill_light(0.8, -0.2, 0.9, 0.42); scene.ambient(0.24); light.intensity(0.72); scene.render_png("build/still-life.png", 640, 480); scene.render_ppm("build/still-life.ppm", 64, 48); scene.export_obj("build/still-life.obj"); end _lmcode_ savedsl(p, out); println(f"wrote {out}"); run = system ${dsl_cli(p)} --lmcode ${out}; if (run.code != 0) { println(str(run.stderr)); lm_exit(run.code); }