xxfaxx Posted May 22, 2018 Posted May 22, 2018 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. Quote
lrm Posted May 22, 2018 Posted May 22, 2018 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. Quote
xxfaxx Posted May 22, 2018 Author Posted May 22, 2018 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. Quote
lrm Posted May 22, 2018 Posted May 22, 2018 I didn't realize you need to do this more than just a few times. Good luck with getting a program you can use. Quote
xxfaxx Posted May 22, 2018 Author Posted May 22, 2018 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. Quote
BIGAL Posted May 23, 2018 Posted May 23, 2018 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. Quote
tombu Posted May 23, 2018 Posted May 23, 2018 Can you attach a test drawing we could try to reduce the vertices on? Quote
xxfaxx Posted May 23, 2018 Author Posted May 23, 2018 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 Quote
tombu Posted May 23, 2018 Posted May 23, 2018 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. Quote
xxfaxx Posted May 23, 2018 Author Posted May 23, 2018 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" Quote
xxfaxx Posted May 24, 2018 Author Posted May 24, 2018 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 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.