×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

2D CG calculator?

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

Eng-Tips policies:  FAQ731-376: Eng-Tips.com Forum Policies

RE: 2D CG calculator?

There may be some image processing application that could take in a photograph, binarize the shape, and calculate the centroid.

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

RE: 2D CG calculator?

Similar to IRstuff's thinking.  If you can get the sketch/drawing into CAD, which should be possible you can then use the CAD to find the centroid.

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.

Posting guidelines FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm? (probably not aimed specifically at you)
What is Engineering anyway: FAQ1088-1484: In layman terms, what is "engineering"?

RE: 2D CG calculator?

In short, no I haven't seen a simple app to do that.

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?

Once the coordinates of the shape are available it is easy to get the area properties.  There are a number of free programs that will do it, including:

Theory and spreadsheet solution:
http://newtonexcelbach.wordpress.com/2008/03/09/section-properties-from-coordinates/

Excel UDF
http://newtonexcelbach.wordpress.com/2008/03/14/section-properties-udf-and-in-cell-charting/

Excel macro and section property formulas for defined shapes:
http://newtonexcelbach.wordpress.com/2008/03/25/section-properties-of-defined-shapes-spreadsheet/

 

Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
 

RE: 2D CG calculator?

Quote:

You can digitize a curve very nicely with the enigmatically named, excellent, and free, "Digitize it! 2004".

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?

I have attached an Excel spreadsheet with a User Defined Function call DigitGraph which will extract coordinates from a polyline traced over an imported image of a graph, or any other shape.  The coordinates can then be used with the spreadsheets posted earlier to find shape properties of closed shapes.

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?

The file I posted yesterday gives the wrong answers.

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/
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources