Author Topic: Polygons - new plugin for CamBam v1  (Read 12618 times)

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Polygons - new plugin for CamBam v1
« on: September 02, 2017, 09:30:21 am »
The previous Polygon plugin does not work with CamBam v1 and the dll has been obfuscated rendering the source code unrecoverable.
I have therefore written a similar plugin from scratch that retains some of the original functionality, but I intend to extend it's usefulness by being able to specify the final size precisely (future versions). done.

This plugin appears in the 'Draw' menu as "Polygons" and as icons in the Entity Toolbar

It works with CamBam v1 only in this version but once completed to satisfaction I will try to make a version that works also with 0.9.8

I never found a real use for the snaps in the old plugin by Rondeyk so I didn't include those.
They were not lined up with anything and I would rather use CamBam's own Transform tools on the final polygon.
 
Future versions

1. Add a Polygon icon next to polyline, circle etc. on CamBam's toolbar
2. add a small form to specify if the polygon should be inside a circle of specified diameter or outside the circle.
3. source code will be posted here

Edit:
Version 2 attached, one for CamBamv1.0, one for CamBamv0.9.8

Edit:

version 3 attached, one for CamBamv1.0, one for CamBamv0.9.8
1. added undo points
2. fixed translation

Edit:

version 4 attached for CamBam v1.0
1. removed version text from form
2. form issues fixed
« Last Edit: October 07, 2017, 09:47:50 am by EddyCurrent »
Filmed in Supermarionation

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: Polygons - new plugin for CamBam v1 and 0.9.8
« Reply #1 on: September 03, 2017, 14:58:50 pm »
Version 2 attached to first post.

There are two files, one is for CamBam 0.9.8, the other for CamBam 1.0

Polygons_v2.1.0.0.zip     this is for CamBam v1.0 only
Polygons_v2.0.9.8.zip     this is for CamBam v0.9.8 only

1. Added icons in the EntityToolbar and also in the Draw menu.
2. Added a form for parameter options

There are two options.

"Freehand Polygon", this allows the user to drag out a polygon to required size and adjust the number of sides.

"Parametric Polygon", this pops up a small form to allow various parameters to be set. Once the 'OK' button is pressed the plugin waits for the user to click on a centre point for the polygon, whereupon the shape is drawn.

The polygon can be drawn either inside or outsdie an imaginary circle of specified diameter.
Inside: radius of circle = distance from centre of polygon to a vertex.
Outside: radius of circle = distance from centre of polygon to centre point of a side (across flats for a hexagon)

Any further manipulation should be carried out using CamBam's 'Edit->Transform' menu options.

Unless you have good reason, I would recommend you first remove the old 'Polygon' plugin by Rodneyk in case of conflict with this one.

Once satisfied I will post the source project files.


« Last Edit: September 03, 2017, 15:54:19 pm by EddyCurrent »
Filmed in Supermarionation

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8969
    • View Profile
Re: Polygons - new plugin for CamBam v1
« Reply #2 on: September 03, 2017, 15:54:41 pm »
Thanks, Eddy!

I will test those tonight or tomorrow.

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

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: Polygons - new plugin for CamBam v1
« Reply #3 on: September 05, 2017, 01:14:30 am »
Hello Eddy,

Nice job ! I like it  ;D

Two remarks: Undo is not working, the texts in the Window can't be translated.

It would be fine if we can use the shift key, as when we draw a polyline, to snap to the angles where a segment is horizontal or vertical, depending of the number of side of the shape.

++
David

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8969
    • View Profile
Re: Polygons - new plugin for CamBam v1
« Reply #4 on: September 05, 2017, 01:24:48 am »
And I fell off my wagon today... didn't get it tested.

There's too much preparations necessary for the on-coming hurricane Irma to do anything fun!

