Author Topic: Polyline Smoother  (Read 17322 times)

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Polyline Smoother
« on: August 21, 2016, 17:12:19 pm »
After watching this video from David

http://www.screencast.com/t/QkyVwcvlhAn7
in this thread
http://www.cambam.co.uk/forum/index.php?topic=5955.msg47185#msg47185

I decided to make a plugin using the same technique.

1. Unzip attached file to get the dll
2. move the dll to CamBam 'plugins' folder
3. restart CamBam, the plugin should appear in the 'Plugins' menu drop down as "Polyline Smooth"

1. works on Polylines only, more than one can be selected, it will smooth all selected.
2. Step = distance between each point in the new smoothed polyline
3. check the box to make a new layer for the smoothed polyline
4. new layers have a suffix with the 'step' value for reference.
    e.g. with a step value of 3 the layer will be called "Polyline Smooth 3"
5. check the box to delete the original selected polyline (input Polyline)
6. all settings are saved in Windows Registry for next time

Edit:

version 1.1 attached

* undo not working correctly - fixed
* crash if new file loaded - fixed

Edit:

version 1.2 attached

* works with CamBam v1.0 only
« Last Edit: May 17, 2021, 15:38:05 pm by EddyCurrent »
Filmed in Supermarionation

Offline macbob

  • Storm Trooper
  • ***
  • Posts: 189
    • View Profile
    • Bob Mackay
Re: Polyline Smoother
« Reply #1 on: August 21, 2016, 17:25:04 pm »
Quote
all settings are saved in Windows Registry for nest time

Perfect typo! :D


Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: Polyline Smoother
« Reply #2 on: August 21, 2016, 17:32:43 pm »
Thanks Bob  ;D I've sorted that out.

It's not as good a typo as this one though; http://www.cambam.co.uk/forum/index.php?topic=5968.msg47389#msg47389

Quote
Hi Budda,
« Last Edit: August 22, 2016, 20:03:52 pm by EddyCurrent »
Filmed in Supermarionation

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: Polyline Smoother
« Reply #3 on: August 22, 2016, 20:01:11 pm »
I've attached a sample cb file to test this.

Run the plugin with a value of 3 and see how the original line has been smoothed out.
Filmed in Supermarionation

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1826
    • View Profile
Re: Polyline Smoother
« Reply #4 on: August 22, 2016, 22:09:42 pm »
HI Eddy
Just tried the plugin works well, I like that it saves the settings for next time.
Dave

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: Polyline Smoother
« Reply #5 on: August 23, 2016, 13:39:48 pm »
Thanks Dave, it's just something to keep my hand in otherwise my memory will be blank next time coding takes place  :D
Filmed in Supermarionation

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: Polyline Smoother
« Reply #6 on: August 23, 2016, 16:19:28 pm »
Hello,

Good plugin, and good idea for the multi layer, it's a useful way to experiment and compare the results.

++
David

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: Polyline Smoother
« Reply #7 on: August 23, 2016, 16:35:57 pm »
Re

Try this:

- open the testfile

- smooth the polyline and save (or not) the file

- open another file (or the same) and try to smooth -> error (object reference not set ....)

Its look like a pb you already encounter with your previous plugin ;)

++
David

Edit: UNDO is not working.
« Last Edit: August 23, 2016, 17:15:02 pm by dh42 »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: Polyline Smoother
« Reply #8 on: August 23, 2016, 19:19:08 pm »
Thanks for testing.

I did think about that, each time a new file is loaded the plugin has to get it's handle, I need to take another look at it.
UNDO works up to a point, if you don't create new layers it works, but you have to close the plugin window first.
For some reason I can't get an undo point to remove Layers  ???

Will have another look at it.  ;)

Translation should be working though  ;D
« Last Edit: August 23, 2016, 19:20:51 pm by EddyCurrent »
Filmed in Supermarionation

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: Polyline Smoother
« Reply #9 on: August 23, 2016, 20:15:34 pm »
Quote
Translation should be working though

Yes, done ;)

http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/PolylineSmooth_FR.html

++
David

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: Polyline Smoother
« Reply #10 on: August 25, 2016, 13:22:25 pm »
David,

I'm pleased to say, the undo and crash when loading a new file, have been fixed, please find version 1.1 attached to the first post.

It took some doing getting the undo to work correctly  ???
Filmed in Supermarionation

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: Polyline Smoother
« Reply #11 on: August 25, 2016, 13:54:57 pm »
Hello,

Nice !

Quote
It took some doing getting the undo to work correctly

Yes, not always easy to deal with ..  :)

PS: you forgot to change the version number.

++
David
« Last Edit: August 25, 2016, 13:56:29 pm by dh42 »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: Polyline Smoother
« Reply #12 on: August 25, 2016, 14:25:41 pm »
Maybe I had put the old file there ? anyway it's updated now in the first post.
Filmed in Supermarionation

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: Polyline Smoother
« Reply #13 on: August 25, 2016, 14:36:40 pm »
Maybe I had put the old file there ?

Yes, it was the old file ; now it's OK ... updated on the website

thanks

++
David

Offline Gary33

  • Ewok
  • *
  • Posts: 34
    • View Profile
Re: Polyline Smoother
« Reply #14 on: May 17, 2020, 14:03:04 pm »
Genial parfait je le cherche depuis longtemps   

Bravo.....