add line through a vector - Grasshopper2024-03-29T11:30:33Zhttps://www.grasshopper3d.com/forum/topics/add-line-through-a-vector?feed=yes&xn_auth=noBTW: I already had something…tag:www.grasshopper3d.com,2017-11-18:2985220:Comment:18551462017-11-18T07:35:24.709Zpeter fotiadishttps://www.grasshopper3d.com/profile/peterfotiadis
<p>BTW: I already had something "similar". Changed a few lines in the code here and there to approximate your goal for "combining" polylines.</p>
<p>See some indicative results.</p>
<p><strong>light blue</strong>: OEM polylines as Breps,</p>
<p><strong>white</strong>: successful add-on pieces (triangles),</p>
<p><strong>black</strong>: combined polylines (segments as pipes for clarity),</p>
<p><strong>pink</strong>: optionally displayed failed add-on pieces during the search.…</p>
<p></p>
<p>BTW: I already had something "similar". Changed a few lines in the code here and there to approximate your goal for "combining" polylines.</p>
<p>See some indicative results.</p>
<p><strong>light blue</strong>: OEM polylines as Breps,</p>
<p><strong>white</strong>: successful add-on pieces (triangles),</p>
<p><strong>black</strong>: combined polylines (segments as pipes for clarity),</p>
<p><strong>pink</strong>: optionally displayed failed add-on pieces during the search.</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769350042?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769350042?profile=RESIZE_1024x1024" class="align-full" width="721"/></a><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769350234?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769350234?profile=RESIZE_1024x1024" class="align-full" width="721"/></a><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769350469?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769350469?profile=RESIZE_1024x1024" class="align-full" width="721"/></a><a href="http://storage.ning.com/topology/rest/1.0/file/get/2769350580?profile=original" target="_self"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2769350580?profile=RESIZE_1024x1024" class="align-full" width="721"/></a></p> Diagram is bad (in fact very…tag:www.grasshopper3d.com,2017-11-17:2985220:Comment:18547682017-11-17T12:45:40.279Zpeter fotiadishttps://www.grasshopper3d.com/profile/peterfotiadis
<p>Diagram is bad (in fact very bad).</p>
<p>Let's play it again:</p>
<p>1. Given a collection of Polylines (Brep outer Loops) sampled in a polyList</p>
<p>2. For each Polyline (with index i) we sample the segments into a Line List.</p>
<p>3. For each segment <strong>N</strong> we compute the intersection (if the segments are not parallel within a given angle tolerance) with segment <strong>N+2</strong> (Method: Intersection.LineLine(...…</p>
<p>Diagram is bad (in fact very bad).</p>
<p>Let's play it again:</p>
<p>1. Given a collection of Polylines (Brep outer Loops) sampled in a polyList</p>
<p>2. For each Polyline (with index i) we sample the segments into a Line List.</p>
<p>3. For each segment <strong>N</strong> we compute the intersection (if the segments are not parallel within a given angle tolerance) with segment <strong>N+2</strong> (Method: Intersection.LineLine(...<span style="text-decoration: underline;"><strong><span class="parameter">finiteSegments = false</span></strong></span>)). If the point is inside any other Polyline (say: with index j) we "combine" the 2 in one, remove the 2 involved (i.j) and insert the combined into index i</p>
<p>4. We continue until the espresso is ready.</p>
<p>If this is the correct description ... the recommended way to deal with it is via <strong>recursion</strong> (and code, that's the bad news).</p>
<p>Notify if you need an example.</p>