Author Topic: Polygon Plugin with angle snapping.  (Read 16274 times)

Offline Rodneyk

  • Droid
  • **
  • Posts: 65
    • View Profile
Polygon Plugin with angle snapping.
« on: December 17, 2012, 01:00:05 am »
Updated to version 1.3

Donations gladly accepted at https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4DFD56ADQNUS8

The Polygon plugin adds regular polygons to Cambam. It behavies much like the "Add Circle" feature of Cambam but with N Sided Polygons (like an Equalangular triangle, Square, Pentagon,...,trihectahexacontagon).

The plugin adds two buttons to the tool bar. One for configuring the tool and the second for drawing the polygons. The same options are added to the Draw Menu as Polygon Properties and Polygon.

To install the plugin unzip the files and copy them into the plugins directory.
    This is normally found at :
        C:\Program Files (x86)\CamBam plus 0.9.8\plugins.

This plugin was compiled with the RC6 version of Cambam so I don't know if it works with earlier versions. If is does not and enough people want it I will  recompile it for the current version.

Use it at our own risk. It appears stable on my system, but your milage may vary.


Version 1.3Changed icons by popular demand.
Version 1.2Changed code to use only the Left mouse button for create.
Added functionality to make middle button same as ESCape.
Changed behavior so object is selected after creation.
Version 1.1Changed keys to activate plugin : <Alt>+P and <Ctrl>+<Alt>+P.
Added keys to change number of sides while in Add Mode '<' , '>'.
Changed prompt to display number of sides and snap states ("SNAP" = on, "snap"=off).
Changed prompt to show sides.
Updated help file.
Version 1.0Initial Release

« Last Edit: January 13, 2013, 19:42:01 pm by Rodneyk »

Offline blowlamp

  • CNC Jedi
  • *****
  • Posts: 1192
    • View Profile
Re: Polygon Plugin with angle snapping.
« Reply #1 on: December 17, 2012, 08:20:17 am »
I haven't tried your plugin just yet, but did you know that Ctrl+P is already set up to change objects into polylines?
I'm not sure whether there might be some conflict between the two.

Martin.
« Last Edit: December 17, 2012, 08:22:27 am by blowlamp »

Offline BR52

  • Wookie
  • ****
  • Posts: 368
    • View Profile
Re: Polygon Plugin with angle snapping.
« Reply #2 on: December 17, 2012, 09:56:20 am »
Hi Rodney

Please put your source code here.
For other people know your technique in making plugin, teach and learn how!


          The author will always be yours.

When I make a plugin, I put the source code, I like to teach how to do.

     Armando

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7420
    • View Profile
    • Cambam V1.0 French Doc
Re: Polygon Plugin with angle snapping.
« Reply #3 on: December 17, 2012, 19:18:45 pm »
Hello,

Thanks for this plugin  ;)

I found a problem:

- I can't validate the drawing by the middle mouse button, only with the 'enter' key ; if I use the middle button I get the same action that with the left MB (create a new shape).

- If I dbl click on the middle MB, I get a error message from windows

++
David

Online lloydsp

  • CNC Jedi
  • *****
  • Posts: 8987
    • View Profile
Re: Polygon Plugin with angle snapping.
« Reply #4 on: December 17, 2012, 19:51:46 pm »
but did you know that Ctrl+P is already set up
-----
Martin, he didn't use that key combination.


YES!  Please publish your source here.  Some of us (me) don't have the skills to dig into the UI, and it looks like you have, and may even have documented it.  <G>

LLoyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7420
    • View Profile
    • Cambam V1.0 French Doc
Re: Polygon Plugin with angle snapping.
« Reply #5 on: January 13, 2013, 17:56:13 pm »
Hello,

The update works well, thanks.

If you want, I add 2 pictures in attachment for buttons with the 'Cambam look'

great work
++
David

Offline Rodneyk

  • Droid
  • **
  • Posts: 65
    • View Profile
Re: Polygon Plugin with angle snapping.
« Reply #6 on: January 13, 2013, 19:42:38 pm »
Updated the green icons. See first post for latest version.

Offline swarfing

  • Droid
  • **
  • Posts: 92
    • View Profile
Re: Polygon Plugin with angle snapping.
« Reply #7 on: January 13, 2013, 22:06:08 pm »
Rodney

Works in linux but if i change the number of sides under the properties it does not do anything? Also i can not change the number of sides in the properties window to the left, it just won't allow to enter the box.

Offline Rodneyk

  • Droid
  • **
  • Posts: 65
    • View Profile
Re: Polygon Plugin with angle snapping.
« Reply #8 on: January 14, 2013, 00:35:52 am »
Rodney

Works in linux but if i change the number of sides under the properties it does not do anything? Also i can not change the number of sides in the properties window to the left, it just won't allow to enter the box.

I suggest using the hot keys to change the number of sides then.  I don't have linux so cannot really debug it.

I am not sure what you mean by your secdon statement.  The objects created are just polyline, not special polygon object.  Once created it is just a normal polyline object.

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 271
    • View Profile
Re: Polygon Plugin with angle snapping.
« Reply #9 on: October 07, 2017, 07:33:30 am »
Is there a new version that works with CamBam 1.0

thanks

Geoff

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5269
  • Made in England
    • View Profile
Re: Polygon Plugin with angle snapping.
« Reply #10 on: October 07, 2017, 09:11:35 am »
Yes, it's here; http://www.cambam.co.uk/forum/index.php?topic=6802.msg55456#msg55456
but I didn't include angle snapping because I found it better to use CamBam's rotation function after the polygon was drawn.
Filmed in Supermarionation