Efficient method find distance each point to curves? - Grasshopper2024-03-28T15:25:46Zhttps://www.grasshopper3d.com/forum/topics/efficient-crvcp-in-cross-referencing-distance-each-point-to?feed=yes&xn_auth=noHere.
3 Steps:
1-Distance: ma…tag:www.grasshopper3d.com,2017-03-06:2985220:Comment:17063792017-03-06T17:15:29.957ZRiccardo Majewskihttps://www.grasshopper3d.com/profile/RiccardoMajewski
<p>Here.</p>
<p>3 Steps:</p>
<p>1-Distance: making subsets/clouds from main cloud, 1 for each curve</p>
<p>2-CP: refining/shrinking clouds using subsampled points from curves</p>
<p>3-Crv CP</p>
<p></p>
<p>In step 2 the slider maybe sould/should be optimized depending on the cloud size.</p>
<p>Step 2 could be repeated (increasing slider value on each step), or completely removed if cloud enough small.</p>
<p></p>
<p>In this case, 5000 points, 1-2-3 seems as fast as 1-3…</p>
<p>Here.</p>
<p>3 Steps:</p>
<p>1-Distance: making subsets/clouds from main cloud, 1 for each curve</p>
<p>2-CP: refining/shrinking clouds using subsampled points from curves</p>
<p>3-Crv CP</p>
<p></p>
<p>In step 2 the slider maybe sould/should be optimized depending on the cloud size.</p>
<p>Step 2 could be repeated (increasing slider value on each step), or completely removed if cloud enough small.</p>
<p></p>
<p>In this case, 5000 points, 1-2-3 seems as fast as 1-3 ....</p>
<p></p>
<p>Bye</p>
<p></p> Also, you could do it recursi…tag:www.grasshopper3d.com,2017-03-06:2985220:Comment:17062022017-03-06T13:49:30.728ZRiccardo Majewskihttps://www.grasshopper3d.com/profile/RiccardoMajewski
<p>Also, you could do it recursively.</p>
<p>Firs you do a very large sampling (few point > faster) , creating n clouds of points (subsets of starting cloud).</p>
<p></p>
<p>Then, with every curve having its own cloud, do the accurate "search and dispatch"...</p>
<p></p>
<p>Do more steps if massive starting cloud.</p>
<p>Also, you could do it recursively.</p>
<p>Firs you do a very large sampling (few point > faster) , creating n clouds of points (subsets of starting cloud).</p>
<p></p>
<p>Then, with every curve having its own cloud, do the accurate "search and dispatch"...</p>
<p></p>
<p>Do more steps if massive starting cloud.</p> Hi guys!
Have a look at this…tag:www.grasshopper3d.com,2017-03-06:2985220:Comment:17064102017-03-06T13:04:36.879ZRiccardo Majewskihttps://www.grasshopper3d.com/profile/RiccardoMajewski
<p>Hi guys!</p>
<p>Have a look at this attempt.</p>
<p>I "subsampled" curves into points , i thought it would ease the cpu-work.</p>
<p>Instead of CrvCP i used CP component, every point from the 2000 cloud have "just" to check if there is a sampled point near the chosen distance, instead of searching for a curve.</p>
<p>CrvCP is "too much" accurate ... maybe what i've done is just a rough, inaccurate, noob version of CrvCP.</p>
<p>But it works, it seems to be x3 faster.</p>
<p>For better…</p>
<p>Hi guys!</p>
<p>Have a look at this attempt.</p>
<p>I "subsampled" curves into points , i thought it would ease the cpu-work.</p>
<p>Instead of CrvCP i used CP component, every point from the 2000 cloud have "just" to check if there is a sampled point near the chosen distance, instead of searching for a curve.</p>
<p>CrvCP is "too much" accurate ... maybe what i've done is just a rough, inaccurate, noob version of CrvCP.</p>
<p>But it works, it seems to be x3 faster.</p>
<p>For better accuracy, probably the subsampling distance/density should be the "0.01" distance /sin60 .... i didn't had your data to test on...</p>
<p></p>
<p>Switch the toggle to see difference, slide the slider to move the starting curves to restart the updating waves <span>through</span> the definition.</p>
<p></p>
<p>Maybe i got it all wrong.... done in rush, sorry.</p> Your assumption is a rather s…tag:www.grasshopper3d.com,2017-03-05:2985220:Comment:17057792017-03-05T21:27:43.255ZHyungsoo Kimhttps://www.grasshopper3d.com/profile/HyungsooKim
<p>Your assumption is a rather special case and you'll need an iterative process to eliminate selected points previously and test leftover one by one by using scripting of loop function or plugin like Anemone.</p>
<p>Your assumption is a rather special case and you'll need an iterative process to eliminate selected points previously and test leftover one by one by using scripting of loop function or plugin like Anemone.</p> Hi Kim,
I was thinking that…tag:www.grasshopper3d.com,2017-03-05:2985220:Comment:17058512017-03-05T20:56:05.966ZEarthhttps://www.grasshopper3d.com/profile/nix144
<p>Hi Kim,</p>
<p></p>
<p>I was thinking that maybe if we have a set of curves {A,B,C,D} that are spaced between each other (eg: spaced by 10 units) and not intersecting each other, and 1000 points. </p>
<p>Then lets say there are 200 points that are very very closed to A (distance < 0.01 unit), or lies in curve A, then curves B,C,D now only need to use the leftover 800 points for cross-referencing. Then maybe 300 points very closed to curve B. So that curve C and D now only need 500 points…</p>
<p>Hi Kim,</p>
<p></p>
<p>I was thinking that maybe if we have a set of curves {A,B,C,D} that are spaced between each other (eg: spaced by 10 units) and not intersecting each other, and 1000 points. </p>
<p>Then lets say there are 200 points that are very very closed to A (distance < 0.01 unit), or lies in curve A, then curves B,C,D now only need to use the leftover 800 points for cross-referencing. Then maybe 300 points very closed to curve B. So that curve C and D now only need 500 points to cross-check the distance with. In this case, maybe this will improve the computational time a bit, and no need for 4000 computations for distance. But I was thinking if there is a better way even than this method.</p>
<p></p>
<p>Sorry for the confusion. </p>
<p></p> So, do you think there are ot…tag:www.grasshopper3d.com,2017-03-05:2985220:Comment:17055982017-03-05T20:02:19.800ZHyungsoo Kimhttps://www.grasshopper3d.com/profile/HyungsooKim
<p>So, do you think there are other ways for curves not to measure the distance to points and get to know which one is the nearest point?<br></br>In other words, you mean that the curves have their eyes and they'd like to be able to notice what is the nearest point? Then, t<span class="short_text" id="result_box" lang="en" xml:lang="en"><span>hey'll need some sort of special capability of perception.…</span></span></p>
<p>So, do you think there are other ways for curves not to measure the distance to points and get to know which one is the nearest point?<br/>In other words, you mean that the curves have their eyes and they'd like to be able to notice what is the nearest point? Then, t<span class="short_text" id="result_box" lang="en" xml:lang="en"><span>hey'll need some sort of special capability of perception.</span></span><span class="trans-verified-button goog-toolbar-button" id="t-served-community-button"></span></p>
<p>If that's possible, please let me know.</p> Hi Kim,
Thank you much for t…tag:www.grasshopper3d.com,2017-03-05:2985220:Comment:17057652017-03-05T19:07:01.552ZEarthhttps://www.grasshopper3d.com/profile/nix144
<p>Hi Kim,</p>
<p></p>
<p>Thank you much for the suggestion.</p>
<p>But the Pull component needs to do 6000 computation of distances for 6 curves and 1000 points. </p>
<p>I was wondering if there is a way to avoid those amount of computations for this kind of problem.</p>
<p>The method I used using the CrvCP component also does 6000 computations in this case.</p>
<p>Then pretty much what we did are the same, using equality component, cull component to check if the points are closed to each…</p>
<p>Hi Kim,</p>
<p></p>
<p>Thank you much for the suggestion.</p>
<p>But the Pull component needs to do 6000 computation of distances for 6 curves and 1000 points. </p>
<p>I was wondering if there is a way to avoid those amount of computations for this kind of problem.</p>
<p>The method I used using the CrvCP component also does 6000 computations in this case.</p>
<p>Then pretty much what we did are the same, using equality component, cull component to check if the points are closed to each curve, then pick those points.</p>
<p></p>
<p>Or maybe these are the only ways?</p>
<p></p>
<p>Thank you again.</p>
<p></p> Hi.
I'm not sure if this will…tag:www.grasshopper3d.com,2017-03-05:2985220:Comment:17053982017-03-05T06:11:47.653ZHyungsoo Kimhttps://www.grasshopper3d.com/profile/HyungsooKim
<p><span lang="en" xml:lang="en"><span>Hi.</span></span></p>
<p><span id="result_box" lang="en" xml:lang="en"><span>I'm not sure if this will help or not, but there are ways to group the closest points from each curve.…<a href="http://storage.ning.com/topology/rest/1.0/file/get/2769253848?profile=original" target="_self"><img class="align-full" src="http://storage.ning.com/topology/rest/1.0/file/get/2769253848?profile=RESIZE_1024x1024" width="721"></img></a></span></span></p>
<p><span lang="en" xml:lang="en"><span>Hi.</span></span></p>
<p><span id="result_box" lang="en" xml:lang="en"><span>I'm not sure if this will help or not, but there are ways to group the closest points from each curve.<a href="http://storage.ning.com/topology/rest/1.0/file/get/2769253848?profile=original" target="_self"><img width="721" class="align-full" src="http://storage.ning.com/topology/rest/1.0/file/get/2769253848?profile=RESIZE_1024x1024"/></a></span></span><span class="trans-verified-button goog-toolbar-button" id="t-served-community-button"></span></p>