Finding the centroid of an area
-
Are there any Ruby's out there that can calculate the centroid (center of gravity) of a flat surface irregular polygonal area?
I would use this to find the center of lift of an odd shaped wing, or center of pressure of a sail plan, the center of buoyancy of a boat hull cross section, etc.
-
Amazing what you find in the Plugins Index. I'd forgotten about this one.
-
That works for 2d faces BUT for a 3d form there's my CenterOfGravity [CofG] tool that finds a solid's CofG, adds the 6 axial lifting points and gives a total weight based on an inputted density... You can also combine two CofGs of different densities etc to get a combined CofG...
-
I thought about your G of G plugin but he asked for "flat surface irregular polygonal area". Could your C of G plugin work for them, too?
-
My CofG is 3d only... so your suggestion is best for flat 2d shapes
-
Now boys, no fighting.
I asked for a 2D centroid solution because I figured that should be easy.
Getting a 3D solution and with weight/density is 2 big bowls full of ice cream on 100 Deg F day in Miami.
Now I have 2 more plug-ins to load and learn, along with the dozen I've downloaded but not had the chance to use yet.
And all those toolbars are eating up my screen working area like a PacMan. -
@jgb said:
...Now I have 2 more plug-ins to load and learn, ....
Note that GetCentroid.rb doesn't work with holes!
Unless Alex can confirm that it is updated to do so.A workaround to still work with holes is to create narrow "corridors" to connect the hole(s) with the outside. Resulting in one close loop and one face without effective holes inside. The narrower the corridor, the more accurate the result.
It's an impressive tool. -
CofG is 3d but you can simply copy 2d face[s] and pushpull them say 1mm to make a solid group - it should then work [just ignore the reported 'weight' etc as these will be '0' as the sampling is done at 5mm vertical c/c...] As here the CoG is the 'centroid' and the SPs are the 'balance points' for lifting etc - this is a more typical use where a complex 3d element is to be lifted into place - we know it weighs well over half a ton [602kg at a density of 1000kg/m3] and its centroid lifting points are outside of its form so central temporary 'cradle' will be needed to lift is without tilting etc OR a minor redesign might alloy a permanent top lifting hook to be added to the object...
-
As of this reply, I have not yet installed either plugin.
But I will, within the next few days. Good to know the 2D solution cannot take into account holes, as this would be important in some of my models, and the 3D solution will, but with a very minor workaround.
I wanted a 2D solution so I can define the various buoyancy calculations for a boat design I'm doing to rest from my big freighter project.
The irony has not gone unnoticed
I have an early edition of Skenes "Elements of Yacht Design" and I am resurrecting a paper based design I made 35 years ago, with Planimeter and slide-rule.
(I can just hear the young pups exclaim "What the hell are those??")
Drawing on SU compared to paper is sure an eye-opener to fitment problems and volume/area calculations, let alone visualizing the result.Right now I have the hull designed (55 ft Gaff rigged Schooner) with most of the internal structure and I am working on the engine (40HP Yanmar Diesel) and rudder installation, before I move onto the cabin and sail plan.
If anyone wants a WIP preview, just ask, and I'll upload the file. Nothing proprietary here.The 3D CoG plugin will be extensively used on my mass model of the airplane. Once the various main components are defined as solid parts, I will create a separate model of cubic masses of the parts and define the weights and balance sheet for various loads, and fuel on-board. I am keeping the models separate to keep the entity count down to manageable proportions.
-
Joel, I would definitely like to see what you're working on. After all, it's a boat, isn't it? Who wouldn't be interested. What's the hull to be made of?
-
@dave r said:
Joel, I would definitely like to see what you're working on. After all, it's a boat, isn't it? Who wouldn't be interested. What's the hull to be made of?
Cold molded oak with mahogany exterior veneer. One inch thick. Most of the structural members (carlin, stem, rudder stock (etc) are laminated oak. They are deliberately oversized.
This is very much a WIP. I am currently working on the helmsman's station (in particular the compass) and rudder gear, so those parts are very incomplete. As is the engine drawing and propeller.
The masts, cabin floor, headliner and cockpit floors are in transparent and are only interim position, till other mechanical and structural considerations are defined. You can hide them by turning off layer D0.
The deck (layer 1.30) is turned off so you can see the insides. Many layers have no content yet, and many more layers are known, yet to be defined.
I had to RAR the file as it was just over the 4mb upload limit. If that's a problem let me know and I will ZIP it or split it as needed.
The ballast keel is oversized and will be resized once the center of bouyancy is calculated. Right now the hull displaces almost 43,000 lbs, and a lead ballast keel would weigh almost 41,000 lbs. It should be about 1/2 that and would most likely be iron, not lead.
I planned a cabin to sleep 4 in comfort and 6 max. My experience is 6 for 1, maybe 2 nights, 4 for a longer trip is best.
The engine is a 40hp 3 cyl Yanmar Diesel. It is probably a bit underpowered, but the next up 4 cyl Yanmar is about 55 hp, and might be just right. I have not yet done the calcs. My old boat (40 years ago) was a 53 foot Yawl with a P Class racing hull. Originally a tall sloop, it was too tired for racing (built in 1911), but its 25 hp engine was more than adequate, when it worked. I sailed a full summer with only a 5 hp outboard jury-rigged to a sideboard. It moved that sleek hull like stink. This hull is not anywhere near as fine, but I wanted more interior space. The old boat had the interior of a 30 footer.
The old boat suffered a badly broken carlin in a storm, and was far too expensive for me to fix. The wood stick for the carlin alone was almost $2,000. So I sold it as is, for a bit more than what I bought it. It had about 3-4X the value in the lead keel, bronze antique parts and the bronze screws in it. I still miss it.
(Note: I had to compress the file in RAR format as it was just over the 4mb upload limit. If that's a problem, let me know and I'll ZIP it or split it as needed.)
Advertisement