Jump to content

Recommended Posts

Posted
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?

  • Replies 27
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    9

  • alanjt

    8

  • Pete_IC

    8

  • SEANT

    2

Posted

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.

Posted
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.

  • 5 weeks later...
Posted

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

Posted

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

Posted
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.

Posted

Found another interesting thing, the point varies if I explode the polylines.

amid2.dwg

Posted
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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...