2D CG calculator?
2D CG calculator?
(OP)
Is there a cheap CG calculator out there for complex shapes (with curves & re-entrant portions)?
This would have to be a 2-step process:
1. Input shape. Ideally by scanning something hand-drawn.
2. Calculate location of CG.
I think major CAD and design programs will do this, but is there anything small out there that does just this?
Back when I was smarter, I could have written #2, but I'm not that smart any more.
Hg
This would have to be a 2-step process:
1. Input shape. Ideally by scanning something hand-drawn.
2. Calculate location of CG.
I think major CAD and design programs will do this, but is there anything small out there that does just this?
Back when I was smarter, I could have written #2, but I'm not that smart any more.
Hg
Eng-Tips policies: FAQ731-376: Eng-Tips.com Forum Policies






RE: 2D CG calculator?
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: 2D CG calculator?
There are free 2D packages though I'm not sure they include this kind of thing or just the basic drawing.
If the scanner thing defeats you, for relatively simple parts you could import the image into the CAD and trace over it.
What is Engineering anyway: FAQ1088-1484: In layman terms, what is "engineering"?
RE: 2D CG calculator?
The simplest way is to cut your section out of card and then hang it from several points. The cg is always directly below the point of suspension.
But you knew that.
You can digitize a curve very nicely with the enigmatically named, excellent, and free, "Digitize it! 2004".
But that is only half the battle. A table of coordinates has no area properties in itself, as you have to know what is inside and what is outside the section.
The obvious thing to do is to flood fill the shape defined by those points and then take a first moment in x and y to give the cg location, but that needs programming.
The way I'd do it would be as follows
Draw a boundary outside the shape.
for each pixel inside the boundary draw a line between the boundary and the pixel. If it cuts the section's outline an odd number of times it is inside the section.
Another way would be to split the shape up into triangles, but again you have the problem of deciding whether a triangle has positive or negative area.
Cheers
Greg Locock
New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?
RE: 2D CG calculator?
Theory and spreadsheet solution:
http
Excel UDF
ht
Excel macro and section property formulas for defined shapes:
http://
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: 2D CG calculator?
Thanks for that Greg, but
When I run it I get a message that Grid32.ocx is not installed or properly registered (Vista with Service Pack 2). I have copied Grid32.ocx to the Windows/System32 directory, but still no good.
Any ideas?
For others looking for the download:
I think it should not have the "!". Digitizeit! is a video digitising program.
There is also a program called DigitizeIt 1.5, which is free to download, but is cripple-ware with a 20 day trial period (about $50 to register I think).
I think I might write my own digitizing program in Excel :)
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: 2D CG calculator?
Obviously any output should be given a careful sanity check before you rely on it.
Any questions or comments, please let me know.
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: 2D CG calculator?
I copied and pasted the "Axes" rectangle, to show what it looks like, and forgot that the copied object has the same name as the original, so the function reads the size and the position of the little sample box, rather than the correct one.
Corrected spreadsheet attached.
Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
RE: 2D CG calculator?
Hg
Eng-Tips policies: FAQ731-376: Eng-Tips.com Forum Policies