Author Topic: Shapes Plugin  (Read 31161 times)

Offline nehovis

  • Ewok
  • *
  • Posts: 13
    • View Profile
Shapes Plugin
« on: January 21, 2015, 12:50:07 pm »
I wanted to share what I have learned from Andy Payne's and FrankM earlier work on plugins.  My hope in doing this is that someone can take this code to the next step or use it to help develop another plugin.
I have included the source code for this plugin as well as a pdf file that quickly goes through the features.
What I enjoyed the most in doing this is to be able to generate a shape from an equation - see the code on generating a heart shape.
I used the heart shape to make an ordainment for my wife after her mother passed away last September.
I did the programming with Microsoft Visual Studio Express 2013 for Windows Desktop using the C# language.
Happy coding!
Thanks,
Norm

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8969
    • View Profile
Re: Shapes Plugin
« Reply #1 on: January 21, 2015, 12:53:41 pm »
That's a very interesting piece of work!  Thanks!

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

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3355
    • View Profile
Re: Shapes Plugin
« Reply #2 on: January 21, 2015, 13:31:30 pm »
That is really unique work. Very elegant. Thanks for this.
My 2¢

Win11, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, 4th Axis, Endurance Laser.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: Shapes Plugin
« Reply #3 on: January 22, 2015, 07:21:43 am »
Lovely, you may have got me back on C# because the coding is understandable and some useful stuff in there, thanks. I do like the C style syntax better than VB but find it harder to get results using classes.
Filmed in Supermarionation

Offline nehovis

  • Ewok
  • *
  • Posts: 13
    • View Profile
Re: Shapes Plugin
« Reply #4 on: January 26, 2015, 11:58:57 am »
I updated the plugin with a new tab called SuperEllipse.  I was inspired by GeoffreyGRoy plugin called: Squircle.  I wanted to see what it would take to incorporate something like this in my plugin.
I also changed the defaults for the Num Sides tab for a 3/4 inch bolt. I did this for Lloyd - he had a request for a hex bolt option.

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3355
    • View Profile
Re: Shapes Plugin
« Reply #5 on: January 26, 2015, 12:40:50 pm »
Thank you for this.

 "I did this for Lloyd - he had a request for a hex bolt option."

I think, it was me who asked for it in different topic not realizing that somebody actually did this already(polygon).

I give a try definitelly, there is not a such a thing as to much tools  ;D ;D ;D
My 2¢

Win11, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, 4th Axis, Endurance Laser.

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3355
    • View Profile
Re: Shapes Plugin
« Reply #6 on: January 26, 2015, 12:58:14 pm »
Hi, Just tried your plugin and like. But I would change one thing for it to be practical. Usually way to measure the HEX is to measure the distance between the flats. Please see the attachment. Thanks.
« Last Edit: January 26, 2015, 13:01:21 pm by Bubba »
My 2¢

Win11, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, 4th Axis, Endurance Laser.

Offline BR52

  • Wookie
  • ****
  • Posts: 368
    • View Profile
Re: Shapes Plugin
« Reply #7 on: January 27, 2015, 01:01:24 am »
Hello nehovis

When Microsoft invited me to participate in the Windows 10, I bought a
new HD and transfer all backup of the win7 along with Visual Studio 2010.
I installed Visual Studio 2013 Express for Windows Desktop, the two versions
works fine on Windows 10.

Let's get to what's important.
I changed the source code and altered the path of the DLLs.
DLLs He had of other versions all together on the same project!  ???
The version of the my Cambam is 0.9 Rel8P (beta-2)

See the attached file "Shapes_Plugin_V1.1_Source.zip"
And goes the "ShapesPlugIn_dll.zip" attached file for all users install.

   Armando

Offline BR52

  • Wookie
  • ****
  • Posts: 368
    • View Profile
Re: Shapes Plugin
« Reply #8 on: January 27, 2015, 14:21:26 pm »
Here it is the screen capture of Windows 10 and the configuration on the
Visual Studio Express 2013.

   Armando

Offline coolant slinger

  • Wookie
  • ****
  • Posts: 312
    • View Profile
Re: Shapes Plugin
« Reply #9 on: January 27, 2015, 15:02:37 pm »
Nehovis,
I agree with Bubba that being able to select size of the Hex across flats would be more practical. Also being able to snap to a point would help. That way I could snap to a point I created for the center of the hex and then snap to another point I created as representing the radial amount of hex. just keep in mind that the second snap point would need to originate at the center of the flat. Otherwise great job with the plug in.

Offline kvom

  • CNC Jedi
  • *****
  • Posts: 1612
    • View Profile
Re: Shapes Plugin
« Reply #10 on: January 27, 2015, 21:07:33 pm »
Dimensioning a polygon across the points is useful for sizing to the max that can be milled from round rod.  From the flats is useful for sizing to a wrench or socket.  Draftsight gives you both options.

Offline nehovis

  • Ewok
  • *
  • Posts: 13
    • View Profile
Re: Shapes Plugin
« Reply #11 on: February 13, 2015, 13:20:09 pm »
This update is for Bubba.  I added a new tab called: Bolts.  I hope I was able to transfer the sizes of each bolt correctly.  If there are errors, I made it so the entries can be modified or deleted.  You can also add new entries as well.  I wanted to use some other types of programming for this update.  I used a dataGridView to list the bolts.  But the most important difference is that I am using what I call a poor man’s database called an XML file.  When this plugin is executed, it searches the following location for the file:   "C:\Program Files\CamBam plus 0.9.8\Bolts.xml".  If this file does not exist, it will generate it automatically. Once this file is generated, any updates additions or deletions will be maintained in this file.
Please note: I did not put in a lot of error checking.  For example, if new data entered is not the right type or missing information is not verified it will cause the plugin to fault out.
I included the ISO and ASME PDF files I used as reference.

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1826
    • View Profile
Re: Shapes Plugin
« Reply #12 on: February 13, 2015, 13:48:32 pm »
Hi Nehovis
Looks good thanks for the effort. I think I'll be able to use some of this code to add to my knowledge for converting my paraboliod script to C#.
Dave.

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3355
    • View Profile
Re: Shapes Plugin
« Reply #13 on: February 13, 2015, 21:39:45 pm »
This update is for Bubba.  I added a new tab called: Bolts.
*******************

Thanks. Will try it later because right now I'm in no shape to do anything. I think I got a flu  :'(
My 2¢

Win11, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, 4th Axis, Endurance Laser.

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3355
    • View Profile
Re: Shapes Plugin
« Reply #14 on: February 14, 2015, 14:38:22 pm »
 I added a new tab called: Bolts.
***************

Hi, downloaded and unzipped the plugin but the new tab ;bolts; are nowhere to be found. I must have done something wrong. I never have any trouble installing a plugin up to this point.. What gives?
My 2¢

Win11, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, 4th Axis, Endurance Laser.