Randomly divide a closed curve - Grasshopper2024-03-28T21:39:45Zhttps://www.grasshopper3d.com/forum/topics/randomly-divide-a-closed-curve?feed=yes&xn_auth=noFantastic!tag:www.grasshopper3d.com,2017-03-18:2985220:Comment:17152482017-03-18T16:35:50.142ZMartin Jaermannhttps://www.grasshopper3d.com/profile/MartinJaermann
<p>Fantastic!</p>
<p>Fantastic!</p> Oh yeah, I knew that and forg…tag:www.grasshopper3d.com,2017-03-18:2985220:Comment:17153282017-03-18T14:17:46.339ZJoseph Osterhttps://www.grasshopper3d.com/profile/JosephOster
<p>Oh yeah, I knew that and forgot about it. Clever solution!</p>
<p>In this case though, the code can be easily fixed:</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769261197?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769261197?profile=RESIZE_1024x1024" width="721" class="align-full"/></a></p>
<p>Oh yeah, I knew that and forgot about it. Clever solution!</p>
<p>In this case though, the code can be easily fixed:</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769261197?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769261197?profile=RESIZE_1024x1024" width="721" class="align-full"/></a></p> Thank you so much for the ans…tag:www.grasshopper3d.com,2017-03-18:2985220:Comment:17152202017-03-18T11:13:03.316ZMartin Jaermannhttps://www.grasshopper3d.com/profile/MartinJaermann
<p>Thank you so much for the answer Joseph.</p>
<p>The definition seems to work for open curves. I am trying to divide closed curves, and something that I couldn´t explain myself gets wrong with the division for this particular case.</p>
<p>However, in my case, an easy trick which consists in shattering the closed curve into 2 open curves, one of them being infinitely small. I can then use your definition for my "faked" open circle, and it´s more than enough for what I am…</p>
<p>Thank you so much for the answer Joseph.</p>
<p>The definition seems to work for open curves. I am trying to divide closed curves, and something that I couldn´t explain myself gets wrong with the division for this particular case.</p>
<p>However, in my case, an easy trick which consists in shattering the closed curve into 2 open curves, one of them being infinitely small. I can then use your definition for my "faked" open circle, and it´s more than enough for what I am doing.</p>
<p></p>
<p>Thanks again!</p>
<p></p> If you connect a wire between…tag:www.grasshopper3d.com,2017-03-18:2985220:Comment:17149402017-03-18T00:30:35.598ZJoseph Osterhttps://www.grasshopper3d.com/profile/JosephOster
<p>If you connect a wire between 'Num' and the 'T (Trigger)' input to 'Loop Start', <em><strong>in addition to the existing 'Trigger' button</strong></em>, then any change to the slider values will trigger the loop to restart - in addition to the 'Trigger' button.…</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769261518?profile=original" target="_self"><img class="align-full" src="http://storage.ning.com/topology/rest/1.0/file/get/2769261518?profile=original" width="328"></img></a></p>
<p>If you connect a wire between 'Num' and the 'T (Trigger)' input to 'Loop Start', <em><strong>in addition to the existing 'Trigger' button</strong></em>, then any change to the slider values will trigger the loop to restart - in addition to the 'Trigger' button.</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769261518?profile=original" target="_self"><img src="http://storage.ning.com/topology/rest/1.0/file/get/2769261518?profile=original" width="328" class="align-full"/></a></p> OK, forget what I posted earl…tag:www.grasshopper3d.com,2017-03-17:2985220:Comment:17149202017-03-17T22:47:57.921ZJoseph Osterhttps://www.grasshopper3d.com/profile/JosephOster
<p>OK, forget what I posted earlier, it was wrong - I will delete those posts...</p>
<p>My mistake is a common one; I've made it before, based on the assumption that 't' (0.0 to 1.0) is proportional to length for a reparameterized curve. It's not! This is demonstrated by splitting the curve using the 't' values and measuring the lengths, which in the case below are either 2.0 or 3.0 (domain bounds and random integers). As you can see, the actual lengths don't match those integer…</p>
<p>OK, forget what I posted earlier, it was wrong - I will delete those posts...</p>
<p>My mistake is a common one; I've made it before, based on the assumption that 't' (0.0 to 1.0) is proportional to length for a reparameterized curve. It's not! This is demonstrated by splitting the curve using the 't' values and measuring the lengths, which in the case below are either 2.0 or 3.0 (domain bounds and random integers). As you can see, the actual lengths don't match those integer values:</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769261229?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769261229?profile=RESIZE_1024x1024" width="721" class="align-full"/></a>I remembered doing this before and found my code in this thread from January, 2017:</p>
<p><strong>divide curve by distance between points</strong><br/> <a rel="nofollow" href="http://www.grasshopper3d.com/forum/topics/divide-curve-by-distance-between-points" target="_blank">http://www.grasshopper3d.com/forum/topics/divide-curve-by-distance-...</a></p>
<p></p>
<p>So I modified that code to use 'DivLength' (along the curve) instead of 'DivDist' (straight line between points) and combined it with the code I posted earlier in this thread. Notice the results in the upper right yellow panel - exactly the lengths expected. This requires <a rel="nofollow" href="http://www.food4rhino.com/app/anemone" target="_blank">Anemone</a> and clicking the "Trigger" button to restart the looping:</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769261459?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769261459?profile=RESIZE_1024x1024" width="721" class="align-full"/></a>P.S. The points are available at the 'D1' output of 'Loop End'.</p>