TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Vikram on November 06, 2019, 01:24:55 AM

Title: How to simplify a lwpolyline with 5000+ vertices in it?
Post by: Vikram on November 06, 2019, 01:24:55 AM
Hi!
I have a lwpolyline with 5000+ vertices in it. I actually used pedit.lisp made by Kent Cooper but it is not supporting for the lwpolyline with so many vertices.My intellicad crashes when I use it. But it works fine with 2000+ vertices.
Basically I want to obtain smooth curve out of numerious small lines. So I convert this small lines in polyline by using pedit and then I spline it.I couldn't use pldiet.lisp on spline so I have to again explode that spline and convert it into polyline again.When I explode it it I get 5000 vertices. Intially I have 700 points but after exloding I get so many points.
So these following things can help me
1) If I could simplify the polyline after I spline it. For Eg: Pedit->Join->Spline->Simplify
   (pldiet wont support spline that's why I have to go Pedit->Join->Spline->Explode->Pedit->Join->Simplify )

2)If I could explode the polyline in minimum vertices with help of some routine.

I have attached the drawing for reference test2.dxf
Title: Re: How to simplify a lwpolyline with 5000+ vertices in it?
Post by: kpblc on November 06, 2019, 01:34:37 AM
How did you get dxf file with repeated entity handles? AutoCAD 2018 can't open this dxf, and I have no time to edit it manually. Attach dwg file.
P.S. Without opening file: try to ise _.pedit command at first part of your lines, then repeat this command to another part, and repeat it until you get good enough result.
Title: Re: How to simplify a lwpolyline with 5000+ vertices in it?
Post by: Vikram on November 06, 2019, 01:55:35 AM
Thanks for your reply Sir.Now I also have attached dwg file. I will try your method
Title: Re: How to simplify a lwpolyline with 5000+ vertices in it?
Post by: kpblc on November 06, 2019, 05:18:29 AM
I think you have to erase duplicated vertexes and segments. Use _.overkill command.
Secondary try to use pl-tools: https://forum.dwg.ru/showthread.php?t=8284 . Maybe it could help you.
Title: Re: How to simplify a lwpolyline with 5000+ vertices in it?
Post by: Vikram on November 06, 2019, 08:50:59 AM
Those tools gave me a high hope! they looks useful. But unfortunately it didn't work for me.It threw error bad argument.
PS: I'm using IntelliCad
Title: Re: How to simplify a lwpolyline with 5000+ vertices in it?
Post by: ScottMC on November 06, 2019, 10:10:09 PM
Mr Sanders did quite a job on that Rolling_Ball tool for sure. I'm gonna spend some time learning from that.
Title: Re: How to simplify a lwpolyline with 5000+ vertices in it?
Post by: Vikram on November 06, 2019, 10:22:55 PM
For what purpose Rolling ball tool was used? Do you have the lisp file of its?
Title: Re: How to simplify a lwpolyline with 5000+ vertices in it?
Post by: hak_vz on November 09, 2019, 06:48:05 AM
Here is Kent Coopers latest version of Pldiet. I hope it works.

https://forums.autodesk.com/t5/autocad-forum/reduce-polyline-points/m-p/9117542/highlight/true#M998626 (https://forums.autodesk.com/t5/autocad-forum/reduce-polyline-points/m-p/9117542/highlight/true#M998626)
Title: Re: How to simplify a lwpolyline with 5000+ vertices in it?
Post by: ahsattarian on December 01, 2020, 07:25:21 AM
See if this Result is what u need  :


Then I will offer u its code  !!!!
Title: Re: How to simplify a lwpolyline with 5000+ vertices in it?
Post by: Marc'Antonio Alessi on December 01, 2020, 12:02:08 PM
Maybe this can help  (by gile):

http://www.theswamp.org/index.php?topic=55415.msg596112#msg596112

http://www.theswamp.org/index.php?topic=19865.msg244892#msg244892