Grasshopper

algorithmic modeling for Rhino

This discussion is a continuation of the issues previously discussed under these threads:

http://www.grasshopper3d.com/forum/topics/convert-curve-to-arc

http://www.grasshopper3d.com/forum/topics/convert-nurbs-curve-to-arcs

I am attaching a file which shows a manual method of converting nurbs curves to a set of arcs where a G1 continuity is maintained at each segmentation. Since this process is recursive, I think it would be best handled with coding it, which I am starting to learn but have a long way to go. 

I am puttingg this out there to get your feedback on the method and its possible automation. Ideally, the user would be able to 'set the resolution': this example achieves the solution with 10 arcs. It is an assumption that more segments would result in a smaller deviation.

The locations start/end points and therefore the radii of the arcs (represented by sliders in the example) would ideally be determined through a recursive process where the health of the solution is determined through minimizing deviation from the original curve.

I look forward to your comments.

Views: 9985

Attachments:

Replies to This Discussion

I whipped up a bi-arc fitter that uses length division. The benefit is that it allows you to place a variable amount of segments without stringing components together, but of course it is a terrible solution because it doesn't make smaller arcs on parts with high curvature.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Attachments:

could a component maybe be added that basically does what the Convert command does? 

or I guess we could but the ConvertCurveToPolyline method in a VB component?

i'm probably missing the point though

ryan

Thanks a lot, David. I think that with a combination of all the various methods that I am discovering through the forum, I may be close to what I want. 

This solved my problem! 

Thanks!

Lunchbox does that... try it

then a couple seconds of galapagos and you have it

Or as David says you can divide the curve curvature-wise

Attachments:

Thanks a lot, Fred. Lunchbox is an excellent find!

Would you mind explaining the logic behind the sequence of steps to generate the curve parameters used for the lunchbox Arcdivide component? I see that you are taking the number of genes and then remapping them twice. Any clarificaiton would help.

Also, why did you square all the deviation values in to determine health?

Thanks again! Sameer

yw!

Well I agree it's a bit convoluted.The lunchbox component needs sorted numbers with no doublons. So I have to add/subtract a number to each division point parameter value. This number must be strictly smaller than 1/(2*N)  , N being the number of divisions. Actually that's not what I did in the file I posted. It''s wrong.

So th 1st remap component is to bring the gene domain from 0 to 100  down to the aforementioned value.

The 2nd one is because I wanted to control the number of divisions through gene count. But this would move the 1st and last points away from 0 and 1, as you can see in the Bounds component output.

the squaring of distances is for fitness pressure. A small increase will be much more lethal than a smaller increase.

See David's Blog at this page et siq.

cheers

Hi Fred, thank you for sharing.

It works perfect for what i need.

is there any way to do multiple curves at the same time?

how to determine the number of divisions for each one?

Thank you

Attachments:

I know this discussion is rather old, but I'll leave this python script here, that does just what you need. Bonus: it also recognizes line-like segments, so the output is always lines and arcs.

Be warned though, I'm not an expert coder. It crashes when executing large curves or big sets of items. Make sure the curves you input are somewhere between the range of 0-10m.

CNCSimplifyNURBS_cmd.py

nice, going to give it a shot, thank you

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service