'Spent all day getting the power systems and generator checked out, and securing loose items.  More to do tomorrow.  I'll be 'out of it' for a few more days.  'Storm's due here next Saturday or Sunday.  When you run a working farm, there's always more to do than time in the day!

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

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: Polygons - new plugin for CamBam v1
« Reply #5 on: September 05, 2017, 02:08:19 am »
Yet another hurricane !!  :o :o  :'(

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: Polygons - new plugin for CamBam v1
« Reply #6 on: September 05, 2017, 09:08:19 am »
Hello Eddy,

Nice job ! I like it  ;D

Two remarks: Undo is not working, the texts in the Window can't be translated.

It would be fine if we can use the shift key, as when we draw a polyline, to snap to the angles where a segment is horizontal or vertical, depending of the number of side of the shape.

++
David

I know why Undo is not working  ;D
I may have forgot to put t in the form Tag

I thought Andy would have included those snaps but found they don't work in this process.

I find it's better to use CamBam's Rotate lined up along a side after drawing the polygon.


« Last Edit: September 05, 2017, 09:23:06 am by EddyCurrent »
Filmed in Supermarionation

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: Polygons - new plugin for CamBam v1
« Reply #7 on: September 05, 2017, 18:57:48 pm »
Version 3 attached to first post.

Thanks to David's excellent testing;

1. undo points added
2. translation fixed
Filmed in Supermarionation

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: Polygons - new plugin for CamBam v1
« Reply #8 on: September 06, 2017, 19:20:13 pm »
Hello

Ok, translatable, but please, remove the translation for "Version 2.0" text, or only translate "Version", because each time a new version of the plugin will be created, each time a new entry with a new version number will be added to the translation list.  :o

2 small things to repair:

- the plugin windows disappears if we click in the cambam display area and is not minimized when the main CB form is minimized

- the plugin windows can be opened multiple time.

What I use in VB in the BoxAuto plugin to solve this 2 issues

Code: [Select]
       
        'exit if the form is already opened
        For Each fm As Form In Application.OpenForms
            If fm.Name = "Tool_Make_Box_Creneled" Then Exit Sub
        Next fm

        'attach the tool windows to the main cambam window, and open it
        Dim f As Form = New BoxAutoPlugin.Tool_Make_Box_Creneled
        CamBam.ThisApplication.TopWindow.AddOwnedForm(f)

also in the FormClosed function, I add the following code, so the main CB windows is forced to the front of the display when the plugin window is closed.

Code: [Select]
       Me.Hide()
        CamBam.ThisApplication.TopWindow.BringToFront()

In the case of this plugin, it is not really useful that the display stay accessible, so maybe it's more easy for youy to just set the plugin form as modal.

++
David


Offline driedeker

  • Storm Trooper
  • ***
  • Posts: 162
    • View Profile
Re: Polygons - new plugin for CamBam v1
« Reply #9 on: September 06, 2017, 19:59:31 pm »
Crashes on my CB 1 13 3 on windows 7 64 when click on add polygon but ok with freehand or parametric
« Last Edit: September 06, 2017, 20:02:49 pm by driedeker »
Made in England in 53

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: Polygons - new plugin for CamBam v1
« Reply #10 on: September 06, 2017, 20:08:42 pm »
Hello

I think you have installed the wrong version of the plugin ; use the version for CB V1.0

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

I get the same error as you if I use the 0.98 version on CB1.0

++
David

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: Polygons - new plugin for CamBam v1
« Reply #11 on: September 06, 2017, 20:20:13 pm »
Version 4 attached to first post, for CamBam v1.0 only
Hopefully all issues highlighted by David are fixed.

Yes it looks like the 'Baron' installed the incorrect version.
« Last Edit: September 06, 2017, 20:26:35 pm by EddyCurrent »
Filmed in Supermarionation

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: Polygons - new plugin for CamBam v1
« Reply #12 on: September 06, 2017, 20:38:59 pm »
Ok, problems solved ;)

++
David

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: Polygons - new plugin for CamBam v1
« Reply #13 on: September 06, 2017, 20:44:19 pm »
In that case, project source files attached
Filmed in Supermarionation

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: Polygons - new plugin for CamBam v1
« Reply #14 on: September 06, 2017, 20:53:07 pm »
Thanks ;)