Grasshopper

algorithmic modeling for Rhino

This is similar to http://www.grasshopper3d.com/forum/topics/divide-distance-problem.

I'm trying to divide a curve with distances from a random seed of a 4 integer numbers (2,3,4 and 5) and I think my Galapagos solver should minimize the final gap alternating the amount of distances and the seed of variation.

I have a problem with the distance seed, all the output distances are wrong or inaccurate.

Thank you very much

Views: 2009

Attachments:

Replies to This Discussion

Hello Jose,

[DivideDistance] only works with a single Distance input. So when you use a list of numbers it actually divides the curve many times (that's why you get a tree as output) and that's why you get those "strange" distances betwwen points.

See this post as well: http://www.grasshopper3d.com/forum/topics/divide-curve-multiple

I am afraid the only way to do this would be to use a loop plugin such as anemone or hoopsnake, or maybe you could use kangaroo...

(something similar to this but on the same curve)

If you're willing to settle for dividing by length rather than distance, you can use Dash Pattern, it accepts a list of dash and gap lengths.

Dear David and Nikos

When I use Dash pattern I got a lot of approximates, this could work for now.

But I will try Nikos Suggestion after installing Hoopsnake

Thank you both

Hello Jose,

I believe the approximates are because of the difference of dividing by distance vs dividing by length.

When you divide a curve by a distance d, then the straight lines from each point to the next will have a length of d.

When you divide a curve by a length d, then the curve fragments between two consecutive points will have a length of d.

Divide by length is an easier operation and you can actually find the optimal solution just by using math operations (you can use [mass addition] and use the "Partial Results" output to find the largest number that is smaller than the curve's length).

Since you are trying to find the best seed value, as I understand, there is no advantage in using Galapagos over just generating a number of random sequences and keeping the best one.

See the attached definition for a script of this. It should also work way faster than using Galapagos.

The previous script didn't account for the case when more than one point lies on the same polyline segment.

Attachments:
...was this useful?

Hello Vicente

I didn't have the chance to use it, I took a break from this subject, but right now I giving a try and it looks very promising,

I Think it's great, but it's ,more helpful if it's an induced pattern, like when it's has more curvature the segments have lower lengths. 

On a side note, how do you learn c#? I definitively want to learn to code like that!

Thank you for your help!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service