Grasshopper

algorithmic modeling for Rhino

Can you generate a substrate diagram, using your own custom points? Or rearrange(deform) after it has been generated using some points?

Views: 1370

Replies to This Discussion

Did you find the answer to this question? 

What "custom points"? A substrate diagram is a progressional algorithm. Every new line segments is constrained by all existing line segments. What sort of control do you want over the output?

--

David Rutten

david@mcneel.com

Tirol, Austria

Well, I was looking at how Voronoi works with attraction points and I was wondering if there is any component that might work with rectangles in a similar way. 

Can you explain better the logic behind the construction of subsequent lines in substrate component? Thank you!

I guess the two topics are separate at this point. 

Substrate works as follows:

  1. A boundary rectangle is constructed.
  2. A random point somewhere within this rectangle is picked.
  3. A random direction is picked.
  4. A line is drawn from the point in the positive and negative direction until it hits a boundary edge.
  5. A random point on the new line is picked.
  6. A line is drawn from that point, perpendicular to the base line until it hits a boundary edge or a line already part of the Substrate diagram.
  7. Repeat steps 5 & 6 until the desired number of lines is reached.

There are some details regarding angles and the like, but they are not very important. The whole algorithm can be condensed to:

Pick a random point on any line already part of the diagram.

Draw a new line starting at that point until you hit another line.

Repeat.

There are some things that could be added to this algorithm, though it would require changing the source code or writing a new one from scratch. For example you could make the random-point-on-existing-line logic non-random. Perhaps the odds are greater that a point will be picked in some areas rather than others. This would allow for some control of density.

Another modification could be that several lines are generated one of which will be elected as the true line for that iteration. This would allow one to filter segments to achieve specific lengths or a specific length distribution.

--

David Rutten

david@mcneel.com

Tirol, Austria

Thank you! Very clear explanation!

Wouldn't that be OcTree?

I was looking at OcTree as well as QuadTree and noticed that they work with grids. I was looking for something irregular/random.

In any case, I got to know what OcTree is. I will study it better.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service