Author Topic: [LISP] How to smooth polyline  (Read 8575 times)

0 Members and 1 Guest are viewing this topic.

delkov

  • Guest
[LISP] How to smooth polyline
« on: November 20, 2015, 08:07:21 AM »
Hi, everyone.
I have a question, the problem is that I have a  some closed polyline and I want remove its sharp edges, make it more smooth.
I tried PEDIT -> Fit/Curve - nothing.

May be do this: polyline -> entity point list (via Lee-Mac's program http://www.lee-mac.com/entitytopointlist.html) and then make spline by this points, with certain toleration or something like this.

But this Lee-Mac's program doesn't work for me :( [cad2015 x64].

What's the solution ?

Thanks.  :-)

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: [LISP] How to smooth polyline
« Reply #1 on: November 20, 2015, 08:43:52 AM »
Try using Fillet.

delkov

  • Guest
Re: [LISP] How to smooth polyline
« Reply #2 on: November 20, 2015, 01:35:43 PM »
Fillet works with lines, I think..
I can trim and then use fillet, but I want do it automatically..

tedg

  • Swamp Rat
  • Posts: 811
Re: [LISP] How to smooth polyline
« Reply #3 on: November 20, 2015, 01:42:29 PM »
Fillet works with lines, I think..
I can trim and then use fillet, but I want do it automatically..
Fillet works with polylines too right in the fillet command.


command: fillet> radius <your desired radius> Polyline <select your pline>
Windows 10 Pro 64bit, AutoCAD 2023, REVIT 2023

delkov

  • Guest
Re: [LISP] How to smooth polyline
« Reply #4 on: November 20, 2015, 01:59:26 PM »
I select radius - > click polyline and get the screen :(

delkov

  • Guest
Re: [LISP] How to smooth polyline
« Reply #5 on: November 20, 2015, 02:10:22 PM »
But I can click, and I get some arcs..

tedg

  • Swamp Rat
  • Posts: 811
Re: [LISP] How to smooth polyline
« Reply #6 on: November 20, 2015, 02:42:01 PM »
But I can click, and I get some arcs..
Not sure exactly what you want to do, but your original post just mentioned "removing the sharp edges" so if you simply pick a reasonable radius for all your corners it should work.
Windows 10 Pro 64bit, AutoCAD 2023, REVIT 2023

tedg

  • Swamp Rat
  • Posts: 811
Re: [LISP] How to smooth polyline
« Reply #7 on: November 20, 2015, 02:43:53 PM »
And fillet works at any individual corner on a polyline too, so if you just want to clean up one corner you can do it.
Windows 10 Pro 64bit, AutoCAD 2023, REVIT 2023

delkov

  • Guest
Re: [LISP] How to smooth polyline
« Reply #8 on: November 21, 2015, 08:45:25 AM »
Well, may be I didn't explain properly. I want to remove all sharp corners (make pline more smooth) on the pline by using some lisp routine.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: [LISP] How to smooth polyline
« Reply #9 on: November 21, 2015, 09:28:18 AM »
Code - Auto/Visual Lisp: [Select]
  1. (command "_.fillet" "_radius" 10 "_.fillet" "_polyline" (car (entsel)))

delkov

  • Guest
Re: [LISP] How to smooth polyline
« Reply #10 on: November 21, 2015, 10:23:05 AM »
I did it, but polyline change only a litle bit, even if I set big radius :(

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: [LISP] How to smooth polyline
« Reply #11 on: November 22, 2015, 06:25:53 AM »
There two problems with your polyline:
1. It is a POLYLINE of the acCubicSplinePoly type.
2. Some vertices are too close together for the desired fillet radius.

tedg

  • Swamp Rat
  • Posts: 811
Re: [LISP] How to smooth polyline
« Reply #12 on: November 23, 2015, 12:00:41 PM »
There two problems with your polyline:
1. It is a POLYLINE of the acCubicSplinePoly type.
2. Some vertices are too close together for the desired fillet radius.


That's what I meant by picking a reasonable radius, if I know that a certain radius will work for all my corners (even the sharpest ones), that's what I'd use for all of them.
Windows 10 Pro 64bit, AutoCAD 2023, REVIT 2023

delkov

  • Guest
Re: [LISP] How to smooth polyline
« Reply #13 on: November 23, 2015, 01:53:25 PM »
There two problems with your polyline:
1. It is a POLYLINE of the acCubicSplinePoly type.
2. Some vertices are too close together for the desired fillet radius.

Ok, I see. So, wnat do I need to do?
How to change type/delete verticies..?
Thanks in advance.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: [LISP] How to smooth polyline
« Reply #14 on: November 24, 2015, 02:52:52 AM »
The manual approach:
1. Decurve the polyline.
2. Trim away polyline segments around the sharp corners.
3. Fillet.
4. If required rejoin into a single polyline.
5. Curve the polyline.