alanjt Posted May 24, 2010 Posted May 24, 2010 Mainly a Book (by Herbert Schildt), and a few header references online - but its slow going, as I'm slightly paranoid about messing my system up, and so will only test something when I know it is completely correct (when dealing with arrays/pointers anyway).. That's completely understandable. I've looked at a couple books, but haven't picked one up yet, are you liking yours? Quote
Lee Mac Posted May 24, 2010 Posted May 24, 2010 The hardest part is finding a book that will explain the basics of C++ but moves along fast enough for someone who already knows how to program. So I find myself spending a long time reading about pointer manipulation and arrays, and skimming over the explaination of IF statements / While expresssions etc. Quote
alanjt Posted May 24, 2010 Posted May 24, 2010 The hardest part is finding a book that will explain the basics of C++ but moves along fast enough for someone who already knows how to program. So I find myself spending a long time reading about pointer manipulation and arrays, and skimming over the explaination of IF statements / While expresssions etc. That's completely understandable. I'll have to look for the guy you mentioned when I get home. Thanks Lee. Quote
Pete_IC Posted June 24, 2010 Author Posted June 24, 2010 Found a bit of a problem with the amid lisp. When using it on a polyline its finding the middle if all the sections that make up the line are even. But if they are uneven then it seems to take the middle point even if its not the middle of the line. Maybe my description was wrong in the beginning when i said mid point, but by point i mean middle of the line:?. I have attached the lisp and a dwg to show what I mean, Lee Mac you seem to know your stuff, any help would be appreciated, I'm sure its not to hard to change the lisp if you know what your doing, but unfortunately i fall into the don't know what I'm doing group. amid.lsp amid.dwg Quote
SEANT Posted June 24, 2010 Posted June 24, 2010 Pete, I don’t have any suggestions for your current situation, but I am curious about the process in general. With regard to COG, does averaging all the midpoints actually return the correct information? It seems the midpoint of each line should be weighted relative to the length. While that would not change the location as shown in the MidPoint.dwg in post# 4 (http://www.cadtutor.net/forum/showpost.php?p=327974&postcount=4), it would if the lengths differ, as in the attached. MidPoint2.dwg Quote
Pete_IC Posted June 24, 2010 Author Posted June 24, 2010 Pete, I don’t have any suggestions for your current situation, but I am curious about the process in general. With regard to COG, does averaging all the midpoints actually return the correct information? It seems the midpoint of each line should be weighted relative to the length. While that would not change the location as shown in the MidPoint.dwg in post# 4 (http://www.cadtutor.net/forum/showpost.php?p=327974&postcount=4), it would if the lengths differ, as in the attached. Seant, you are right about it not being a true midpoint, the main thing im looking for it is the longitudinal center of gravity or LCG for short, the vertical center of gravity or VCG is not as important for me, however if someone could add that into the lisp it would be also helpful, most of the time the lines I'm using a only one side of something symmetrical so the LCG is all I really need. Quote
Pete_IC Posted June 25, 2010 Author Posted June 25, 2010 Found another interesting thing, the point varies if I explode the polylines. amid2.dwg Quote
SEANT Posted June 26, 2010 Posted June 26, 2010 Found another interesting thing, the point varies if I explode the polylines. The off center location is related to the weighted midpoint situation mentioned earlier. I’m not exactly sure why it varies after explosion. In an effort to bolster the post count at the .NET, ObjectARX & VBA section, I uploaded a sample C# routine to find the center of gravity: http://www.cadtutor.net/forum/showthread.php?t=49675 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.