Grasshopper

algorithmic modeling for Rhino

This one's for David but feel free to investigate. (As emailed last October but lost in SPAM)

In an effort to get around the slowness of the Area component I stumbled across something yesterday. I needed to calculate many Waterplane Areas and the GH Area component was bogging things down. I looked to Basic Ship Theory and the use of Simpson’s Rule  which in this case mirrors an intersection between a Half Hull and a waterline and then divides up the enclosed waterplane into an even number of equally spaced segments to calculate the area. The result of which is 99.997% of the Rhino and GH area and about a thousand times quicker (more actually). But when checking my method I lofted the simple section curves and fed this into an Area component and had a result a hundred times quicker than the original. This got me thinking that it was the complexity of the Surface that was a problem so I rebuilt the curve with the same number of points as used in the Simpson’s Rule calculation… This was even worse now taking 4 minutes as opposed to 2.8. Wondering why, I realised that the original surface and my Simpson’s surface where created 90º to each other. One lofted from one side of the vessel to the other whereas the quicker method lofted along the length. So I swapped the UV of the original and low and behold 4.3s….

The methods, results and images of the different area calculations are shown below with Simpson’s Rule at the top followed down by: Simpson’s Surface, Original, Swapped UV, and Simplified at the bottom. Also I attach the Definition AreaQuestion.gh

It’s also interesting to note that Rhino Itself does not take anywhere near as long to calculate.

All achieve as fast as I can select a surface and right click

I know the Area component does a lot more than what Simpson’s rule can achieve i.e. 3D surfaces with complex shapes but it would appear that some sort of evaluation of the surface regarding the UV direction might speed things up or if there was a check for planar surfaces to implement a numerically faster approach such as Simpson’s Rule.

I hope this was all of some use.

Slaynt vie!

Danny

Views: 1248

Attachments:

Replies to This Discussion

Ah yes thanks. I think finding the strange bug and also adding some faster algorithms that work on specific inputs will be very useful.

Thanks.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service