CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 18, 2017, 13:30:38 pm


Login with username, password and session length


Pages: [1] 2
  Print  
Author Topic: Polygons - new plugin for CamBam v1  (Read 852 times)
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3217



View Profile
« on: September 02, 2017, 10: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

* Polygons_v4.1.0.0.zip (11.39 KB - downloaded 34 times.)
« Last Edit: October 07, 2017, 10:47:50 am by EddyCurrent » Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3217



View Profile
« Reply #1 on: September 03, 2017, 15: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.




* icons.jpg (19.6 KB, 500x440 - viewed 25 times.)

* polyform.jpg (29.21 KB, 500x370 - viewed 24 times.)
« Last Edit: September 03, 2017, 16:54:19 pm by EddyCurrent » Logged
lloydsp
CNC Jedi
*****
Offline Offline

Posts: 7151



View Profile
« Reply #2 on: September 03, 2017, 16:54:41 pm »

Thanks, Eddy!

I will test those tonight or tomorrow.

Lloyd
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4745



View Profile WWW
« Reply #3 on: September 05, 2017, 02:14:30 am »

Hello Eddy,

Nice job ! I like it  Grin

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
Logged
lloydsp
CNC Jedi
*****
Offline Offline

Posts: 7151



View Profile
« Reply #4 on: September 05, 2017, 02: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
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4745



View Profile WWW
« Reply #5 on: September 05, 2017, 03:08:19 am »

Yet another hurricane !!  Shocked Shocked  Cry
Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3217



View Profile
« Reply #6 on: September 05, 2017, 10:08:19 am »

Hello Eddy,

Nice job ! I like it  Grin

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  Grin
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.




* angle.jpg (81.88 KB, 800x611 - viewed 28 times.)
« Last Edit: September 05, 2017, 10:23:06 am by EddyCurrent » Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3217



View Profile
« Reply #7 on: September 05, 2017, 19:57:48 pm »

Version 3 attached to first post.

Thanks to David's excellent testing;

1. undo points added
2. translation fixed
Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4745



View Profile WWW
« Reply #8 on: September 06, 2017, 20: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.  Shocked

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:
       
        '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:
       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

Logged
driedeker
Droid
**
Offline Offline

Posts: 52


View Profile
« Reply #9 on: September 06, 2017, 20: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


* Capturecrash.PNG (27.33 KB, 892x432 - viewed 150 times.)
« Last Edit: September 06, 2017, 21:02:49 pm by driedeker » Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4745



View Profile WWW
« Reply #10 on: September 06, 2017, 21: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
Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3217



View Profile
« Reply #11 on: September 06, 2017, 21: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, 21:26:35 pm by EddyCurrent » Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4745



View Profile WWW
« Reply #12 on: September 06, 2017, 21:38:59 pm »

Ok, problems solved Wink

++
David
Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3217



View Profile
« Reply #13 on: September 06, 2017, 21:44:19 pm »

In that case, project source files attached

* Polygon2.zip (20.79 KB - downloaded 18 times.)
Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4745



View Profile WWW
« Reply #14 on: September 06, 2017, 21:53:07 pm »

Thanks Wink
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.129 seconds with 18 queries.

Copyright © 2008 HexRay Ltd. | Sitemap