[{"data":1,"prerenderedAt":727},["ShallowReactive",2],{"docs-menu":3,"docs-page:\u002Fdocs\u002Fexamples\u002Fvoronoi":193},[4,11,108,143],{"title":5,"path":6,"stem":7,"order":8,"summary":9,"exact":10},"Documentation","\u002Fdocs","docs\u002Findex",0,"How to build drawings with Wirepaint's node graph.",true,{"title":12,"order":13,"summary":14,"path":15,"stem":16,"children":17,"page":107,"exact":10},"Guides",1,null,"\u002Fdocs\u002Fguides","docs\u002Fguides",[18,23,29,35,41,47,53,59,65,71,77,83,89,95,101],{"title":19,"path":20,"stem":21,"order":13,"summary":22,"exact":10},"Getting started","\u002Fdocs\u002Fguides\u002Fgetting-started","docs\u002Fguides\u002Fgetting-started","The Playground's areas, and what each one is for.",{"title":24,"path":25,"stem":26,"order":27,"summary":28,"exact":10},"Navigating the editor","\u002Fdocs\u002Fguides\u002Fnavigating-the-editor","docs\u002Fguides\u002Fnavigating-the-editor",2,"Panning, zooming, selecting, moving and deleting in the graph editor.",{"title":30,"path":31,"stem":32,"order":33,"summary":34,"exact":10},"Adding nodes","\u002Fdocs\u002Fguides\u002Fadding-nodes","docs\u002Fguides\u002Fadding-nodes",3,"The add-node menu, its categories and search, and suggested nodes for a dropped link.",{"title":36,"path":37,"stem":38,"order":39,"summary":40,"exact":10},"Connecting pins","\u002Fdocs\u002Fguides\u002Fconnecting-pins","docs\u002Fguides\u002Fconnecting-pins",4,"Drawing wires between pins, replacing and moving them, and which pins fit together.",{"title":42,"path":43,"stem":44,"order":45,"summary":46,"exact":10},"Context menus","\u002Fdocs\u002Fguides\u002Fcontext-menus","docs\u002Fguides\u002Fcontext-menus",5,"The right-click actions for nodes, wires and empty canvas.",{"title":48,"path":49,"stem":50,"order":51,"summary":52,"exact":10},"Property inspector","\u002Fdocs\u002Fguides\u002Fproperty-inspector","docs\u002Fguides\u002Fproperty-inspector",6,"Editing a node's inputs: numbers, switches, text, drop-down lists and object fields.",{"title":54,"path":55,"stem":56,"order":57,"summary":58,"exact":10},"Live preview","\u002Fdocs\u002Fguides\u002Flive-preview","docs\u002Fguides\u002Flive-preview",7,"The drawing's page and its size, what lies outside it, panning and zooming, and downloading the image as SVG.",{"title":60,"path":61,"stem":62,"order":63,"summary":64,"exact":10},"Errors","\u002Fdocs\u002Fguides\u002Ferrors","docs\u002Fguides\u002Ferrors",8,"How the Playground shows a node that fails, and what it means for the drawing.",{"title":66,"path":67,"stem":68,"order":69,"summary":70,"exact":10},"Subgraphs","\u002Fdocs\u002Fguides\u002Fsubgraphs","docs\u002Fguides\u002Fsubgraphs",9,"Create subgraphs, edit their bodies and signatures, and use them as functions for Map, Filter, Reduce and Repeat.",{"title":72,"path":73,"stem":74,"order":75,"summary":76,"exact":10},"Saving and opening","\u002Fdocs\u002Fguides\u002Fsaving-and-opening","docs\u002Fguides\u002Fsaving-and-opening",10,"Keep your work in a file with the File menu, and open it again later.",{"title":78,"path":79,"stem":80,"order":81,"summary":82,"exact":10},"Freezing nodes","\u002Fdocs\u002Fguides\u002Ffreezing-nodes","docs\u002Fguides\u002Ffreezing-nodes",11,"Keep a node's result as it is, whatever happens to its inputs.",{"title":84,"path":85,"stem":86,"order":87,"summary":88,"exact":10},"Text","\u002Fdocs\u002Fguides\u002Ftext","docs\u002Fguides\u002Ftext",12,"Add text to a drawing, pick its font, and place it.",{"title":90,"path":91,"stem":92,"order":93,"summary":94,"exact":10},"Effects","\u002Fdocs\u002Fguides\u002Feffects","docs\u002Fguides\u002Feffects",13,"Shadows, blur, glow, grain, wobbly outlines, color changes, opacity and blend modes on any object.",{"title":96,"path":97,"stem":98,"order":99,"summary":100,"exact":10},"Undo and redo","\u002Fdocs\u002Fguides\u002Fundo-and-redo","docs\u002Fguides\u002Fundo-and-redo",14,"Take back an edit, or put it back, with the Edit menu or Ctrl+Z.",{"title":102,"path":103,"stem":104,"order":105,"summary":106,"exact":10},"Frames","\u002Fdocs\u002Fguides\u002Fframes","docs\u002Fguides\u002Fframes",15,"Draw titled frames around nodes to organize a graph.",false,{"title":109,"order":27,"summary":14,"path":110,"stem":111,"children":112,"page":107,"exact":10},"Concepts","\u002Fdocs\u002Fconcepts","docs\u002Fconcepts",[113,118,123,128,133,138],{"title":114,"path":115,"stem":116,"order":13,"summary":117,"exact":10},"Dataflow and the Output node","\u002Fdocs\u002Fconcepts\u002Fdataflow","docs\u002Fconcepts\u002Fdataflow","How a graph is evaluated, starting from the Output node, and what that means for what you build.",{"title":119,"path":120,"stem":121,"order":27,"summary":122,"exact":10},"Pin types and colors","\u002Fdocs\u002Fconcepts\u002Fpin-types","docs\u002Fconcepts\u002Fpin-types","What a pin's type says, which wires fit, and how colors and handle shapes show it.",{"title":124,"path":125,"stem":126,"order":33,"summary":127,"exact":10},"Generic pins","\u002Fdocs\u002Fconcepts\u002Fgeneric-pins","docs\u002Fconcepts\u002Fgeneric-pins","Pins whose type is set by what you connect, such as the T of the array nodes.",{"title":129,"path":130,"stem":131,"order":39,"summary":132,"exact":10},"Units and coordinates","\u002Fdocs\u002Fconcepts\u002Funits-and-coordinates","docs\u002Fconcepts\u002Funits-and-coordinates","Page coordinates, angles in radians, local and page positions, and the ranges of t, colors and lerps.",{"title":134,"path":135,"stem":136,"order":45,"summary":137,"exact":10},"Determinism and random","\u002Fdocs\u002Fconcepts\u002Fdeterminism","docs\u002Fconcepts\u002Fdeterminism","Why a graph always draws the same thing, how the random nodes fit in, and how to reroll them with seeds.",{"title":139,"path":140,"stem":141,"order":51,"summary":142,"exact":10},"Subgraphs and functions","\u002Fdocs\u002Fconcepts\u002Fsubgraphs","docs\u002Fconcepts\u002Fsubgraphs","Functions are graphs of their own, used as nodes or passed to Map, Filter, Reduce and Repeat.",{"title":144,"order":33,"summary":14,"path":145,"stem":146,"children":147,"page":107,"exact":10},"Examples","\u002Fdocs\u002Fexamples","docs\u002Fexamples",[148,153,158,163,168,173,178,183,188],{"title":149,"path":150,"stem":151,"order":13,"summary":152,"exact":10},"Blending two circles","\u002Fdocs\u002Fexamples\u002Fblending-circles","docs\u002Fexamples\u002Fblending-circles","A row of circles that grows and changes color, from two circles and Lerp.",{"title":154,"path":155,"stem":156,"order":27,"summary":157,"exact":10},"A whirl of squares","\u002Fdocs\u002Fexamples\u002Fwhirl-of-squares","docs\u002Fexamples\u002Fwhirl-of-squares","Squares that turn and shrink one step at a time, with Rotate and Scale.",{"title":159,"path":160,"stem":161,"order":33,"summary":162,"exact":10},"A hexagram from a circle","\u002Fdocs\u002Fexamples\u002Fhexagram","docs\u002Fexamples\u002Fhexagram","Two triangles made from points sampled on a circle, with Sample, Make Polygon and Rotate.",{"title":164,"path":165,"stem":166,"order":39,"summary":167,"exact":10},"Triangles on a grid","\u002Fdocs\u002Fexamples\u002Ftriangles-on-a-grid","docs\u002Fexamples\u002Ftriangles-on-a-grid","A triangle at every point of a grid, each turned a little more, with Orthogonal Grid, Map and a function made with New function…",{"title":169,"path":170,"stem":171,"order":45,"summary":172,"exact":10},"A glowing ball in a gradient frame","\u002Fdocs\u002Fexamples\u002Fgradients","docs\u002Fexamples\u002Fgradients","A ball filled with a radial gradient inside a square with a linear gradient outline, both from the same two color stops.",{"title":174,"path":175,"stem":176,"order":51,"summary":177,"exact":10},"Voronoi tessellation","\u002Fdocs\u002Fexamples\u002Fvoronoi","docs\u002Fexamples\u002Fvoronoi","Organic cell patterns from random points, evened out with Relax Points, and drawn with gaps using Scale and Map.",{"title":179,"path":180,"stem":181,"order":57,"summary":182,"exact":10},"Paper cut-out","\u002Fdocs\u002Fexamples\u002Fpaper-cut-out","docs\u002Fexamples\u002Fpaper-cut-out","Layered paper hills and a sun with wobbly edges, grain and soft shadows, made with the Displace, Noise and Drop Shadow effect nodes.",{"title":184,"path":185,"stem":186,"order":63,"summary":187,"exact":10},"Sierpinski triangle","\u002Fdocs\u002Fexamples\u002Fsierpinski-triangle","docs\u002Fexamples\u002Fsierpinski-triangle","A triangle made of three half-size triangles, each made the same way: a subgraph that calls itself, stopped by a Switch.",{"title":189,"path":190,"stem":191,"order":69,"summary":192,"exact":10},"Metaballs and contour lines","\u002Fdocs\u002Fexamples\u002Fmetaballs","docs\u002Fexamples\u002Fmetaballs","Gooey blobs from charges on a jittered grid, ringed by contour lines, with Zip Point Scalars, Metaballs and Isolines.",{"id":194,"title":174,"body":195,"description":722,"extension":723,"meta":724,"navigation":10,"order":51,"path":175,"seo":725,"stem":176,"summary":177,"__hash__":726},"docs\u002Fdocs\u002Fexamples\u002Fvoronoi.md",{"type":196,"value":197,"toc":710},"minimark",[198,211,216,219,224,229,241,258,284,300,315,401,408,415,419,442,448,453,457,475,486,490,502,509,544,550,562,568,578,582,613,617,675,679],[199,200,201,202,206,207,210],"p",{},"Voronoi tessellation splits an area into cells around a collection of points,\nwhere each cell covers the region closer to its point than to any other.\nIn this example, you'll start with points on a grid, jitter them into a random\ncloud, use ",[203,204,205],"strong",{},"Relax Points"," (Lloyd relaxation) to even them into a honeycomb\npattern, generate the cells with ",[203,208,209],{},"Voronoi",", and scale each cell to leave gaps between them.",[212,213],"example-figure",{"alt":214,"example":215},"Organic honeycomb-like cells generated from relaxed points with gaps between them","voronoi",[199,217,218],{},"You'll use: Make BoundingBox, Orthogonal Grid, Map (New function…),\nBreak Point, Random Number, Add, Make Point, Relax Points, Voronoi, Scale, Output.",[220,221,223],"h2",{"id":222},"steps","Steps",[225,226,228],"h3",{"id":227},"_1-generate-jittered-points","1. Generate jittered points",[199,230,231,232,235,236,240],{},"Add a ",[203,233,234],{},"Make BoundingBox"," node (",[237,238,239],"em",{},"Objects → BoundingBox → Make BoundingBox",") and set:",[242,243,244,252],"ul",{},[245,246,247,251],"li",{},[248,249,250],"code",{},"topLeft",": x 100, y 100;",[245,253,254,257],{},[248,255,256],{},"bottomRight",": x 900, y 700.",[199,259,260,261,235,264,267,268,271,272,275,276,279,280,283],{},"Add an ",[203,262,263],{},"Orthogonal Grid",[237,265,266],{},"Lattice → Orthogonal Grid",") and connect the\nbox's ",[248,269,270],{},"object"," to its ",[248,273,274],{},"area",". Set its ",[248,277,278],{},"x"," and ",[248,281,282],{},"y"," spacing to 100.",[199,285,231,286,235,289,292,293,271,296,299],{},[203,287,288],{},"Map",[237,290,291],{},"Array → Map",") and connect the grid's ",[248,294,295],{},"points",[248,297,298],{},"array",".",[199,301,302,303,306,307,310,311,314],{},"Drag a wire from Map's ",[248,304,305],{},"function"," input to empty canvas and choose ",[203,308,309],{},"New function…",".\nInside the function body (",[203,312,313],{},"Root › Map function","):",[242,316,317,332,351,368,381],{},[245,318,231,319,322,323,326,327,271,330,299],{},[203,320,321],{},"Break Point"," (",[237,324,325],{},"Objects → Point → Break Point",") and connect Graph Input's\n",[248,328,329],{},"element",[248,331,270],{},[245,333,334,335,338,339,342,343,346,347,350],{},"Add two ",[203,336,337],{},"Random Number"," nodes (",[237,340,341],{},"Math → Random Number","), each with ",[248,344,345],{},"min"," −35\nand ",[248,348,349],{},"max"," 35.",[245,352,334,353,338,356,359,360,363,364,367],{},[203,354,355],{},"Add",[237,357,358],{},"Math → Add","): connect ",[248,361,362],{},"element.x"," and the first random\nnumber to one, and ",[248,365,366],{},"element.y"," and the second random number to the other.",[245,369,231,370,235,373,376,377,279,379,299],{},[203,371,372],{},"Make Point",[237,374,375],{},"Objects → Point → Make Point",") and connect the\ntwo sums to its ",[248,378,278],{},[248,380,282],{},[245,382,383,384,387,388,391,392,395,396,398,399,299],{},"Select ",[203,385,386],{},"Graph Output",", change the type of ",[248,389,390],{},"result"," from number to ",[203,393,394],{},"Point",",\nand connect the new point's ",[248,397,270],{}," to ",[248,400,390],{},[199,402,403],{},[404,405],"img",{"alt":406,"src":407},"The function body jittering each grid point's x and y coordinates with random numbers","\u002Fdocs\u002Fexamples\u002Fvoronoi-jitter-body.png",[199,409,410,411,414],{},"Return to ",[203,412,413],{},"Root",". The Map node now outputs an array of jittered points.",[225,416,418],{"id":417},"_2-smooth-with-relax-points","2. Smooth with Relax Points",[199,420,231,421,235,423,426,427,429,430,432,433,429,435,437,438,441],{},[203,422,205],{},[237,424,425],{},"Tessellation → Relax Points","). Connect the\nbox's ",[248,428,270],{}," output to its ",[248,431,274],{},", Map's ",[248,434,298],{},[248,436,295],{},",\nand set ",[248,439,440],{},"iterations"," to 3.",[199,443,444],{},[404,445],{"alt":446,"src":447},"The Relax Points node connected to Make BoundingBox and Map","\u002Fdocs\u002Fexamples\u002Fvoronoi-relax-node.png",[199,449,450,452],{},[203,451,205],{}," applies Lloyd relaxation: in each iteration, every point\nmoves to the area centroid of its Voronoi cell. Over 3 iterations, the chaotic\njittered points even out into a harmonious, honeycomb-like distribution.",[225,454,456],{"id":455},"_3-generate-voronoi-cells","3. Generate Voronoi cells",[199,458,231,459,235,461,464,465,467,468,470,471,429,473,299],{},[203,460,209],{},[237,462,463],{},"Tessellation → Voronoi","). Connect the box's ",[248,466,270],{},"\noutput to its ",[248,469,274],{},", and Relax Points' ",[248,472,295],{},[248,474,295],{},[199,476,477,478,481,482,485],{},"Voronoi outputs ",[248,479,480],{},"cells",", an array of ",[203,483,484],{},"Polygon"," shapes covering the area.",[225,487,489],{"id":488},"_4-scale-cells-to-create-gaps","4. Scale cells to create gaps",[199,491,492,493,235,495,497,498,467,500,299],{},"Add a second ",[203,494,288],{},[237,496,291],{},") and connect Voronoi's ",[248,499,480],{},[248,501,298],{},[199,503,302,504,306,506,508],{},[248,505,305],{},[203,507,309],{},".\nInside the new function body:",[242,510,511,530],{},[245,512,231,513,235,516,519,520,522,523,525,526,529],{},[203,514,515],{},"Scale",[237,517,518],{},"Transform → Scale","). Connect Graph Input's ",[248,521,329],{},"\n(type Polygon) to its ",[248,524,270],{},", and set ",[248,527,528],{},"factor"," to 0.88.",[245,531,383,532,387,534,391,536,538,539,541,542,299],{},[203,533,386],{},[248,535,390],{},[203,537,484],{},",\nand connect Scale's ",[248,540,270],{}," output to ",[248,543,390],{},[199,545,546],{},[404,547],{"alt":548,"src":549},"The second function body scaling each polygon cell by factor 0.88","\u002Fdocs\u002Fexamples\u002Fvoronoi-scale-body.png",[199,551,410,552,554,555,558,559,299],{},[203,553,413],{},". Connect Map's output array to the ",[203,556,557],{},"Output"," node's ",[248,560,561],{},"objects",[199,563,564],{},[404,565],{"alt":566,"src":567},"The complete Voronoi graph: Make BoundingBox, Orthogonal Grid, Map (jitter), Relax Points, Voronoi, Map (scale), and Output","\u002Fdocs\u002Fexamples\u002Fvoronoi-graph.png",[199,569,570,571,574,575,577],{},"Because each Voronoi cell polygon's ",[248,572,573],{},"position"," is set to its area centroid,\n",[203,576,515],{}," shrinks each polygon around its own center, leaving uniform gaps\nbetween adjacent cells. The result is the mosaic at the top.",[220,579,581],{"id":580},"how-it-works","How it works",[242,583,584,595,604],{},[245,585,586,589,590,279,592,594],{},[203,587,588],{},"Jittering:"," Grid points are perfectly aligned. Adding a small random offset\nto each point's ",[248,591,278],{},[248,593,282],{}," breaks the regular grid into an organic cloud of points.",[245,596,597,600,601,603],{},[203,598,599],{},"Relaxation:"," Raw random points produce cells of very uneven size. ",[203,602,205],{},"\nmoves points toward the centroids of their cells, rapidly converging toward an even\ncentroidal Voronoi tessellation.",[245,605,606,609,610,612],{},[203,607,608],{},"Centroid transforms:"," Each returned cell polygon's transform position is its\narea centroid. When ",[203,611,515],{}," acts on a polygon, it scales around that centroid,\nshrinking each cell toward its middle and creating neat gaps between neighbours.",[220,614,616],{"id":615},"nodes-used","Nodes used",[242,618,619,637,642,647,655,660,665,670],{},[245,620,621,625,626,629,630,632,633,636],{},[622,623,234],"a",{"href":624},"\u002Fdocs\u002Ftypes\u002Fbounding-box",", ",[622,627,321],{"href":628},"\u002Fdocs\u002Ftypes\u002Fpoint",",\n",[622,631,372],{"href":628},", and ",[622,634,484],{"href":635},"\u002Fdocs\u002Ftypes\u002Fpolygon",", on their types' pages.",[245,638,639,299],{},[622,640,263],{"href":641},"\u002Fdocs\u002Fnodes\u002Flattice\u002Forthogonal",[245,643,644,299],{},[622,645,288],{"href":646},"\u002Fdocs\u002Fnodes\u002Farray\u002Fmap",[245,648,649,279,652,299],{},[622,650,337],{"href":651},"\u002Fdocs\u002Fnodes\u002Fmath\u002Frandom-number",[622,653,355],{"href":654},"\u002Fdocs\u002Fnodes\u002Fmath\u002Fadd",[245,656,657,299],{},[622,658,205],{"href":659},"\u002Fdocs\u002Fnodes\u002Ftessellation\u002Frelax-points",[245,661,662,299],{},[622,663,209],{"href":664},"\u002Fdocs\u002Fnodes\u002Ftessellation\u002Fvoronoi",[245,666,667,299],{},[622,668,515],{"href":669},"\u002Fdocs\u002Fnodes\u002Ftransform\u002Fscale",[245,671,672,299],{},[622,673,557],{"href":674},"\u002Fdocs\u002Fnodes\u002Fcore\u002Foutput",[220,676,678],{"id":677},"variations","Variations",[242,680,681,690,704],{},[245,682,683,686,687,689],{},[203,684,685],{},"Adjust iterations:"," Change ",[248,688,440],{}," on Relax Points to 0 for a raw\njittered pattern, or to 10 for highly uniform cells.",[245,691,692,695,696,699,700,703],{},[203,693,694],{},"Custom cell styling:"," Inside the cell-scaling function, add a ",[203,697,698],{},"Set Polygon","\nnode to style each cell's ",[248,701,702],{},"fill"," color using HSL or random colors.",[245,705,706,709],{},[203,707,708],{},"Points outside the area:"," Try adding points outside the bounding box. They\nwill shape border cells, and Relax Points will pull them into the area.",{"title":711,"searchDepth":27,"depth":27,"links":712},"",[713,719,720,721],{"id":222,"depth":27,"text":223,"children":714},[715,716,717,718],{"id":227,"depth":33,"text":228},{"id":417,"depth":33,"text":418},{"id":455,"depth":33,"text":456},{"id":488,"depth":33,"text":489},{"id":580,"depth":27,"text":581},{"id":615,"depth":27,"text":616},{"id":677,"depth":27,"text":678},"Voronoi tessellation splits an area into cells around a collection of points,\nwhere each cell covers the region closer to its point than to any other.\nIn this example, you'll start with points on a grid, jitter them into a random\ncloud, use Relax Points (Lloyd relaxation) to even them into a honeycomb\npattern, generate the cells with Voronoi, and scale each cell to leave gaps between them.","md",{},{"title":174,"description":722},"RJz6KGpetmuMbRBPaZxymho9DdqhBhwB4OTkv8WR1Sk",1795082912720]