Grasshopper

algorithmic modeling for Rhino

# add line through a vector

hello,

I'm trying to combine two breps that have a distance between them, the idea is: if the first tested brep vectors (each two vectors that comes from each angle) if we continue the brep lines according to this vectors they will intersect with the neighbor brep and if this occurs then we will combine this two breps. I will add a diagram that describes this issue. and the code that I'm working on.

so my question is how to make a line according to a vector, that the length is not known. i mean until it hits an end\start point!?

Views: 351

Attachments:

### Replies to This Discussion

Diagram is bad (in fact very bad).

Let's play it again:

1. Given a collection of Polylines (Brep outer Loops) sampled in a polyList

2. For each Polyline (with index i) we sample the segments into a Line List.

3. For each segment N we compute the intersection (if the segments are not parallel within a given angle tolerance) with segment N+2 (Method: Intersection.LineLine(...finiteSegments = false)). 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

4. We continue until the espresso is ready.

If this is the correct description ... the recommended way to deal with it is via recursion (and code, that's the bad news).

Notify if you need an example.

BTW: I already had something "similar". Changed a few lines in the code here and there to approximate your goal for "combining" polylines.

See some indicative results.

light blue: OEM polylines as Breps,

white: successful add-on pieces (triangles),

black: combined polylines (segments as pipes for clarity),

pink: optionally displayed failed add-on pieces during the search.

• View All