Documentation
Procedural modelling basics
The idea
We will build a padded crate covered in amber studs, in eight nodes. Along the way you will use the four moves you need for almost everything in Tessera: generate a shape, modify it, scatter points on it and copy something onto those points.
Conventions: Y is up, 1 unit = 1 metre, the ground is at y = 0.
Build it by hand
- Box. Right-click empty graph space, type
box, press Enter. Rename itbody. Setsizeto2 2 2,divisionsto2 2 2and turn onbottom_at_originso it sits on the ground. Double-click it to display it. - Extrude. With
bodyselected, addextrude(it is wired to the selected node automatically). Rename itpanels. Setdistance0.15,inset0.12 and turn onindividual: each face is pushed out separately with a bevelled border, like padded panels. Extrude writes the groupsextrude_frontandextrude_side, which you could use later. - Subdivide. Add
subdivideafterpanels, name itsmooth,depth1. Catmull-Clark rounds every panel into a soft cushion. Trydepth2 for smoother, oralgorithmlinearto add resolution without rounding. - Scatter. Add
scatteraftersmooth, name itspots:count80,pscale0.08. It places points on the surface, weighted by area, with a normalNand a scalepscaleon each. - Something to copy. Add a
spherenamedstud(not connected to anything):radius1,rows8,cols16. The radius is 1 becausepscaleon each point will scale it down to 0.08. - Copy to points. Add
copy_to_pointsnamedstuds. Connectstudto input 0 (what to copy) andspotsto input 1 (where). Each copy is oriented along the point normal and scaled bypscale. - Colour. Add
colorafterstudsnamedstud_color,color0.91 0.64 0.24. - Merge and output. Add
mergenamedalland connectsmoothandstud_colorinto it. Finish with anullnamedOUT_crateand give it the display flag. Press L to lay out the graph.
The result is about 9,600 points and 9,400 polygons: a padded cube about 2.3 m across with 80 studs.
Make it procedural
Now everything is a dial. Drag the numbers (press in a field and drag sideways):
spots.countfrom 80 to 400, or changespots.seedfor a new arrangement.panels.insetandpanels.distanceto change the cushion shape.body.sizeto4 1 2for a bench; everything downstream follows.- Make the studs breathe: set
spots.pscaleto=0.08 + 0.03*sin(F*0.2)and press Space. - Tie the stud size to the crate:
=ch("body.size")[0] * 0.04.
Bypass smooth (B) to compare hard panels with cushions. Move the display flag to spots to see the scattered points alone.
The same graph as ops
This is what the AI sends through edit_graph, and what you can POST to /api/ops. A node added with inputs becomes the display node unless you say otherwise.
{"ops": [
{"op":"add","type":"box","name":"body","params":{"size":[2,2,2],"divisions":[2,2,2],"bottom_at_origin":true}},
{"op":"add","type":"extrude","name":"panels","inputs":["body"],"params":{"distance":0.15,"inset":0.12,"individual":true}},
{"op":"add","type":"subdivide","name":"smooth","inputs":["panels"],"params":{"depth":1}},
{"op":"add","type":"scatter","name":"spots","inputs":["smooth"],"params":{"count":80,"pscale":0.08,"seed":1}},
{"op":"add","type":"sphere","name":"stud","params":{"radius":1,"rows":8,"cols":16}},
{"op":"add","type":"copy_to_points","name":"studs","inputs":["stud","spots"]},
{"op":"add","type":"color","name":"stud_color","inputs":["studs"],"params":{"color":[0.91,0.64,0.24]}},
{"op":"add","type":"merge","name":"all","inputs":["smooth","stud_color"]},
{"op":"add","type":"null","name":"OUT_crate","inputs":["all"],"display":true},
{"op":"layout"}
]}The same graph in Python
from tessera.client import Tessera
t = Tessera() # http://127.0.0.1:7419
t.add("box", "body", size=[2, 2, 2], divisions=[2, 2, 2], bottom_at_origin=True)
t.add("extrude", "panels", inputs=["body"], distance=0.15, inset=0.12, individual=True)
t.add("subdivide", "smooth", inputs=["panels"], depth=1)
t.add("scatter", "spots", inputs=["smooth"], count=80, pscale=0.08, seed=1)
t.add("sphere", "stud", radius=1, rows=8, cols=16)
t.add("copy_to_points", "studs", inputs=["stud", "spots"])
t.add("color", "stud_color", inputs=["studs"], color=[0.91, 0.64, 0.24])
t.add("merge", "all", inputs=["smooth", "stud_color"])
t.add("null", "OUT_crate", inputs=["all"])
t.display("OUT_crate")
print(t.cook()["geometry"])
t.render(view="persp", file="crate.png")
t.export("OUT_crate", "C:/temp/crate.glb")Where to go next
- Swap the sphere for a
rockortreeand scatter on agridrun throughmountain: a landscape. - Use
booleanto cut windows,sweepto run a profile along acurve,attrib_wranglefor anything custom. - Browse the node reference by category.