Author Topic: How to merge overlapping lines  (Read 3552 times)

0 Members and 1 Guest are viewing this topic.

Proctor

  • Guest
How to merge overlapping lines
« on: October 29, 2008, 12:46:59 PM »
Hello: I have objects (letters), that were originally polys, but then broken down into many lines in order to find the center line of the poly (medial axis). now, I need to find the best approach to merge all the lines into several continous connecting lines that don't overlap...I have attached a pic of the letter "J". it shows how it appears close up - with a bunch of lines that need to be merged.

I'm not sure how to go about this...currently, I'm trying to use GetClosestPointTo to try and loop through each line, find the line that overlaps and not sure what to do next to merge the two.

any ideas are truly appreciated. also, let me know if I did not explain well enough.

thanks,
Proctor

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8722
  • AKA Daniel
Re: How to merge overlapping lines
« Reply #1 on: October 29, 2008, 12:52:45 PM »
Will the overkill command work?

Proctor

  • Guest
Re: How to merge overlapping lines
« Reply #2 on: October 29, 2008, 02:15:22 PM »
hey daniel: thanks for your reply. I just tried your suggestion. It seems to work great when the lines are straight...e.g. letter "L" however, doesn't seem to do anything for the letter "C". Maybe my settings aren't correct? I've attached a screen shot of them...and also a drawing of the letter "C" if you would like to try.

it would be so great if this would work...save me lots of time creating algorithm.
thanks again for your reply and suggestion.

Proctor

Glenn R

  • Guest
Re: How to merge overlapping lines
« Reply #3 on: October 29, 2008, 04:39:44 PM »
AutoCAD Map -> Cleanup Tools

Will do exactly what you want.

Spike Wilbury

  • Guest
Re: How to merge overlapping lines
« Reply #4 on: October 29, 2008, 04:48:31 PM »
something i have on my gbpoly engine, but for a no programming involvement (or maybe can be use as part of), draw a rectangle larger than the letter and call the command or function bpoly, select as internal point between the outside of the letter and the rectangle, then just grab the surrounding poly generated.

hth

Proctor

  • Guest
Re: How to merge overlapping lines
« Reply #5 on: October 29, 2008, 06:54:13 PM »
Thank you Glen and Esquivel for providing me w/ this information.
Glen, I googled Automap cleanup tools and it certainly does look like it would do the trick. I was wondering however: could this work in conjunction w/ .net api? i need to automate this process in some software i've been developing.

Esquivel: I test ran bpoly and it's way cool!!! I would be able to somehow automate it's use however.
do you have any input regarding this? in addition, if you could please open my newly attatched dwg file - you will see how it works for letter "C" the way I need it to; but having trouble w/ some of my other letters e.g.see letter "J" - see how for this letter it forms 2 polys? I need to keep the internal (center line) separate. perhaps there's a way to do this?

thank you both again....I truly appreciate it.
Proctor

Spike Wilbury

  • Guest
Re: How to merge overlapping lines
« Reply #6 on: October 29, 2008, 07:34:11 PM »
Esquivel: I test ran bpoly and it's way cool!!! I would be able to somehow automate it's use however.
do you have any input regarding this? in addition, if you could please open my newly attatched dwg file - you will see how it works for letter "C" the way I need it to; but having trouble w/ some of my other letters e.g.see letter "J" - see how for this letter it forms 2 polys? I need to keep the internal (center line) separate. perhaps there's a way to do this?

I can get the J without a problem....

Spike Wilbury

  • Guest
Re: How to merge overlapping lines
« Reply #7 on: October 29, 2008, 07:40:36 PM »

Esquivel: I test ran bpoly and it's way cool!!! I would be able to somehow automate it's use however.
do you have any input regarding this?

The Bpoly function is not accesible from .NET as far as I know - I wrote my own bpoly, if you can have a look here (not open source):

http://www.theswamp.org/index.php?topic=24000.0

TonyT

  • Guest
Re: How to merge overlapping lines
« Reply #8 on: October 29, 2008, 10:24:32 PM »

The Bpoly function is not accesible from .NET as far as I know - I wrote my own bpoly, if you can have a look here (not open source):


BPOLY is accessable from .NET via acedInvoke() (which you must P/Invoke).

Spike Wilbury

  • Guest
Re: How to merge overlapping lines
« Reply #9 on: October 29, 2008, 10:53:31 PM »

The Bpoly function is not accesible from .NET as far as I know - I wrote my own bpoly, if you can have a look here (not open source):


BPOLY is accessable from .NET via acedInvoke() (which you must P/Invoke).

Hi Tony,

I did not know that, thanks!

Proctor

  • Guest
Re: How to merge overlapping lines
« Reply #10 on: October 30, 2008, 11:38:36 AM »
Thank you both for this great information. I would like to use this; however, I need to make sure that it will do exactly what I need it to do and still having troubles getting it to merge the overlapped lines that make up the inside (medial axis of my letter (see pic). I was able to get it to work for the outter or exterior lines that make up the letter - but I also need to be able to merge the center lines as a separate entity.

thanks again for all your help.

Proctor