Skip to content

Instantly share code, notes, and snippets.

@thomasp85
Created February 26, 2018 19:33
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thomasp85/b8dfa5e5ca0de0f3382764239b3148d3 to your computer and use it in GitHub Desktop.
Save thomasp85/b8dfa5e5ca0de0f3382764239b3148d3 to your computer and use it in GitHub Desktop.
Particles on CRAN
library(tidygraph)
library(particles)
library(jsonlite)
library(magick)
# Prepare text polygons
text <- read_json('text.json')
par_text <- text$layers[[3]]$paths
on_text <- text$layers[[2]]$paths
cran_text <- text$layers[[1]]$paths
format_text <- function(text) {
m <- matrix(unlist(text$points), nrow = length(text$points), byrow = TRUE)
m[,2] <- -m[,2] + 300
m[,1] <- m[,1] - 400
m*0.125
}
par_text <- lapply(par_text, format_text)
on_text <- lapply(on_text, format_text)
cran_text <- lapply(cran_text, format_text)
# Define plot function
plot_particles <- function(sim) {
plot(position(sim), col = '#4E385E', xlim = c(-40, 40), ylim = c(-30, 30), pch = '.', axes = FALSE, xlab = NA, ylab = NA)
}
# Create and run simulation, capature plots with magick
sim <- image_graph(bg = '#FFFAEE')
create_empty(5000) %>%
mutate(x = runif(5000, -40, 40),
y = runif(5000, -10, 10),
y = ifelse(y > 0, y + 31, y - 31)) %>%
simulate(alpha_decay = 0, setup = predefined_genesis(x, y)) %>%
wield(trap_force, polygon = par_text, distance_falloff = 0.25, strength = 2, name = 'trap') %>%
wield(random_force, xmin = -.1, xmax = .1, ymin = -.1, ymax = .1) %>%
wield(collision_force, radius = 0.2, strength = 2) %>%
impose(velocity_constraint, vmin = 0.5) %>%
evolve(45, plot_particles) %>%
unwield('trap') %>%
wield(trap_force, polygon = cbind(c(-40, 40, 40, -40), c(-30, -30, 30, 30)), distance_falloff = 0, name = 'box') %>%
evolve(20, plot_particles) %>%
wield(trap_force, polygon = on_text, distance_falloff = 0.25, strength = 2, name = 'trap', include = sample(c(TRUE, FALSE), 1000, TRUE, c(0.75, 0.25))) %>%
evolve(30, plot_particles) %>%
unwield('trap') %>%
evolve(20, plot_particles) %>%
wield(trap_force, polygon = cran_text, distance_falloff = 0.25, strength = 2, name = 'trap', include = sample(c(TRUE, FALSE), 1000, TRUE, c(0.95, 0.05))) %>%
evolve(30, plot_particles) %>%
unwield('trap') %>%
unwield('box') %>%
wield(x_force, x = 0, strength = -.5) %>%
wield(y_force, y = 0, strength = -.5) %>%
evolve(20, plot_particles)
)
dev.off()
# Write animation
sim %>%
image_animate() %>%
image_write('particles.gif', format = 'gif')
{"layers":[{"name":"cran","paths":[{"name":"PathItem","points":[[547.4990234375,330.4541015625],[540.669921875,330.4541015625],[533.8408203125,330.4541015625],[527.01171875,330.4541015625],[520.1826171875,330.4541015625],[513.142578125,316.875],[506.1025390625,303.2958984375],[499.0625,289.716796875],[492.0224609375,276.1376953125],[491.90380859375,276.1376953125],[491.78515625,276.1376953125],[491.66650390625,276.1376953125],[491.5478515625,276.1376953125],[491.985794067383,282.165962219238],[492.298950195312,287.436218261719],[492.487045288086,291.94832611084],[492.5498046875,295.7021484375],[492.5498046875,304.39013671875],[492.5498046875,313.078125],[492.5498046875,321.76611328125],[492.5498046875,330.4541015625],[487.935546875,330.4541015625],[483.3212890625,330.4541015625],[478.70703125,330.4541015625],[474.0927734375,330.4541015625],[474.0927734375,311.1796875],[474.0927734375,291.9052734375],[474.0927734375,272.630859375],[474.0927734375,253.3564453125],[480.8955078125,253.3564453125],[487.6982421875,253.3564453125],[494.5009765625,253.3564453125],[501.3037109375,253.3564453125],[508.3173828125,266.7509765625],[515.3310546875,280.1455078125],[522.3447265625,293.5400390625],[529.3583984375,306.9345703125],[529.4375,306.9345703125],[529.5166015625,306.9345703125],[529.595703125,306.9345703125],[529.6748046875,306.9345703125],[529.35139465332,301.394439697266],[529.120727539062,296.427612304688],[528.982528686523,292.034088134766],[528.9365234375,288.2138671875],[528.9365234375,279.49951171875],[528.9365234375,270.78515625],[528.9365234375,262.07080078125],[528.9365234375,253.3564453125],[533.5771484375,253.3564453125],[538.2177734375,253.3564453125],[542.8583984375,253.3564453125],[547.4990234375,253.3564453125],[547.4990234375,272.630859375],[547.4990234375,291.9052734375],[547.4990234375,311.1796875]]},{"name":"PathItem","points":[[434.8583984375,298.9189453125],[434.02783203125,295.7548828125],[433.197265625,292.5908203125],[432.36669921875,289.4267578125],[431.5361328125,286.2626953125],[430.924591064453,283.998687744141],[430.250244140625,281.424682617188],[429.513275146484,278.540679931641],[428.7138671875,275.3466796875],[427.954040527344,272.235626220703],[427.3359375,269.598999023438],[426.859924316406,267.436798095703],[426.5263671875,265.7490234375],[426.231231689453,267.311279296875],[425.820556640625,269.30859375],[425.294525146484,271.740966796875],[424.6533203125,274.6083984375],[423.741882324219,278.441596984863],[422.4052734375,283.771179199219],[420.643859863281,290.597007751465],[418.4580078125,298.9189453125],[422.55810546875,298.9189453125],[426.658203125,298.9189453125],[430.75830078125,298.9189453125]]},{"name":"PathItem","points":[[442.9794921875,330.4541015625],[442.0302734375,326.841796875],[441.0810546875,323.2294921875],[440.1318359375,319.6171875],[439.1826171875,316.0048828125],[432.920166015625,316.0048828125],[426.65771484375,316.0048828125],[420.395263671875,316.0048828125],[414.1328125,316.0048828125],[413.1572265625,319.6171875],[412.181640625,323.2294921875],[411.2060546875,326.841796875],[410.23046875,330.4541015625],[404.5087890625,330.4541015625],[398.787109375,330.4541015625],[393.0654296875,330.4541015625],[387.34375,330.4541015625],[393.63232421875,311.1005859375],[399.9208984375,291.7470703125],[406.20947265625,272.3935546875],[412.498046875,253.0400390625],[419.446044921875,253.0400390625],[426.39404296875,253.0400390625],[433.342041015625,253.0400390625],[440.2900390625,253.0400390625],[446.65771484375,272.3935546875],[453.025390625,291.7470703125],[459.39306640625,311.1005859375],[465.7607421875,330.4541015625],[460.0654296875,330.4541015625],[454.3701171875,330.4541015625],[448.6748046875,330.4541015625]]},{"name":"PathItem","points":[[343.416015625,286.7373046875],[344.3916015625,286.7373046875],[345.3671875,286.7373046875],[346.3427734375,286.7373046875],[347.318359375,286.7373046875],[352.094116210938,286.134155273438],[355.50537109375,284.32470703125],[357.552124023438,281.308959960938],[358.234375,277.0869140625],[357.565307617188,273.603355407715],[355.55810546875,271.114929199219],[352.212768554688,269.621772766113],[347.529296875,269.1240234375],[346.5009765625,269.1240234375],[345.47265625,269.1240234375],[344.4443359375,269.1240234375],[343.416015625,269.1240234375],[343.416015625,273.52734375],[343.416015625,277.9306640625],[343.416015625,282.333984375]]},{"name":"PathItem","points":[[343.416015625,302.3994140625],[343.416015625,309.4130859375],[343.416015625,316.4267578125],[343.416015625,323.4404296875],[343.416015625,330.4541015625],[338.20849609375,330.4541015625],[333.0009765625,330.4541015625],[327.79345703125,330.4541015625],[322.5859375,330.4541015625],[322.5859375,311.1796875],[322.5859375,291.9052734375],[322.5859375,272.630859375],[322.5859375,253.3564453125],[328.90087890625,253.3564453125],[335.2158203125,253.3564453125],[341.53076171875,253.3564453125],[347.845703125,253.3564453125],[361.59619140625,254.7802734375],[371.41796875,259.0517578125],[377.31103515625,266.1708984375],[379.275390625,276.1376953125],[378.4580078125,282.456207275391],[376.005859375,288.016479492188],[371.9189453125,292.818511962891],[366.197265625,296.8623046875],[371.8134765625,305.26025390625],[377.4296875,313.658203125],[383.0458984375,322.05615234375],[388.662109375,330.4541015625],[382.755859375,330.4541015625],[376.849609375,330.4541015625],[370.943359375,330.4541015625],[365.037109375,330.4541015625],[360.9501953125,323.4404296875],[356.86328125,316.4267578125],[352.7763671875,309.4130859375],[348.689453125,302.3994140625],[347.37109375,302.3994140625],[346.052734375,302.3994140625],[344.734375,302.3994140625]]},{"name":"PathItem","points":[[286.83203125,269.3349609375],[283.318603515625,269.715637207031],[280.2138671875,270.857666015625],[277.517822265625,272.761047363281],[275.23046875,275.42578125],[273.407836914062,278.759651184082],[272.10595703125,282.670349121094],[271.324829101562,287.157737731934],[271.064453125,292.2216796875],[272.122436523438,301.95817565918],[275.29638671875,308.912475585938],[280.586303710938,313.084854125977],[287.9921875,314.4755859375],[290.530029296875,314.386596679688],[293.0283203125,314.11962890625],[295.487060546875,313.674682617188],[297.90625,313.0517578125],[300.308959960938,312.303726196289],[302.71826171875,311.483276367188],[305.134155273438,310.590133666992],[307.556640625,309.6240234375],[307.556640625,314.02734375],[307.556640625,318.4306640625],[307.556640625,322.833984375],[307.556640625,327.2373046875],[302.5732421875,329.106079101562],[297.2734375,330.44091796875],[291.6572265625,331.241821289062],[285.724609375,331.5087890625],[277.506286621094,330.8759765625],[270.306396484375,328.9775390625],[264.124938964844,325.8134765625],[258.9619140625,321.3837890625],[254.889831542969,315.757690429688],[251.981201171875,309.00439453125],[250.236022949219,301.123901367188],[249.654296875,292.1162109375],[249.936096191406,286.312408447266],[250.781494140625,280.870971679688],[252.190490722656,275.791900634766],[254.1630859375,271.0751953125],[256.664672851562,266.802337646484],[259.66064453125,263.053344726562],[263.151000976562,259.828216552734],[267.1357421875,257.126953125],[271.553894042969,254.993064880371],[276.344482421875,253.468688964844],[281.507507324219,252.55396270752],[287.04296875,252.2490234375],[293.222778320312,252.588569641113],[299.26416015625,253.607116699219],[305.167114257812,255.304527282715],[310.931640625,257.6806640625],[309.33642578125,261.78076171875],[307.7412109375,265.880859375],[306.14599609375,269.98095703125],[304.55078125,274.0810546875],[302.4150390625,273.118927001953],[300.279296875,272.235717773438],[298.1435546875,271.431427001953],[296.0078125,270.7060546875],[293.83251953125,270.106407165527],[291.578125,269.677917480469],[289.24462890625,269.420722961426]]}]},{"name":"on","paths":[{"name":"PathItem","points":[[479.734375,330.4541015625],[472.9052734375,330.4541015625],[466.076171875,330.4541015625],[459.2470703125,330.4541015625],[452.41796875,330.4541015625],[445.3779296875,316.875],[438.337890625,303.2958984375],[431.2978515625,289.716796875],[424.2578125,276.1376953125],[424.13916015625,276.1376953125],[424.0205078125,276.1376953125],[423.90185546875,276.1376953125],[423.783203125,276.1376953125],[424.220733642578,282.165962219238],[424.533935546875,287.436218261719],[424.722259521484,291.94832611084],[424.78515625,295.7021484375],[424.78515625,304.39013671875],[424.78515625,313.078125],[424.78515625,321.76611328125],[424.78515625,330.4541015625],[420.1708984375,330.4541015625],[415.556640625,330.4541015625],[410.9423828125,330.4541015625],[406.328125,330.4541015625],[406.328125,311.1796875],[406.328125,291.9052734375],[406.328125,272.630859375],[406.328125,253.3564453125],[413.130859375,253.3564453125],[419.93359375,253.3564453125],[426.736328125,253.3564453125],[433.5390625,253.3564453125],[440.552734375,266.7509765625],[447.56640625,280.1455078125],[454.580078125,293.5400390625],[461.59375,306.9345703125],[461.6728515625,306.9345703125],[461.751953125,306.9345703125],[461.8310546875,306.9345703125],[461.91015625,306.9345703125],[461.586334228516,301.394439697266],[461.355712890625,296.427612304688],[461.217742919922,292.034088134766],[461.171875,288.2138671875],[461.171875,279.49951171875],[461.171875,270.78515625],[461.171875,262.07080078125],[461.171875,253.3564453125],[465.8125,253.3564453125],[470.453125,253.3564453125],[475.09375,253.3564453125],[479.734375,253.3564453125],[479.734375,272.630859375],[479.734375,291.9052734375],[479.734375,311.1796875]]},{"name":"PathItem","points":[[339.35546875,291.7998046875],[340.327621459961,301.582443237305],[343.244262695312,308.569702148438],[348.105667114258,312.761856079102],[354.912109375,314.1591796875],[358.611618041992,313.819839477539],[361.800170898438,312.801635742188],[364.478042602539,311.104293823242],[366.6455078125,308.7275390625],[368.317764282227,305.633171081543],[369.512573242188,301.780334472656],[370.22966003418,297.169166564941],[370.46875,291.7998046875],[370.226501464844,286.402839660645],[369.499755859375,281.760681152344],[368.288513183594,277.873191833496],[366.5927734375,274.740234375],[364.41569519043,272.329490661621],[361.760620117188,270.607360839844],[358.627822875977,269.57398223877],[355.017578125,269.2294921875],[348.165405273438,270.640205383301],[343.27099609375,274.872253417969],[340.334350585938,281.925498962402]]},{"name":"PathItem","points":[[392.40625,291.7998046875],[391.809555053711,300.945922851562],[390.019653320312,308.92529296875],[387.036819458008,315.737915039062],[382.861328125,321.3837890625],[377.534606933594,325.8134765625],[371.100830078125,328.9775390625],[363.559997558594,330.8759765625],[354.912109375,331.5087890625],[346.370239257812,330.872680664062],[338.88671875,328.96435546875],[332.461547851562,325.783813476562],[327.0947265625,321.3310546875],[322.860733032227,315.662521362305],[319.836791992188,308.833374023438],[318.02262878418,300.843887329102],[317.41796875,291.6943359375],[318.019332885742,282.639129638672],[319.823608398438,274.720825195312],[322.831069946289,267.939422607422],[327.0419921875,262.294921875],[332.399063110352,257.853904724121],[338.847534179688,254.681579589844],[346.387130737305,252.77808380127],[355.017578125,252.1435546875],[363.662307739258,252.773139953613],[371.193481445312,254.661804199219],[377.610824584961,257.809410095215],[382.9140625,262.2158203125],[387.06689453125,267.842193603516],[390.033203125,274.648315429688],[391.81298828125,282.634185791016]]}]},{"name":"particles","paths":[{"name":"PathItem","points":[[684.2646484375,307.0400390625],[684.037231445312,310.525863647461],[683.35498046875,313.810180664062],[682.217895507812,316.893264770508],[680.6259765625,319.775390625],[678.605453491211,322.402633666992],[676.182739257812,324.719604492188],[673.358108520508,326.726577758789],[670.1318359375,328.423828125],[666.555648803711,329.773498535156],[662.682739257812,330.737548828125],[658.513381958008,331.315979003906],[654.0478515625,331.5087890625],[650.352737426758,331.44108581543],[646.967895507812,331.238159179688],[643.893051147461,330.900283813477],[641.1279296875,330.427734375],[638.4912109375,329.787094116211],[635.8017578125,328.944946289062],[633.0595703125,327.901565551758],[630.2646484375,326.6572265625],[630.2646484375,322.0166015625],[630.2646484375,317.3759765625],[630.2646484375,312.7353515625],[630.2646484375,308.0947265625],[633.273666381836,309.540390014648],[636.341918945312,310.817504882812],[639.469680786133,311.926345825195],[642.6572265625,312.8671875],[645.80810546875,313.617004394531],[648.8271484375,314.152587890625],[651.71435546875,314.473937988281],[654.4697265625,314.5810546875],[656.634582519531,314.480529785156],[658.489990234375,314.178955078125],[660.035949707031,313.676330566406],[661.2724609375,312.97265625],[662.218383789062,312.110778808594],[662.89404296875,311.133544921875],[663.299438476562,310.040954589844],[663.4345703125,308.8330078125],[663.380187988281,308.066711425781],[663.217041015625,307.349853515625],[662.945129394531,306.682434082031],[662.564453125,306.064453125],[662.0634765625,305.469680786133],[661.4306640625,304.871704101562],[660.666015625,304.270248413086],[659.76953125,303.6650390625],[658.406265258789,302.900939941406],[656.242553710938,301.820068359375],[653.278121948242,300.422424316406],[649.5126953125,298.7080078125],[645.977294921875,297.007598876953],[642.91357421875,295.333374023438],[640.321533203125,293.685333251953],[638.201171875,292.0634765625],[636.437866210938,290.396026611328],[634.91845703125,288.609741210938],[633.642944335938,286.704620361328],[632.611328125,284.6806640625],[631.815368652344,282.502281188965],[631.246826171875,280.132507324219],[630.905700683594,277.571479797363],[630.7919921875,274.8193359375],[631.276489257812,269.786773681641],[632.72998046875,265.340698242188],[635.152465820312,261.481109619141],[638.5439453125,258.2080078125],[642.782333374023,255.60115814209],[647.745727539062,253.738952636719],[653.43440246582,252.621528625488],[659.8486328125,252.2490234375],[665.863510131836,252.595092773438],[671.937622070312,253.63330078125],[678.071243286133,255.363647460938],[684.2646484375,257.7861328125],[682.66943359375,261.80712890625],[681.07421875,265.828125],[679.47900390625,269.84912109375],[677.8837890625,273.8701171875],[672.6630859375,271.701622009277],[667.8115234375,270.152526855469],[663.3291015625,269.222969055176],[659.2158203125,268.9130859375],[657.32356262207,269.002075195312],[655.708618164062,269.26904296875],[654.370712280273,269.713989257812],[653.3095703125,270.3369140625],[652.501663208008,271.091743469238],[651.924926757812,271.932312011719],[651.579086303711,272.85848236084],[651.4638671875,273.8701171875],[651.610534667969,274.974517822266],[652.050537109375,276.019409179688],[652.783874511719,277.004791259766],[653.810546875,277.9306640625],[655.485961914062,279.011924743652],[658.1669921875,280.462097167969],[661.853637695312,282.281318664551],[666.5458984375,284.4697265625],[671.148620605469,286.752342224121],[674.989990234375,289.117126464844],[678.070007324219,291.56421661377],[680.388671875,294.09375],[682.084411621094,296.831130981445],[683.295654296875,299.901489257812],[684.022399902344,303.304550170898]]},{"name":"PathItem","points":[[620.3505859375,330.4541015625],[608.9072265625,330.4541015625],[597.4638671875,330.4541015625],[586.0205078125,330.4541015625],[574.5771484375,330.4541015625],[574.5771484375,311.1796875],[574.5771484375,291.9052734375],[574.5771484375,272.630859375],[574.5771484375,253.3564453125],[586.0205078125,253.3564453125],[597.4638671875,253.3564453125],[608.9072265625,253.3564453125],[620.3505859375,253.3564453125],[620.3505859375,257.53564453125],[620.3505859375,261.71484375],[620.3505859375,265.89404296875],[620.3505859375,270.0732421875],[614.11474609375,270.0732421875],[607.87890625,270.0732421875],[601.64306640625,270.0732421875],[595.4072265625,270.0732421875],[595.4072265625,273.10546875],[595.4072265625,276.1376953125],[595.4072265625,279.169921875],[595.4072265625,282.2021484375],[601.181640625,282.2021484375],[606.9560546875,282.2021484375],[612.73046875,282.2021484375],[618.5048828125,282.2021484375],[618.5048828125,286.38134765625],[618.5048828125,290.560546875],[618.5048828125,294.73974609375],[618.5048828125,298.9189453125],[612.73046875,298.9189453125],[606.9560546875,298.9189453125],[601.181640625,298.9189453125],[595.4072265625,298.9189453125],[595.4072265625,302.5576171875],[595.4072265625,306.1962890625],[595.4072265625,309.8349609375],[595.4072265625,313.4736328125],[601.64306640625,313.4736328125],[607.87890625,313.4736328125],[614.11474609375,313.4736328125],[620.3505859375,313.4736328125],[620.3505859375,317.71875],[620.3505859375,321.9638671875],[620.3505859375,326.208984375]]},{"name":"PathItem","points":[[511.7177734375,330.4541015625],[511.7177734375,311.1796875],[511.7177734375,291.9052734375],[511.7177734375,272.630859375],[511.7177734375,253.3564453125],[516.92529296875,253.3564453125],[522.1328125,253.3564453125],[527.34033203125,253.3564453125],[532.5478515625,253.3564453125],[532.5478515625,268.42529296875],[532.5478515625,283.494140625],[532.5478515625,298.56298828125],[532.5478515625,313.6318359375],[539.97021484375,313.6318359375],[547.392578125,313.6318359375],[554.81494140625,313.6318359375],[562.2373046875,313.6318359375],[562.2373046875,317.83740234375],[562.2373046875,322.04296875],[562.2373046875,326.24853515625],[562.2373046875,330.4541015625],[549.607421875,330.4541015625],[536.9775390625,330.4541015625],[524.34765625,330.4541015625]]},{"name":"PathItem","points":[[475.9638671875,269.3349609375],[472.450302124023,269.715637207031],[469.345336914062,270.857666015625],[466.64924621582,272.761047363281],[464.3623046875,275.42578125],[462.539672851562,278.759651184082],[461.23779296875,282.670349121094],[460.456665039062,287.157737731934],[460.1962890625,292.2216796875],[461.254272460938,301.95817565918],[464.42822265625,308.912475585938],[469.718139648438,313.084854125977],[477.1240234375,314.4755859375],[479.66145324707,314.386596679688],[482.159790039062,314.11962890625],[484.618759155273,313.674682617188],[487.0380859375,313.0517578125],[489.440246582031,312.303726196289],[491.849365234375,311.483276367188],[494.265441894531,310.590133666992],[496.6884765625,309.6240234375],[496.6884765625,314.02734375],[496.6884765625,318.4306640625],[496.6884765625,322.833984375],[496.6884765625,327.2373046875],[491.705078125,329.106079101562],[486.4052734375,330.44091796875],[480.7890625,331.241821289062],[474.8564453125,331.5087890625],[466.637985229492,330.8759765625],[459.437866210938,328.9775390625],[453.256362915039,325.8134765625],[448.09375,321.3837890625],[444.021667480469,315.757690429688],[441.113037109375,309.00439453125],[439.367858886719,301.123901367188],[438.7861328125,292.1162109375],[439.067932128906,286.312408447266],[439.913330078125,280.870971679688],[441.322326660156,275.791900634766],[443.294921875,271.0751953125],[445.796508789062,266.802337646484],[448.79248046875,263.053344726562],[452.282836914062,259.828216552734],[456.267578125,257.126953125],[460.685729980469,254.993064880371],[465.476318359375,253.468688964844],[470.639343261719,252.55396270752],[476.1748046875,252.2490234375],[482.354614257812,252.588569641113],[488.39599609375,253.607116699219],[494.298950195312,255.304527282715],[500.0634765625,257.6806640625],[498.46826171875,261.78076171875],[496.873046875,265.880859375],[495.27783203125,269.98095703125],[493.6826171875,274.0810546875],[491.546875,273.118927001953],[489.4111328125,272.235717773438],[487.275390625,271.431427001953],[485.1396484375,270.7060546875],[482.96435546875,270.106407165527],[480.7099609375,269.677917480469],[478.37646484375,269.420722961426]]},{"name":"PathItem","points":[[404.0341796875,330.4541015625],[404.0341796875,311.1796875],[404.0341796875,291.9052734375],[404.0341796875,272.630859375],[404.0341796875,253.3564453125],[409.26806640625,253.3564453125],[414.501953125,253.3564453125],[419.73583984375,253.3564453125],[424.9697265625,253.3564453125],[424.9697265625,272.630859375],[424.9697265625,291.9052734375],[424.9697265625,311.1796875],[424.9697265625,330.4541015625],[419.73583984375,330.4541015625],[414.501953125,330.4541015625],[409.26806640625,330.4541015625]]},{"name":"PathItem","points":[[374.2392578125,330.4541015625],[369.03173828125,330.4541015625],[363.82421875,330.4541015625],[358.61669921875,330.4541015625],[353.4091796875,330.4541015625],[353.4091796875,315.43798828125],[353.4091796875,300.421875],[353.4091796875,285.40576171875],[353.4091796875,270.3896484375],[348.70263671875,270.3896484375],[343.99609375,270.3896484375],[339.28955078125,270.3896484375],[334.5830078125,270.3896484375],[334.5830078125,266.13134765625],[334.5830078125,261.873046875],[334.5830078125,257.61474609375],[334.5830078125,253.3564453125],[349.1904296875,253.3564453125],[363.7978515625,253.3564453125],[378.4052734375,253.3564453125],[393.0126953125,253.3564453125],[393.0126953125,257.61474609375],[393.0126953125,261.873046875],[393.0126953125,266.13134765625],[393.0126953125,270.3896484375],[388.3193359375,270.3896484375],[383.6259765625,270.3896484375],[378.9326171875,270.3896484375],[374.2392578125,270.3896484375],[374.2392578125,285.40576171875],[374.2392578125,300.421875],[374.2392578125,315.43798828125]]},{"name":"PathItem","points":[[287.9658203125,286.7373046875],[288.94140625,286.7373046875],[289.9169921875,286.7373046875],[290.892578125,286.7373046875],[291.8681640625,286.7373046875],[296.643920898438,286.134155273438],[300.05517578125,284.32470703125],[302.101928710938,281.308959960938],[302.7841796875,277.0869140625],[302.115112304688,273.603355407715],[300.10791015625,271.114929199219],[296.762573242188,269.621772766113],[292.0791015625,269.1240234375],[291.05078125,269.1240234375],[290.0224609375,269.1240234375],[288.994140625,269.1240234375],[287.9658203125,269.1240234375],[287.9658203125,273.52734375],[287.9658203125,277.9306640625],[287.9658203125,282.333984375]]},{"name":"PathItem","points":[[287.9658203125,302.3994140625],[287.9658203125,309.4130859375],[287.9658203125,316.4267578125],[287.9658203125,323.4404296875],[287.9658203125,330.4541015625],[282.75830078125,330.4541015625],[277.55078125,330.4541015625],[272.34326171875,330.4541015625],[267.1357421875,330.4541015625],[267.1357421875,311.1796875],[267.1357421875,291.9052734375],[267.1357421875,272.630859375],[267.1357421875,253.3564453125],[273.45068359375,253.3564453125],[279.765625,253.3564453125],[286.08056640625,253.3564453125],[292.3955078125,253.3564453125],[306.14599609375,254.7802734375],[315.9677734375,259.0517578125],[321.86083984375,266.1708984375],[323.8251953125,276.1376953125],[323.0078125,282.456207275391],[320.5556640625,288.016479492188],[316.46875,292.818511962891],[310.7470703125,296.8623046875],[316.36328125,305.26025390625],[321.9794921875,313.658203125],[327.595703125,322.05615234375],[333.2119140625,330.4541015625],[327.3056640625,330.4541015625],[321.3994140625,330.4541015625],[315.4931640625,330.4541015625],[309.5869140625,330.4541015625],[305.5,323.4404296875],[301.4130859375,316.4267578125],[297.326171875,309.4130859375],[293.2392578125,302.3994140625],[291.9208984375,302.3994140625],[290.6025390625,302.3994140625],[289.2841796875,302.3994140625]]},{"name":"PathItem","points":[[227.9013671875,298.9189453125],[227.07080078125,295.7548828125],[226.240234375,292.5908203125],[225.40966796875,289.4267578125],[224.5791015625,286.2626953125],[223.967712402344,283.998687744141],[223.293701171875,281.424682617188],[222.557067871094,278.540679931641],[221.7578125,275.3466796875],[220.998107910156,272.235626220703],[220.380126953125,269.598999023438],[219.903869628906,267.436798095703],[219.5693359375,265.7490234375],[219.274353027344,267.311279296875],[218.864013671875,269.30859375],[218.338317871094,271.740966796875],[217.697265625,274.6083984375],[216.785949707031,278.441596984863],[215.449462890625,283.771179199219],[213.687805175781,290.597007751465],[211.5009765625,298.9189453125],[215.60107421875,298.9189453125],[219.701171875,298.9189453125],[223.80126953125,298.9189453125]]},{"name":"PathItem","points":[[236.0224609375,330.4541015625],[235.0732421875,326.841796875],[234.1240234375,323.2294921875],[233.1748046875,319.6171875],[232.2255859375,316.0048828125],[225.96337890625,316.0048828125],[219.701171875,316.0048828125],[213.43896484375,316.0048828125],[207.1767578125,316.0048828125],[206.201171875,319.6171875],[205.2255859375,323.2294921875],[204.25,326.841796875],[203.2744140625,330.4541015625],[197.552734375,330.4541015625],[191.8310546875,330.4541015625],[186.109375,330.4541015625],[180.3876953125,330.4541015625],[186.67626953125,311.1005859375],[192.96484375,291.7470703125],[199.25341796875,272.3935546875],[205.5419921875,253.0400390625],[212.48974609375,253.0400390625],[219.4375,253.0400390625],[226.38525390625,253.0400390625],[233.3330078125,253.0400390625],[239.70068359375,272.3935546875],[246.068359375,291.7470703125],[252.43603515625,311.1005859375],[258.8037109375,330.4541015625],[253.1083984375,330.4541015625],[247.4130859375,330.4541015625],[241.7177734375,330.4541015625]]},{"name":"PathItem","points":[[141.3115234375,287.8974609375],[142.2607421875,287.8974609375],[143.2099609375,287.8974609375],[144.1591796875,287.8974609375],[145.1083984375,287.8974609375],[147.334777832031,287.732734680176],[149.320556640625,287.238464355469],[151.065734863281,286.414512634277],[152.5703125,285.2607421875],[153.781555175781,283.817413330078],[154.646728515625,282.123413085938],[155.165832519531,280.178741455078],[155.3388671875,277.9833984375],[154.79833984375,274.569053649902],[153.1767578125,272.130065917969],[150.47412109375,270.666572570801],[146.6904296875,270.1787109375],[145.345703125,270.1787109375],[144.0009765625,270.1787109375],[142.65625,270.1787109375],[141.3115234375,270.1787109375],[141.3115234375,274.6083984375],[141.3115234375,279.0380859375],[141.3115234375,283.4677734375]]},{"name":"PathItem","points":[[176.4326171875,277.8779296875],[175.956359863281,283.970603942871],[174.527587890625,289.328063964844],[172.146301269531,293.95044708252],[168.8125,297.837890625],[164.601989746094,300.917907714844],[159.590576171875,303.117919921875],[153.778259277344,304.437927246094],[147.1650390625,304.8779296875],[145.70166015625,304.8779296875],[144.23828125,304.8779296875],[142.77490234375,304.8779296875],[141.3115234375,304.8779296875],[141.3115234375,311.27197265625],[141.3115234375,317.666015625],[141.3115234375,324.06005859375],[141.3115234375,330.4541015625],[136.10400390625,330.4541015625],[130.896484375,330.4541015625],[125.68896484375,330.4541015625],[120.4814453125,330.4541015625],[120.4814453125,311.1796875],[120.4814453125,291.9052734375],[120.4814453125,272.630859375],[120.4814453125,253.3564453125],[127.15234375,253.3564453125],[133.8232421875,253.3564453125],[140.494140625,253.3564453125],[147.1650390625,253.3564453125],[154.013916015625,253.755317687988],[159.953125,254.951843261719],[164.982666015625,256.94588470459],[169.1025390625,259.7373046875],[172.309448242188,263.264190673828],[174.60009765625,267.463256835938],[175.974487304688,272.334503173828]]}]}]}
@thomasp85
Copy link
Author

particles

@danielarantes
Copy link

How did you get this json file that defines the boundaries of the words???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment