Grasshopper

algorithmic modeling for Rhino

Does anybody know how to sphere fit a certain surface?

I have a freeform surface and I need to find the closest spherical surface.

Thanks!

Views: 1348

Replies to This Discussion

There's a "sphere fit" component - you could use "Populate Geometry" or convert your surface to a mesh and extract the vertices in order to get a list of points, and then try to use sphere fit to pass a sphere through those points. 

Hi Andrew, that was straight forward!

I've tried this component but it seems that the results provided are not optimal, in the attached example, for instance, it would seem that any sphere with a bigger radius would give a better fitting, what do you think?

Attachments:

Your surface is invalid. How did you make it?

What Andrew suggested though was to use the populate component. You need lots of points for a good fit and populate is the easiest way to get them.

I untrimmed and retrimmed your surface, it's valid now.

Do note that both circle and sphere fitting don't work very well if the points are very flat. The more the points are spread out across the entire shape, the better the fitting will be.

Attachments:

Hi David,

Thanks for your support, I have not been able to open your file, I get a warning telling that it has been done using a higher GH version than the latest available.

However I have reproduced your suggestions (untrimming and retrimming to get a valid surface and populating to get a lot more points) and I still get a pretty small sphere. I wonder if you get simmilar results in your definition.

If this is because the input freeform surface is too flat maybe I will have to find an alternative method.

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service