[{"data":1,"prerenderedAt":621},["ShallowReactive",2],{"docs-menu":3,"docs-page:\u002Fdocs\u002Fexamples\u002Ftriangles-on-a-grid":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":164,"body":195,"description":616,"extension":617,"meta":618,"navigation":10,"order":39,"path":165,"seo":619,"stem":166,"summary":167,"__hash__":620},"docs\u002Fdocs\u002Fexamples\u002Ftriangles-on-a-grid.md",{"type":196,"value":197,"toc":603},"minimark",[198,207,212,215,220,225,237,254,280,304,308,318,325,352,356,359,431,437,440,444,459,465,469,478,484,491,495,528,532,588,592],[199,200,201,202,206],"p",{},"Sixty-three triangles on a grid, each turned a little more than the one\nbefore. The grid gives the points; ",[203,204,205],"strong",{},"Map"," calls a small function once per\npoint, and the function makes the triangle. It's the \"for each\" of node\ngraphs.",[208,209],"example-figure",{"alt":210,"example":211},"Rows of blue triangles on a grid, turning a little from one to the next","triangles-on-a-grid",[199,213,214],{},"You'll use: Make BoundingBox, Orthogonal Grid, Map, a function made with\nNew function… (Graph Input, Multiply, Make RegularPolygon, Graph Output),\nOutput.",[216,217,219],"h2",{"id":218},"steps","Steps",[221,222,224],"h3",{"id":223},"_1-the-grid","1. The grid",[199,226,227,228,231,232,236],{},"Add a ",[203,229,230],{},"Make BoundingBox"," node (",[233,234,235],"em",{},"Objects → BoundingBox → Make\nBoundingBox",") and set:",[238,239,240,248],"ul",{},[241,242,243,247],"li",{},[244,245,246],"code",{},"topLeft",": x 100, y 100;",[241,249,250,253],{},[244,251,252],{},"bottomRight",": x 900, y 700.",[199,255,256,257,231,260,263,264,267,268,271,272,275,276,279],{},"Add an ",[203,258,259],{},"Orthogonal Grid",[233,261,262],{},"Lattice",") and connect the box's ",[244,265,266],{},"object","\nto its ",[244,269,270],{},"area",". Its ",[244,273,274],{},"x"," and ",[244,277,278],{},"y"," spacing stay at 100: the grid has 9 columns\nof 7 points, 100 apart.",[199,281,227,282,231,284,287,288,291,292,295,296,299,300,303],{},[203,283,205],{},[233,285,286],{},"Array",") and connect the grid's ",[244,289,290],{},"points"," to its\n",[244,293,294],{},"array",". Map's ",[244,297,298],{},"function"," input now expects a function taking a ",[244,301,302],{},"Point",".",[221,305,307],{"id":306},"_2-a-new-function","2. A new function",[199,309,310,311,313,314,317],{},"Drag a wire from Map's ",[244,312,298],{}," input and drop it on empty canvas. The\nmenu opens with ",[203,315,316],{},"New function…"," first: choose it.",[199,319,320],{},[321,322],"img",{"alt":323,"src":324},"Make BoundingBox, Orthogonal Grid, Map and Output, with the menu opened from Map's function input; New function… is its first entry","\u002Fdocs\u002Fguides\u002Fsubgraphs-new-function.png",[199,326,327,328,331,332,335,336,339,340,343,344,347,348,351],{},"A function node, \"Map function (function)\", appears where you dropped the\nwire, connected to Map, and its body opens: the breadcrumb above the\neditor reads ",[203,329,330],{},"Root › Map function",". The body has a ",[203,333,334],{},"Graph Input"," with\nthe params Map passes, ",[244,337,338],{},"element"," (a Point) and ",[244,341,342],{},"index"," (a number), and a\n",[203,345,346],{},"Graph Output"," with one result, ",[244,349,350],{},"result",", a number for now.",[221,353,355],{"id":354},"_3-the-triangle","3. The triangle",[199,357,358],{},"In the body:",[238,360,361,388,413],{},[241,362,227,363,231,366,369,370,373,374,377,378,381,382,384,385,303],{},[203,364,365],{},"Make RegularPolygon",[233,367,368],{},"Objects → RegularPolygon",") and set\n",[244,371,372],{},"sides"," to 3, ",[244,375,376],{},"radius"," to 35 and ",[244,379,380],{},"fill"," to r 79, g 70, b 229. Connect\nGraph Input's ",[244,383,338],{}," to its ",[244,386,387],{},"position",[241,389,227,390,231,393,396,397,291,399,402,403,406,407,409,410,303],{},[203,391,392],{},"Multiply",[233,394,395],{},"Math","), connect Graph Input's ",[244,398,342],{},[244,400,401],{},"a",", set ",[244,404,405],{},"b"," to 0.1, and connect its ",[244,408,350],{}," to the polygon's\n",[244,411,412],{},"rotation",[241,414,415,416,418,419,421,422,425,426,428,429,303],{},"Select ",[203,417,346],{},". In the inspector, change the type of ",[244,420,350],{},"\nfrom number to ",[203,423,424],{},"RegularPolygon",". Then connect the polygon's ",[244,427,266],{},"\nto ",[244,430,350],{},[199,432,433],{},[321,434],{"alt":435,"src":436},"The body: Graph Input's element goes to the polygon's position and its index, through Multiply, to its rotation; Graph Output's result is a RegularPolygon","\u002Fdocs\u002Fexamples\u002Ftriangles-body.png",[199,438,439],{},"Nothing is drawn yet: Map isn't connected to the Output node.",[221,441,443],{"id":442},"_4-drawing-them","4. Drawing them",[199,445,446,447,450,451,454,455,458],{},"Click ",[203,448,449],{},"Root"," in the breadcrumb. Map's output is now an\n",[244,452,453],{},"Array\u003CRegularPolygon>",". Connect it to the Output node's ",[244,456,457],{},"objects",": an\narray connected there draws all its elements.",[199,460,461],{},[321,462],{"alt":463,"src":464},"The main graph: Make BoundingBox, Orthogonal Grid, Map with its function node, and Output, with the triangles drawn on the page","\u002Fdocs\u002Fexamples\u002Ftriangles-graph.png",[216,466,468],{"id":467},"how-it-works","How it works",[199,470,471,472,474,475,477],{},"Map calls the function once for each of the grid's 63 points, with the\npoint as ",[244,473,338],{}," and its position in the array as ",[244,476,342],{},", and collects\nthe 63 triangles in an array.",[199,479,480,481,483],{},"The grid lists its points column by column, top to bottom. So ",[244,482,342],{},"\ngoes 0 to 6 down the first column, 7 to 13 down the second, and so on,\nand each triangle is turned 0.1 radians more than the one above it.",[199,485,486,487,490],{},"The function only sees what Map passes it: it can't use the grid or other\nnodes of the main graph directly. To give it more values, connect them to\nMap's ",[244,488,489],{},"arguments",": each one becomes another param of the function.",[216,492,494],{"id":493},"nodes-used","Nodes used",[238,496,497,507,512,517,522],{},[241,498,499,502,503,506],{},[401,500,230],{"href":501},"\u002Fdocs\u002Ftypes\u002Fbounding-box"," and\n",[401,504,365],{"href":505},"\u002Fdocs\u002Ftypes\u002Fregular-polygon",", on their types'\npages.",[241,508,509,303],{},[401,510,259],{"href":511},"\u002Fdocs\u002Fnodes\u002Flattice\u002Forthogonal",[241,513,514,303],{},[401,515,205],{"href":516},"\u002Fdocs\u002Fnodes\u002Farray\u002Fmap",[241,518,519,303],{},[401,520,392],{"href":521},"\u002Fdocs\u002Fnodes\u002Fmath\u002Fmultiply",[241,523,524,303],{},[401,525,527],{"href":526},"\u002Fdocs\u002Fnodes\u002Fcore\u002Foutput","Output",[216,529,531],{"id":530},"variations","Variations",[238,533,534,544,569,578],{},[241,535,536,539,540,543],{},[203,537,538],{},"Random turns."," Replace Multiply with a ",[203,541,542],{},"Random Number"," node (min 0,\nmax 6.2832) inside the body: each call draws its own number, so every\ntriangle gets its own angle.",[241,545,546,549,550,554,555,558,559,561,562,565,566,568],{},[203,547,548],{},"The size, set outside."," Add a ",[401,551,553],{"href":552},"\u002Fdocs\u002Fnodes\u002Fmath\u002Fnumber","Number"," node\nto the main graph, set its ",[244,556,557],{},"value"," to 20 and connect it to Map's\n",[244,560,489],{},". Map now passes a third value, so it reports an error until\nthe function takes it: open the body, select Graph Input, click ",[203,563,564],{},"Add\nparam"," and connect the new param to the polygon's ",[244,567,376],{},". (New\nfunction… adds these params by itself for arguments that are already\nconnected.)",[241,570,571,574,575,577],{},[203,572,573],{},"Other shapes."," Set ",[244,576,372],{}," to 6 for hexagons, or use a Make Circle\nand change the result's type to Circle.",[241,579,580,583,584,303],{},[203,581,582],{},"Another grid."," Replace Orthogonal Grid with an\n",[401,585,587],{"href":586},"\u002Fdocs\u002Fnodes\u002Flattice\u002Fequilateral-triangle","Equilateral Triangle Grid",[216,589,591],{"id":590},"see-also","See also",[238,593,594,599],{},[241,595,596,598],{},[401,597,66],{"href":67},": the Subgraphs tab, signatures and\nNew function….",[241,600,601,303],{},[401,602,139],{"href":140},{"title":604,"searchDepth":27,"depth":27,"links":605},"",[606,612,613,614,615],{"id":218,"depth":27,"text":219,"children":607},[608,609,610,611],{"id":223,"depth":33,"text":224},{"id":306,"depth":33,"text":307},{"id":354,"depth":33,"text":355},{"id":442,"depth":33,"text":443},{"id":467,"depth":27,"text":468},{"id":493,"depth":27,"text":494},{"id":530,"depth":27,"text":531},{"id":590,"depth":27,"text":591},"Sixty-three triangles on a grid, each turned a little more than the one\nbefore. The grid gives the points; Map calls a small function once per\npoint, and the function makes the triangle. It's the \"for each\" of node\ngraphs.","md",{},{"title":164,"description":616},"bsSeFw-FnWtRDQWHmR-u--YNPqmHPiXYNlO90tz3Diw",1795082912672]