Jump to content

reduce vertices of a curved polyline


xxfaxx
 Share

Recommended Posts

Hello everyone

I was wondering if there is a way or a lisp command that reduces vertices of curved polylines.

 

When i say a "curved polyline" i mean a polyline that has two segments that are arcs with the same radius, and if i explode that polyline and join it again, those two or more segments/arcs, just become one.

 

I have used that "pldiet" lisp before but it only works with straight segments.

Link to comment
Share on other sites

If you have several contiguous arc segments in a polyline that have the same radius and center point you can drag the vertices that are internal to the two ends to one end which will yield a polyline with several vertices at the same point. You can explode and then pedit/join the segments together to yield a clean polyline.

Link to comment
Share on other sites

that is a good idea, but the task would be too tedious since i have to do it several hundred times, and not only that, i would have to "find" the polygons among thousands of them (most of them do not have extra vertices). that is why i use the pldiet routine. when i use it i just select all my elements and my extra vertices go away, except with the curved segments in some polylines.

Link to comment
Share on other sites

Thanks tombu, but i already used overkill.

Overkill works sometimes and in about 50% of my polylines (on the ones with the extra vertices in curved segments). when it does not work, overkill just deletes one of those curved segments. when it does work, everything is fine.

 

The problem is that some polylines are backwards (their direction) . I dont know if that is the right term. backwards

How do i know that?

 

Because those polylines that overkill do not fix, i explode them, and then i join their arcs, but i have to join them from one direction in particular

(left to right, or right to left, or up to down or viceversa, the direction changes), because if i dont join them that way, then, the arcs form a complete circle and i guess that is where overkill does not work, when the joined arcs form a circle.

Link to comment
Share on other sites

There was a post about replacing two arcs with one arc so it has been done before, Now the hard part to find search here 1st then Theswamp, AUGI. I posted a suggestion.

Link to comment
Share on other sites

Sure thing

I am attaching a sample drawing and the two lisp routines that i use.

I explained it the best i could inside the drawing

 

I want to make clear that i did not write these routines and all credit goes to their coders ----Kent Cooper and others for the pldiet routine----Stefan for the "enclosed polylines" routine--both of these routines can be found online

test.dwg

Enclosed polylines.LSP

PLDiet.lsp

Link to comment
Share on other sites

I used OVERKILL with "Optimize segments within polylines", "Do not break polylines", and "Combine co-linear objects when aligned end to end" checked on 03 BOUNDARIES MADE WITH AUTOLISP CALLED -Enclosed polylines- MADE BY STEFAN and it got rid of the extra vertices.

Link to comment
Share on other sites

Inside the drawing i attached, in the point 5 I mention that I used overkill.

I forgot to mention which options i checked. I used the same ones you used, but when i use it only some polylines get "cleaned"

Link to comment
Share on other sites

There was a post about replacing two arcs with one arc.

 

Thanks Bigal

Your comment let my find what i was looking for

The routine i found (i first found it here but the code was copied wrong, and then i found it in the swamp) is called "psimple", in its version 1.7 which lets you select multiple objects, and it was made by Charles Alan Butler

 

Sometimes i can not find the stuff i need because of the title of the search. When you said "replacing two arcs", i started looking for something about that and "psimple" came up in the search

Thanks guys

Link to comment
Share on other sites

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

 Share

×
×
  • Create New...