[{"data":1,"prerenderedAt":755},["ShallowReactive",2],{"docs-menu":3,"docs-page:\u002Fdocs\u002Fexamples\u002Fsierpinski-triangle":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":184,"body":195,"description":750,"extension":751,"meta":752,"navigation":10,"order":63,"path":185,"seo":753,"stem":186,"summary":187,"__hash__":754},"docs\u002Fdocs\u002Fexamples\u002Fsierpinski-triangle.md",{"type":196,"value":197,"toc":736},"minimark",[198,207,212,215,220,225,248,259,281,303,307,316,374,378,381,495,502,506,559,571,575,585,607,616,622,626,629,632,636,675,679,714,718],[199,200,201,202,206],"p",{},"A triangle split into three smaller triangles, each of them split the\nsame way, five times over: 243 triangles. One subgraph does it, by\ncalling itself on each third, with a ",[203,204,205],"code",{},"depth"," that goes down by one on\nevery call. At depth 0 it stops and draws a single triangle.",[208,209],"example-figure",{"alt":210,"example":211},"A Sierpinski triangle of 243 small indigo triangles","sierpinski-triangle",[199,213,214],{},"You'll use: a subgraph, \"Sierpinski\" (Graph Input, Make Array, Make\nPolygon, Lerp Point, Subtract, three Sierpinski nodes, Concat, Lower or\nEquals, Switch, Graph Output), Output.",[216,217,219],"h2",{"id":218},"steps","Steps",[221,222,224],"h3",{"id":223},"_1-the-subgraph","1. The subgraph",[199,226,227,228,231,232,235,236,239,240,243,244,247],{},"Open the ",[229,230,66],"strong",{}," tab next to the inspector and click ",[229,233,234],{},"New\nsubgraph",". Rename it ",[229,237,238],{},"Sierpinski"," (double-click its name, type, press\n",[229,241,242],{},"Enter","). Its body opens: the breadcrumb reads ",[229,245,246],{},"Root › Sierpinski",".",[199,249,250,251,254,255,258],{},"Select ",[229,252,253],{},"Graph Input"," and click ",[229,256,257],{},"Add param"," four times. Name the params\nand set their types:",[260,261,262,268],"ul",{},[263,264,265,267],"li",{},[203,266,205],{},": number;",[263,269,270,273,274,273,277,280],{},[203,271,272],{},"a",", ",[203,275,276],{},"b",[203,278,279],{},"c",": Point (the triangle's corners).",[199,282,250,283,286,287,290,291,294,295,298,299,302],{},[229,284,285],{},"Graph Output",". Click ",[229,288,289],{},"Add result",", name it ",[203,292,293],{},"triangles",", and set\nits type to ",[229,296,297],{},"Polygon"," with ",[229,300,301],{},"Array\u003C…>",": the subgraph gives back all the\ntriangles it made.",[221,304,306],{"id":305},"_2-the-base-case-one-triangle","2. The base case: one triangle",[199,308,309,310,273,312,273,314,247],{},"At depth 0, the subgraph draws the triangle ",[203,311,272],{},[203,313,276],{},[203,315,279],{},[260,317,318,342,359],{},[263,319,320,321,324,325,329,330,273,332,334,335,337,338,341],{},"Add a ",[229,322,323],{},"Make Array"," node (",[326,327,328],"em",{},"Array",") and connect Graph Input's ",[203,331,272],{},[203,333,276],{},"\nand ",[203,336,279],{}," to its ",[203,339,340],{},"items",", in that order.",[263,343,320,344,324,347,350,351,354,355,358],{},[229,345,346],{},"Make Polygon",[326,348,349],{},"Objects → Polygon","), connect the array to\nits ",[203,352,353],{},"vertices",", and set its ",[203,356,357],{},"fill"," to r 79, g 70, b 229.",[263,360,361,362,364,365,368,369,371,372,247],{},"Add a second ",[229,363,323],{}," and connect the polygon's ",[203,366,367],{},"object"," to its\n",[203,370,340],{},": an array of one triangle, the same type as ",[203,373,293],{},[221,375,377],{"id":376},"_3-three-smaller-triangles","3. Three smaller triangles",[199,379,380],{},"The midpoints of the sides split the triangle into three corner\ntriangles, half as big.",[260,382,383,430,447,481],{},[263,384,385,386,389,390,393,394,397,398,400,401,403,404,400,406,408,409,400,411,413,414,416,417,419,420,273,423,334,426,429],{},"Add three ",[229,387,388],{},"Lerp Point"," nodes (",[326,391,392],{},"Objects → Point","), each with ",[203,395,396],{},"t"," at\n0.5: one from ",[203,399,272],{}," to ",[203,402,276],{},", one from ",[203,405,276],{},[203,407,279],{}," and one from ",[203,410,279],{},[203,412,272],{},"\n(Graph Input's points to their ",[203,415,272],{}," and ",[203,418,276],{},"). Rename them ",[229,421,422],{},"ab",[229,424,425],{},"bc",[229,427,428],{},"ca"," (F2) to keep them apart.",[263,431,320,432,324,435,438,439,337,441,443,444,446],{},[229,433,434],{},"Subtract",[326,436,437],{},"Math","), connect ",[203,440,205],{},[203,442,272],{}," and set ",[203,445,276],{},"\nto 1.",[263,448,385,449,389,451,454,455,458,459,461,462],{},[229,450,238],{},[326,452,453],{},"Subgraph","): the subgraph's own node,\noffered inside its body. Connect Subtract's ",[203,456,457],{},"result"," to each one's\n",[203,460,205],{},", and their corners:\n",[260,463,464,470,476],{},[263,465,466,467,469],{},"the top one: ",[203,468,272],{},", ab, ca;",[263,471,472,473,475],{},"the right one: ab, ",[203,474,276],{},", bc;",[263,477,478,479,247],{},"the left one: ca, bc, ",[203,480,279],{},[263,482,320,483,324,486,488,489,491,492,247],{},[229,484,485],{},"Concat",[326,487,328],{},") and connect the three nodes' ",[203,490,293],{},"\nto its ",[203,493,494],{},"arrays",[199,496,497],{},[498,499],"img",{"alt":500,"src":501},"The body: Graph Input's corners go to Make Array and Make Polygon for the base case, and through three Lerp Points to three Sierpinski nodes, whose triangles Concat joins","\u002Fdocs\u002Fexamples\u002Fsierpinski-body.png",[221,503,505],{"id":504},"_4-when-to-stop","4. When to stop",[260,507,508,525,551],{},[263,509,320,510,324,513,516,517,337,519,521,522,524],{},[229,511,512],{},"Lower or Equals",[326,514,515],{},"Logic",") and connect ",[203,518,205],{},[203,520,272],{},"\n(",[203,523,276],{}," stays 0).",[263,526,320,527,324,530,532,533,535,536,539,540,543,544,547,548,247],{},[229,528,529],{},"Switch",[326,531,515],{},"). Connect Lower or Equals' ",[203,534,457],{}," to\nits ",[203,537,538],{},"condition",", the one-triangle array to ",[203,541,542],{},"then",", and Concat's ",[203,545,546],{},"array","\nto ",[203,549,550],{},"else",[263,552,553,554,556,557,247],{},"Connect Switch's ",[203,555,457],{}," to Graph Output's ",[203,558,293],{},[199,560,561,562,564,565,567,568,570],{},"At depth 0, Switch takes ",[203,563,542],{}," and draws one triangle. Above it, Switch\ntakes ",[203,566,550],{},": three Sierpinski calls with ",[203,569,205],{}," − 1. Switch evaluates\nonly the branch it picks, so at depth 0 the three calls aren't made.",[221,572,574],{"id":573},"_5-drawing-it","5. Drawing it",[199,576,577,578,581,582,584],{},"Click ",[229,579,580],{},"Root"," in the breadcrumb. Add a ",[229,583,238],{}," node and set:",[260,586,587,592,597,602],{},[263,588,589,591],{},[203,590,205],{},": 5;",[263,593,594,596],{},[203,595,272],{},": x 500, y 40;",[263,598,599,601],{},[203,600,276],{},": x 960, y 760;",[263,603,604,606],{},[203,605,279],{},": x 40, y 760.",[199,608,609,610,612,613,247],{},"Connect its ",[203,611,293],{}," to the Output node's ",[203,614,615],{},"objects",[199,617,618],{},[498,619],{"alt":620,"src":621},"The main graph: the Sierpinski node with depth 5, connected to Output, and the triangle drawn on the page","\u002Fdocs\u002Fexamples\u002Fsierpinski-graph.png",[216,623,625],{"id":624},"how-it-works","How it works",[199,627,628],{},"The Sierpinski node in the main graph calls the subgraph with depth 5.\nThat call makes three calls with depth 4, each of which makes three with\ndepth 3, and so on, down to depth 0: 3⁵ = 243 calls draw a triangle each,\nand every level joins the triangles of its three calls with Concat.",[199,630,631],{},"Each call gets its own corners, half the size of its caller's, so the\ntriangles at the bottom are 1\u002F32 of the big one.",[216,633,635],{"id":634},"nodes-used","Nodes used",[260,637,638,647,656,661,669],{},[263,639,640,643,644,247],{},[272,641,323],{"href":642},"\u002Fdocs\u002Fnodes\u002Farray\u002Fmake"," and\n",[272,645,485],{"href":646},"\u002Fdocs\u002Fnodes\u002Farray\u002Fconcat",[263,648,649,643,652,655],{},[272,650,346],{"href":651},"\u002Fdocs\u002Ftypes\u002Fpolygon",[272,653,388],{"href":654},"\u002Fdocs\u002Ftypes\u002Fpoint",", on their types' pages.",[263,657,658,247],{},[272,659,434],{"href":660},"\u002Fdocs\u002Fnodes\u002Fmath\u002Fsubtract",[263,662,663,643,666,247],{},[272,664,512],{"href":665},"\u002Fdocs\u002Fnodes\u002Flogic\u002Flower-or-equals",[272,667,529],{"href":668},"\u002Fdocs\u002Fnodes\u002Flogic\u002Fswitch",[263,670,671,247],{},[272,672,674],{"href":673},"\u002Fdocs\u002Fnodes\u002Fcore\u002Foutput","Output",[216,676,678],{"id":677},"variations","Variations",[260,680,681,691,700],{},[263,682,683,686,687,247],{},[229,684,685],{},"Deeper or shallower."," Each level triples the number of calls: depth\n8 makes 9 841 calls, the most that fits in the limit of 10 000; depth 9\nfails with \"More than 10 000 calls\". See\n",[272,688,690],{"href":689},"\u002Fdocs\u002Fguides\u002Fsubgraphs#limits","Limits",[263,692,693,696,697,699],{},[229,694,695],{},"No base case."," Connect Concat's ",[203,698,546],{}," straight to Graph Output,\nwithout the Switch: the calls never stop, and the Sierpinski node in the\nmain graph fails with \"Recursion deeper than 64 calls: check the base\ncase\".",[263,701,702,705,706,710,711,713],{},[229,703,704],{},"A colour per triangle."," Add a ",[272,707,709],{"href":708},"\u002Fdocs\u002Fnodes\u002Fcolor\u002Frandom","Random Color","\nnode to the body and connect it to the polygon's ",[203,712,357],{},". Every call draws\nits own colour, so each of the 243 triangles gets its own.",[216,715,717],{"id":716},"see-also","See also",[260,719,720,726,731],{},[263,721,722,725],{},[272,723,66],{"href":724},"\u002Fdocs\u002Fguides\u002Fsubgraphs#recursion",": recursion, base cases and\nlimits.",[263,727,728,247],{},[272,729,139],{"href":730},"\u002Fdocs\u002Fconcepts\u002Fsubgraphs#recursion",[263,732,733,735],{},[272,734,164],{"href":165},": a subgraph\ncalled by Map.",{"title":737,"searchDepth":27,"depth":27,"links":738},"",[739,746,747,748,749],{"id":218,"depth":27,"text":219,"children":740},[741,742,743,744,745],{"id":223,"depth":33,"text":224},{"id":305,"depth":33,"text":306},{"id":376,"depth":33,"text":377},{"id":504,"depth":33,"text":505},{"id":573,"depth":33,"text":574},{"id":624,"depth":27,"text":625},{"id":634,"depth":27,"text":635},{"id":677,"depth":27,"text":678},{"id":716,"depth":27,"text":717},"A triangle split into three smaller triangles, each of them split the\nsame way, five times over: 243 triangles. One subgraph does it, by\ncalling itself on each third, with a depth that goes down by one on\nevery call. At depth 0 it stops and draws a single triangle.","md",{},{"title":184,"description":750},"5znP3VMmHyuZfP7YQgA-6x-dXdkYkigrfEjOAYHo0p0",1795082912767]