CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 20, 2017, 11:33:11 am


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Drawing 3D Solid primitives Plugin  (Read 1037 times)
karst.drenth
Droid
**
Offline Offline

Posts: 58


View Profile
« on: March 28, 2017, 21:59:14 pm »

Hi All,

As of a result of my GRBLMachine Plugin, I developed some 3D Solid Primitives.

As a showed here:
Re: GRBL v1.1 Machine Control and GCODE sender Plugin
they are fully compatible with CamBam's drawing system (including saving and reading the .cb file).

With this plugin, you can use them also in your own drawings, even if you do not have/need/want GRBLMachine Tongue (this plugin WILL come as a satelite plugin together with GRBLMachine in the future Wink )

I made the whole thing so that it can be extended (by you), used in your own plugin(s), or just standalone.
If there is some positive response here, I will extend it with 'Tube', 'Cone', 'Beam' and 'Pane' and maybe even 'Toroid'.

The classes are in the CamBam.CAD.Solids namespace and the plugin also includes my CamBam Extensions.
So you might just reference them in your own project.

The operation is quite simple:

- Right click in the View
- Select 'Draw'
- Select 'Solids'
- Select the primitive of your choise
- Fill in the properties
- Press OK or Apply to insert the Solid into your drawing.

Something like this:


(click for the full picture)

... that's where they hide Wink


(click for the full picture)

... this is how you set the properties


So, please tell me if there are more wishes Smiley I would like to add a 'Settings' dialog under 'Plugins' to set some defaults.


Grtzz,

Karst

P.S. Source code comes later on online. I am preparing GRBLMachine official 1.0.0, which also uses CamBam.CAD.Solids. With that source I will also release this source

[History]

Attached V1.0.0.1 since 1.0.0 has no decimal places in the property dialogs Tongue  Embarrassed
30th Mar 2017: Attached v1.0.1

[/History]

Sources can be found here (click)

* CamBam.CAD.Solids-V1.0.0.1.zip (13.49 KB - downloaded 59 times.)
* CamBam.CAD.Solids-V1.0.1.zip (18.59 KB - downloaded 59 times.)
« Last Edit: March 30, 2017, 22:40:24 pm by karst.drenth » Logged
lloydsp
CNC Jedi
*****
Offline Offline

Posts: 7114



View Profile
« Reply #1 on: March 28, 2017, 22:28:25 pm »

Ok, Karst!  You've got me hooked!  Cheesy

Lloyd
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
karst.drenth
Droid
**
Offline Offline

Posts: 58


View Profile
« Reply #2 on: March 28, 2017, 22:31:54 pm »

 Grin Grin

And now for someone who comes up with a decent 'Subtract' algorithm to subtract some solids/surfaces Wink

Anyone here ? Tongue


Grtzz,

Karst
Logged
karst.drenth
Droid
**
Offline Offline

Posts: 58


View Profile
« Reply #3 on: March 30, 2017, 22:34:35 pm »

Hi All,

So, also some progress here Smiley

Version 1.0.1 is there, as usual also including sources  !

I posted this new version at the bottom of this post: Drawing 3D Solid primitives Plugin

Mods:

- Completed the property editor for the settings of the plugin
- Taking the defaults into the draw dialogs
- Added the 'Solids' item to the main 'Draw' menu


(click for the full picture)

Note: You can use CamBam.CAD.Solids.dll from your own plugin projects, by simply referencing it in Visual Studio

So... have fun with the plugin and/or the sources !


Grtzz and please keep me informed about what you think of CamBam.CAD.Solids,

Karst

« Last Edit: March 31, 2017, 07:19:41 am by karst.drenth » Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4686



View Profile WWW
« Reply #4 on: March 31, 2017, 16:01:59 pm »

Hello

Oh ! .. I missed this topic  Shocked ...

Another nice job, thanks  Grin

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

Posts: 3139



View Profile
« Reply #5 on: March 31, 2017, 16:04:38 pm »

The Revolved Extrude plugin can also draw what look like solids but are actually wrapped surfaces
Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4686



View Profile WWW
« Reply #6 on: April 04, 2017, 20:42:05 pm »

Hello

It's strange, but the menus can't be translated  Huh (tried on both 0.98 and V1.0)

Usually, menus can always be translated even if no specific code is added in the plugin (menu is the only thing that is automatically translated) ... how did you disable the menu translation ?

++
David
Logged
karst.drenth
Droid
**
Offline Offline

Posts: 58


View Profile
« Reply #7 on: April 04, 2017, 21:01:09 pm »

Hi David,

I did not Wink ( at least consciously... )

But I can/could explain it: The names in the menu's are taken directly from the Type.Name of the solids.

So without changing the name of the class, the MenuItem will not change. I guess it should be subject to 'manual' translation when I start to build in translation.

Grtzz,

Karst
Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4686



View Profile WWW
« Reply #8 on: April 04, 2017, 21:12:13 pm »

The strange thing is that the texts appears in the translation list (rod, sphere etc), except 'Solids' that is not here ... maybe they comes from the GRBL plugin ?

++
David
Logged
karst.drenth
Droid
**
Offline Offline

Posts: 58


View Profile
« Reply #9 on: April 04, 2017, 21:33:27 pm »

This is the code that creates the menu's:

Code:
    private static ToolStripDropDownItem CreateSolidsMenu(List<Type> solids)
    {
      ToolStripDropDownItem solidsToolStripMenuItem = new ToolStripMenuItem("Solids") { Name = "solidsToolStripMenuItem" };

      foreach (Type type in solids)
      {
        Solid s = Activator.CreateInstance(type) as Solid;

        solidsToolStripMenuItem.DropDownItems.Add(new ToolStripMenuItem(s.DisplayName,null,(object x, EventArgs y) =>
        {
          Solid tag = (x as ToolStripMenuItem).Tag as Solid;

          new DrawSolidForm(tag).Show(ThisApplication.TopWindow);
        }) { Tag = s });
      }

      return solidsToolStripMenuItem;
    }

As you can see, it's just a normal ToolStripDropDownItem. If anybody has a clou, please tell me Wink

Grtzz,

Karst
Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4686



View Profile WWW
« Reply #10 on: April 04, 2017, 22:19:17 pm »

I'm not familiar with C syntax but I've a look on a VB plugin I've done and it seems that the only change is that the name is not given in the ToolStripMenuItem() statement but separately. But not sure it have anything to do with the pb.

in VB

Dim mi As ToolStripMenuItem = New ToolStripMenuItem()   'the new menu entry (item)
mi.Text = "Numerical move"
....
....

« Last Edit: April 04, 2017, 22:49:36 pm by dh42 » Logged
Pages: [1]
  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.133 seconds with 18 queries.

Copyright © 2008 HexRay Ltd. | Sitemap