Grasshopper pattern - using loops, multiple problems to solve

Hello, since my childhood I used to like the pattern I invented. Firstly drawings on paper as a form of procrastination at school, next I moved it to modeling software (SketchUp, screenshot below, so you can see the desired output. Dots instead of lines just for the visuals).

Im also attaching simple drawing that shows what I want to produce:

Now I remembered that pattern again and want to use it as a way to learn grasshopper. I put some effort into it, learned a few things (mainly what grafting does to data structure, so my rotation of line into two oposite directions works now), but Im currently stuck.
I think that the correct way to solve it is to use loops, so Im using anemone plugin. Im not able to produce the wanted outcome. I suspect the problem is in the rotation of lines, thus endpoints becoming startpoints the next iteration… Maybe. Or the problem is anywhere else, possible thing is I dont understand anemone correctly (Maybe there is a better way to do loops in GH?), or making other mistake.
So the question for now stands: What causes the mistake in next iterations of my loop? (GH file attached, hopefully I organized it cleanly so you can understand my aproach.)

Pattern_Better.gh (13.3 KB)

Next huge thing to solve will be how to stop the lines if they hit existing geometry, end them at that point and not use the endpoint for next loops. But first things first, I need small steps so I can keep up and understand everything.

Hi,

try Rooster for reverse engineering of your curves. What a great project!

I dont need to recreate existing pattern. My goal is to make a definition, that will create those patterns, based on line lenghts, line count from origin and the angle at which the lines will divide. Check the input parameters group in my GH definition. Hope Im clear, english is not my native language.
Right now I dont understand if Im using Loops (anemone plugin) correctly, or the mistake is in my definition.

Hello
the first error is to use an automatic conversion of a point to a plane. Your plane will always has the same orientation as XY plane.
I think it is better to use something like that
It measure the tangent at the end of the curve and then this tangent is rotated and used to generate 2 more lines.


Then you will have to find the intersection of lines using CCX (I have some difficulties like here CCX (Curve-Curve intersection) screws tree)
Then you will feed the loop with just curve that have a length that is similar to the initial length.

Here is my script, I am not happy with how I handle CCX outputs. But it works.

The main drawback here is that Curve intersection is just handled for the curves of the same itteration. This is not good.
pattern divide.gh (18.0 KB)

Using this same approach but not with Anemone loop and on a 3D mesh I ended doing that

it is better approach.

2 Likes