Last active
February 6, 2024 22:37
Revisions
-
simonreeves revised this gist
Aug 8, 2019 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,9 +7,12 @@ vector np_pos = point(1, 'P', np); // measure distance float dist = distance(@P, np_pos); // normalise distance dist = fit(dist, ch('in_min'), ch('in_max'), ch('out_min'), ch('out_max')); // remap with ramp dist = chramp('remap', dist); // set attribute f@dist = dist; -
simonreeves created this gist
Aug 8, 2019 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ // get nearest point index of second input int np = nearpoint(1, @P); // get that point's position vector np_pos = point(1, 'P', np); // measure distance float dist = distance(@P, np_pos); // rescale distance dist = fit(dist, ch('in_min'), ch('in_max'), ch('out_min'), ch('out_max')); // set attribute f@dist = dist;