Grasshopper

algorithmic modeling for Rhino

Hi Forum, 

I've embarked a task to create a GH algorithm to find the best fitting cylinder given an initial surface or a cloud point. 

So far I've been gathering information on how to tackle this and tried a couple of things with Galapagos (file attached). However, I quickly realised that that's not the best accurate way to solve this.

On the other hand, I've brushed up on some statistical skills and  I am trying to use DODO now, given its suite of numpy-like components and manipulation of matrices, and (who knows) maybe a neural network could solve this. 

I would like to start a discussion on this topic and any pointers on how to start this are very appreciated. 

Some Resurces:

http://file.scirp.org/pdf/AJCM_2013043015404897.pdf

http://www.nlreg.com/cylinder.htm

http://www.mapleprimes.com/questions/146143-How-To-Fit-A-Cylinder-T...

http://www.mapleprimes.com/questions/146143-How-To-Fit-A-Cylinder-T...

Views: 2910

Attachments:

Replies to This Discussion

How much noise is there in your cloud/surface input? Is it guaranteed to be exactly on the cylinder you're looking for, or is there some error involved?

Hi David, 

No assumption is made on the orientation or position in space of the surface from which the initial data set belongs to. 

Noise should be accounted for as this should output a "best fitting" solution; and error is also involved, hence the statistical analysis approach. 

Hope this can spark a good discussion. 

Hi Tom Thanks for your input, 

This is an initial experiment for a larger architectural purpose where the constraints and tolerances will dictate the "type" of best fitting solution. 

I am working taking your advice into account, you can see on the file posted that I was tinkering with the idea of using best fitting circles as well. 

Your solution works if we suppose that we have a weighted and sparse pointcloud input, from all sides of the cylinder; 

I'm aiming to recreate the uncapped "best fit - min Deviation" cylinder from a portion of a surface, or cloud points describing a surface (see image above for desired solution ; the grey is the input surface and the red cylinder is optimal output solution. )

Hi David Valent, I don't have dodo installed (and you forgot to internalise your geometry), but - for the surface part of your question, have a look at the Surface.TryGetCylinder(Cylinder, Double) Method. For the pointcloud part of your question: I don't know.

Hi Pieter, 

I've tried your solution (file attached) with the internalised geometry, Unfortunately it only works if the initial surface is part of an exact cylinder and I can't make it work with tolerance. 

Attachments:

Hi Forum, 

I'm posting the first stage of my solution:

in a nutshell,

  1. Plotting random points onto surface
  2. Creating normal lines from point samples ( I've realised that these lines must converge and then disperse the length of the total line is yet to be parametrized.)
  3. Subdivide lines and create groups of points to which analyse the area and provide a best-fit line (axis of cylinder)
  4. Average the distance from the axis to the initial seed points to find radius
  5. Cut the initial shape out of a projection to the created cylinder. 

This results into an acceptable solution to which continue or perform an optimisation process. 

WIP :

The direction of the normal lines has to be automated, I've placed a toggle to do this for now. 

The length and division of normal lines and how these groups are computed needs to be revised. 

Attachments:

I've clustered the component, 

I'm using linear regression to find the axis of the cylinder, However, I still think the deviation from the original surface can be optimised.(does anyone have any tips on how to approach this?)

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service