How to simplify polylines made of many vertices into single arcs or lines?

How to simplify polylines made of many vertices into single arcs or lines?

javeed4teen
Participant Participant
1,474 Views
5 Replies
Message 1 of 6

How to simplify polylines made of many vertices into single arcs or lines?

javeed4teen
Participant
Participant

Hi everyone,

In my drawing, I often receive polylines that are broken into many vertices even though:

  • Some segments form a perfect arc (all with the same radius)

  • Others are straight lines but made of multiple points

I'd like to simplify such polylines by:

  • Converting faceted arcs (with consistent radius) into a single arc segment

  • Converting multi-vertex straight lines into a simple two-point polyline

This is mainly to clean up survey and block geometry where polylines have unnecessary vertices.

Is there a built-in method (like pellise), or any available plugins for this in AutoCAD? if not can you guys help me with a lisp ?

Thanks in advance!

 

javeed4teen_0-1750847179059.png

0 Likes
1,475 Views
5 Replies
Replies (5)
Message 2 of 6

Kent1Cooper
Consultant
Consultant

It won't help with the arc thing, but to remove intermediate vertices along collinear stretches, you can use the PLD command in PLDIET.lsp, >here<.  It asks for a maximum distance to straighten [i.e. to remove intermediate vertices in], but it removes collinear intermediate vertices regardless of that setting.  And it asks for a maximum amount of change in direction to allow removing a vertex, so if you make that tiny enough, it shouldn't bother the arc-ish parts by making them even kinkier.

But to turn those into actual arc segments is something that I think has been asked before, though I don't recall whether there's a solution out there -- do some Searching.

Kent Cooper, AIA
0 Likes
Message 3 of 6

Sea-Haven
Mentor
Mentor
0 Likes
Message 4 of 6

Kent1Cooper
Consultant
Consultant

@javeed4teen wrote:

....

I'd like to simplify such polylines by:

  • Converting faceted arcs (with consistent radius) into a single arc segment

  • .....


I've been wondering how a routine could determine that a series of arc segments are of constant radius and center, since neither of those pieces of information is stored in the Polyline's entity data.  It would need to involve bulge factors in combination with segment lengths in some kind of calculation.  It would be easier if the segments were all the same length as well as radius and center, but that's clearly not the case in your image.  Just to confirm -- do you mean only series of all arc segments?  In your image, the longest segment in the outer "curve" looks like an arc segment, but the next one to its right looks like it could be a line segment.  [If it could, that would spoil any idea I have had for how to go about it.]

Kent Cooper, AIA
0 Likes
Message 5 of 6

Sea-Haven
Mentor
Mentor

Maybe like this, take 1st 3 points draw an arc get center point draw a circle, does 4th point lie on the circle, does the 5th 6th and so on when "NO" draw an arc, then start again. The obvious is that straights in same direction will have same angle. 

SeaHaven_0-1751331688504.png

Just used osnap near to make the points on an arc, as you would use vertices for comparisons.

 

In terms of actual code need real world dwg. 

 

0 Likes
Message 6 of 6

komondormrex
Mentor
Mentor

@javeed4teen 

check this one 19th custom command clean_pline.

 

0 Likes