Author Topic: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin  (Read 15370 times)

Offline onekk

  • CNC Jedi
  • *****
  • Posts: 521
    • View Profile
Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« on: December 01, 2016, 17:26:52 pm »
Hi to all, this is my version Boxes Plugin.

This is the place where I will put the updated version of this plugin.

Generally due to my lack of a Windows machine that could do a decent compilation (I'm working on getting a working one soon), i post the sources and if someone kindly compile them I will post the dll here or you will find the compiled dll in the post of the "good boy" who compile them.

I'm working on a Manual, but seems to be a "very long task" due to the WIP nature of the plugin and my lack of time.

Periodically i will update this post to mantain a more clean thread, (I hope :-D)


This version has some improvement but it is not totally finished yet;

The interface is popoluated by some garbage (left from reusing the old BoxAuto Interface)


1) it has almost all the capabilities of the old version, only the Sliding cover box is not implemented (yet)

2) it has the capability of drawing polygonal boxes from 3 to 20 (actually i didn't rember weel the limit) sides
 the 4 side is a particular case has you can specify the Height and the Width of the Box (it works like the old plugin)

It has some error in it, but it is angle-driven, so all the crenelated side could be drawn at each angle and retain the correct draw.

Let me know what you think about the plugin, (I publish only the sources) it's developed in Linux with Mono.

EDIT: new version Boxes_Tres.zip with some improvements


EDIT: -- FOR NOW only the source version of 0.1.9-alpha2 is posted,  some bug are found in the previous versions but I've not a compiled dll with the changes. Stay tuned.

EDIT: New version is Boxes XT BoxesXT_019a2.zip feel free to test it and let me know if it is working for you.

This version is Experimental so something is wrong in the code and don't rely on it for serious work prior to have checked and inspected the produced objects.

A brief summary of the capabilities:

- Open, Closed and Frame Boxes with "reduced front" and  "bridged sides" variant of the "Open Box"

- inside or outside dimensions

- the "crenelation" caould specify a "finger width" and a "assembly clearance", plus a "finger over-length" to permit a better finish of the box (the "finger over_length") make the fingers protrude from the finished side to permit a compensation of irregular material thickness or other "effects".

- it has a dividers options that draw dividers on the "Height side" and even on the "Width side" (The Box is drawn with a Width an Height and a Depth, the depth is the depth of final box so the Width and Height are the length of the walls of the finished box)

- The plugin could generate the MOPS to shorten the "Time to Market" of the box, using CamBam styles and the tools definitions

- from 0.1.9-alpha2 there is a Plywood Tweak to give a better finish of the box.

- "Cren LN" button, slecting a polyline (straight line) and pressing this button two mating sides are generated, using finger definition and and thickness parameters from the main form. Move the generated sides whatever you want.

- "Delete" button permit to select a generated box (Named Box-0, Box-1, and so on) and delete all the created entities and even the related MOPS.


How dividers works

In the options tab there are some control fields that control the number of dividers and the "slots depth"  expressed as a fraction of the material thickenss (so 0.50 of 5mm math thick means 2.5 mm depth).

If you put the number of dividers at 0 the divider and the corresponding slots are not drawn.

The "slots depth" is added to the internal divider dimensions, if you put then at 0 or negative the divider is drawn accordingly (maybe to make removable dividers).

The slots obviously are not "drawn" if the "slot depth" is 0 or negative.

How "Plywood Tweak" works

In the "MOP tab" a "plywood tweak"  checkbox and the related controls "PWT target depth" and "PWT depth increment" to tune the MOPs.

They are intended to do pre-cuts of smaller stepdown in the plywood to avoid a better surface finish not damaging the venners and rasing spline when cutting the profiles and the slots.

It works as follows:

- duplicate the profile and pockets mops doing a precut of  "PWT target depth" and  "PWT depth increment" with "no tabs" prior to cut the overall depth (material Thickness) with the "depth increment".

The differences in the definition of values between "Depth Increment"  and "PWT Depth increment" are explained  below, and are due to the different purpose of the cuts.

For cutting the overall depth many people suggest to use a stepdown value expressed as a fraction of the tool diameter so the fraction is used.

But when breaking the surface, a more "refined approach" has to be used, with some materials I use a stepdown of 0.25 mm with a 3mm - 2 flute "uppercut" tool is more conservative, but many of you would prefer instead a 0,1mm stepdown so a "absolute" value is used.

When using the "plywood tweak" the final cut is started at a negative "stock height" similar to the "PWT Target depth" to avoid "cuts in the air" and to shorten machining time.

Regards

Carlo D.
« Last Edit: August 13, 2019, 15:20:51 pm by onekk »
Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
Re: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« Reply #1 on: December 01, 2016, 17:44:32 pm »
Did a quick test - shapes are generated as expected.

Attached the compiled binary below

Offline onekk

  • CNC Jedi
  • *****
  • Posts: 521
    • View Profile
Re: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« Reply #2 on: October 13, 2018, 09:14:09 am »
NEW Version:

1 -Added a new Open Box - with Bridege sides, to make things like supports, and maybe tables and stools
2 - Some refinement in calculations

As usual I will publish the sources.

Let me know if it useful to someone, and improvement or criticism.

Regards

Carlo D.
« Last Edit: March 04, 2019, 18:17:58 pm by onekk »
Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam

Online BR52

  • Wookie
  • ****
  • Posts: 363
    • View Profile
Re: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« Reply #3 on: October 21, 2018, 19:19:53 pm »
Hello programmers,

Can anyone tell me where the "Label <-> Radius" component is.
I searched the word "Radius" with attribution for "Label", I did not find it.
My brain is on fire, recalculating all positions and indexing matrix, I'm looking like Donald Duck.  ;D

The half-hidden NumeriUpDown component has NUD_Heig assignment.
See image below Visual Studio 2017.

   Armando
« Last Edit: October 21, 2018, 19:57:41 pm by BR52 »

Online BR52

  • Wookie
  • ****
  • Posts: 363
    • View Profile
Re: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« Reply #4 on: October 21, 2018, 19:50:10 pm »

             BoxesPlugin source code for download.

   Armando


Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4933
    • View Profile
Re: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« Reply #5 on: October 21, 2018, 21:04:01 pm »
Compiled dll attached. (tested on CamBam v0.9.8 and v1.0 )

The form looks okay for me.

If the number of sides chosen is anything other than 4 then the 'Radius' is the distance from the centre to one corner of the polygon that defines the shape of the box.

Example shows a 6 sided box with Radius = 50
« Last Edit: October 21, 2018, 21:14:33 pm by EddyCurrent »
Made in England

Online BR52

  • Wookie
  • ****
  • Posts: 363
    • View Profile
Re: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« Reply #6 on: October 21, 2018, 22:40:12 pm »
Hi Eddy

Please, you could put your source code here for me to analyze.
And compare with the source of Carlo.

   Armando

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6716
    • View Profile
    • Cambam V1.0 French Doc
Re: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« Reply #7 on: October 21, 2018, 23:06:48 pm »
Hello

This problem of object misplaced, I get it depending on the Windows version used to do the compilation.

The same file, with the same net framwork version give me different placements depending if compiled on XP or on 7 .. mostly for me the pb is with the form size (internal size) that is smaller on 7 than XP and that "push" the boxes in a wrong position (and also depending of the choice for the font in Win 7 ; 100%, 125%, etc ..)

the option label is also misplaced on your picture (not enough vertical space between the boxes)

Edit: And I can't test/compile your files because they are done with a more recent version of visual studio than the one I use (VS2010)

++
David
« Last Edit: October 21, 2018, 23:32:46 pm by dh42 »

Offline onekk

  • CNC Jedi
  • *****
  • Posts: 521
    • View Profile
Re: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« Reply #8 on: October 22, 2018, 10:30:52 am »
Hello programmers,

Can anyone tell me where the "Label <-> Radius" component is.
I searched the word "Radius" with attribution for "Label", I did not find it.
My brain is on fire, recalculating all positions and indexing matrix, I'm looking like Donald Duck.  ;D

The half-hidden NumeriUpDown component has NUD_Heig assignment.
See image below Visual Studio 2017.

   Armando


In my source is in the file BoxexFormAct  (The name contain an error, and next time i will corecct it was intended to be BoxesFormAct) in the  NUD_Value_Changed(object sender, EventArgs e) around line 314 and it is done in this manner:

Code: [Select]
private void NUD_Value_Changed(object sender, EventArgs e)
{
string name = ((System.Windows.Forms.NumericUpDown)sender).Name;

// .AddLogMessage (String.Format("NUD_Value_Cahnged Auto: Name {0}\n",name));

if (name == "NUD_Sides") {
int sides = (int)NUD_Sides.Value;

if (sides != 4)
{
L_Heig.Text = TextTranslation.Translate("Radius");
L_Width.Visible = false;
NUD_Width.Visible = false;
}
else {
L_Heig.Text = TextTranslation.Translate("Box Height");
L_Width.Visible = true;
NUD_Width.Visible = true;
}

}
if (name == "NUD_Prec") {
precision = (int)NUD_Prec.Value;
}

Action();
}


It's the same of the Height of the box, but for sides > 4 the Height and Width has no sense so a Radius is more meaningful, so the Label L_Heig.Text is changed and the Widht is Disabled.

There is no usable interface Designer for Linux and Windows Form, so the interface is done by hand and in the next future it will be rewritten to be parametric, so a change in font don't mess it up, I'm studying about the better method to do it.

Maybe we could try to make some reusable code that could be used when building plugins, that work in Linux and Windows, Specially in the interface design, that is the most "difficult" part in Linux and even in Windows I think if someone want the interface to be able to set his own font to use (maybe to avoid some bad assumptions or to improve readability)

Maybe even a skeleton or a little tutorial for the newcomers, but there will be a quite big amount of work and discussion to be done.


Regards

Carlo D.
« Last Edit: October 22, 2018, 10:41:00 am by onekk »
Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1539
    • View Profile
Re: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« Reply #9 on: October 22, 2018, 11:56:52 am »
Hi Carlo
Quote
There is no usable interface Designer for Linux and Windows Form, so the interface is done by hand and in the next future it will be rewritten to be parametric, so a change in font don't mess it up, I'm studying about the better method to do it.
Have you seen this:https://alternativeto.net/software/monodevelop/
Dave

Online BR52

  • Wookie
  • ****
  • Posts: 363
    • View Profile
Re: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« Reply #10 on: October 22, 2018, 15:11:05 pm »
Eddy:

Even so with all explanation of the context presented.
I'd like to see your source code.

Carlo:
I thought you wore MonoDevelop.

   Armando

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4933
    • View Profile
Re: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« Reply #11 on: October 22, 2018, 15:52:08 pm »
Aramndo,

It is the code Carlo posted here; http://www.cambam.co.uk/forum/index.php?topic=6250.msg61342#msg61342
and I changed nothing in it other than the References paths to CamBam
« Last Edit: October 22, 2018, 15:53:54 pm by EddyCurrent »
Made in England

Offline onekk

  • CNC Jedi
  • *****
  • Posts: 521
    • View Profile
Re: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« Reply #12 on: October 22, 2018, 16:59:52 pm »
Eddy:

Even so with all explanation of the context presented.
I'd like to see your source code.

Carlo:
I thought you wore MonoDevelop.

   Armando


Hi Armando, the zip file attached in this post

http://www.cambam.co.uk/forum/index.php?topic=6250.msg61342#msg61342

hold the source code, as Eddy told you, you have to change the reference libraries of CamBam, (Monodevelop use a VS2012 solution format) and generally you could compile it on Windows.

Eddy generally kindly compiles my code to be able to run on Windows (As my Windows developing platform is on manufacturing).

The sources are not very documented, as are work in progress, there are some routine in BoxesService.cs that are almost reusable, I use them even on another plugins not even released that is intended to make a Castle like some friend of David (dh42) have done, it is more complicated as it expand the concept found in BoxAuto and work with multiple Sheets (Rendered as Layers), but it is a mere exercise, and it is stalled, as my children are growing and the developing time is much slower than their growth :-D

There are many routine that cope with drawing generic objects using a base line as generator, in this meaning is angle driven, as an example if you wanto to make a crenelated polygon, you have to cope with the orientation of the base line and do some left turn and right turn so if you have the base angle and the direction (sorry I have not learned very well the concept of vector) you could trace the line despite his orientation.

The code is not very clear and maybe involuted, I'm not a professional programmers and neither a educated programmers, I could define myself a self teached programmers, so my code is merely working (Hoping most of the times).

Regards

Carlo D.
 

Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6716
    • View Profile
    • Cambam V1.0 French Doc
Re: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« Reply #13 on: October 22, 2018, 17:40:23 pm »
Hello Carlo

Here are the pictures of the boxes, as requested ;)

++
David

Offline onekk

  • CNC Jedi
  • *****
  • Posts: 521
    • View Profile
Re: Boxes Plugin -- Improved and rewritten version of BoxAuto Plugin
« Reply #14 on: November 05, 2018, 17:45:33 pm »
New version, not much improvement and WIP.

The main modification is a semi automatic resizing of the form, due to the lack of form designer in Linux, I've added a TabPage, settings in which you will find a fontsize NUD (limited to 10 to 16 point) that you could change and the form of the plugin is resized and redrawn with the fontsize required.

Some work has to be done, but I think that some pieces of code could help to write much more friendly plugins, as the Linux version seem to be affected by some bugs in the interface fonts managing.

I'm still in need of some hint in how to change the fontsize of the main interface, some font are found some other not, I've opened some time ago (weeks) a topic about it.

This is a partial solution, as the interface metrics has to be defined by hand, I have used the concept of "em size" in other word the width of the "m" in a proper font and found this value in the ResizeForm function.


Find it above at the first post

Regards

Carlo D.
« Last Edit: March 04, 2019, 18:19:11 pm by onekk »
Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam