Author Topic: Wrapper Plugin  (Read 72258 times)

Offline kvom

  • CNC Jedi
  • *****
  • Posts: 1607
    • View Profile
Re: Wrapper Plugin
« Reply #30 on: June 05, 2015, 00:18:19 am »
The plugin seems to have some math problems.

I have the following lines: 

G0 X0.0 Y0.0
G1 F15.0 X0.7071 Y0.7071

That's a 1" line at a 45 degree angle to the X and Y axes

The conversion, using a 3" diameter is:

G0 X0.0 A180.01800
G1 F15.0 X0.7071 A52.72727

The angular move should be 27 degrees, and the starting point should be A0

What's going on?  Seems to be something to do with the A min and max values



Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6682
    • View Profile
    • Cambam V1.0 French Doc
Re: Wrapper Plugin
« Reply #31 on: June 05, 2015, 17:14:49 pm »
Hello,

I attach a file and a picture of the settings if you want take a look.

Quote
The angular move should be 27 degrees, and the starting point should be A0

you must set the angle yourself

the difference with CNc wrapper is that it's not needed to set the stock surface to radius, you can works with 0 for SS and say to the plugin where is the baseZ (in this case, baseZ = 0, diameter = 3")

++
David
« Last Edit: June 05, 2015, 17:17:40 pm by dh42 »

Offline kvom

  • CNC Jedi
  • *****
  • Posts: 1607
    • View Profile
Re: Wrapper Plugin
« Reply #32 on: June 05, 2015, 18:49:44 pm »
I may be being dense.  If I specify  the diameter then Y converts to A directly  by geometry.  What is the purpose of setting the A min/max?  Is it trying to stretch/shrink the g-code to fit inside the angle range?

I downloaded the trial of CNCwrapper and it produced exactly what I expected to see, a phenomenon related to what I used to know as "the principle of least astonishment" in my working days.

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6682
    • View Profile
    • Cambam V1.0 French Doc
Re: Wrapper Plugin
« Reply #33 on: June 05, 2015, 19:27:41 pm »
Quote
Is it trying to stretch/shrink the g-code to fit inside the angle range?

Yes, I think if I well remember my tests  ...

in the doc he say:

The following items of data are required (from the G-Code file) and inserted into the plugin
(manually):
For an X-wrap:
• The minimum and maximum X values (Xmin and Xmax).
• The base Z value (most likely 0.0, but not necessarily, i.e. the wrappewd model surface could
be defined at some other Z-value.
• The wrap angles, i.e. the angle (Amin) that Xmin maps to, and the angle (Amax) that Xmax
maps to. By default these values are 0.0 and 360.0 degrees.

++
David

Edit, yes I do a quick test and it stretch/shrink the Gcode to match the given angle with the given size
« Last Edit: June 05, 2015, 19:33:07 pm by dh42 »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4854
    • View Profile
Re: Wrapper Plugin - update
« Reply #34 on: December 03, 2015, 15:01:49 pm »
I thought an update to the Wrapper plugin might be handy, please see attached file.

Changes:
1. Added gcode viewer of input and output files.
   The code will update from the input file to output file once 'Start Conversion' button is clicked.
2. Changed WrapperUIForm layout
3. Added extra lines of comments in output file to show information on;
   Diameter, Z Base, Reverse Angle

Once it's been agreed that all is working as it should I will post the source files.

Edit: version removed, see later post for most recent files
« Last Edit: December 05, 2015, 12:21:15 pm by EddyCurrent »
Made in England

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1536
    • View Profile
Re: Wrapper Plugin
« Reply #35 on: December 03, 2015, 21:41:06 pm »
Looks good Eddy.
The only thing extra I could think of was to split the gcode view in to two tabs, one for the old code and one for the new transformed gcode
Dave

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4854
    • View Profile
Re: Wrapper Plugin
« Reply #36 on: December 03, 2015, 21:52:59 pm »
Dave, good idea.

I didn't want to upset anyone by modifying this, but it does say in the source file;

partial quote.
"This program is free software: you can redistribute it and/or modify it . . .  "
Made in England

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4854
    • View Profile
Re: Wrapper Plugin
« Reply #37 on: December 04, 2015, 09:50:13 am »
Version 1.0.8 attached

changes:
1. circumference text box is populated upon form load
2. added another text box so input file and output file can be examined side by side.

Edit: minor changes to form, no icon, no maximise button

Edit: version removed, see later post for most recent files
« Last Edit: December 05, 2015, 12:21:32 pm by EddyCurrent »
Made in England

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6682
    • View Profile
    • Cambam V1.0 French Doc
Re: Wrapper Plugin
« Reply #38 on: December 04, 2015, 20:52:07 pm »
Hello Eddy

The plugin is no longer translatable .. certainly because the tab (Wrapping) ;)

tabs need more code to be translated.

take a look in the New() function in my NumMove plugin ;)

++
David

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4854
    • View Profile
Re: Wrapper Plugin
« Reply #39 on: December 04, 2015, 20:57:26 pm »
David,

The tab is only there because I was going to add more features, but I don't think it's going to happen.
I will remove the tab and see how translation goes from there.
Made in England

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6682
    • View Profile
    • Cambam V1.0 French Doc
Re: Wrapper Plugin
« Reply #40 on: December 04, 2015, 21:01:49 pm »
Ok  ;D

++
David

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4854
    • View Profile
Re: Wrapper Plugin
« Reply #41 on: December 04, 2015, 21:35:13 pm »
David,

Try this version with translations.

Edit: version removed, see later post for most recent files

« Last Edit: December 05, 2015, 12:21:53 pm by EddyCurrent »
Made in England

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6682
    • View Profile
    • Cambam V1.0 French Doc
Re: Wrapper Plugin
« Reply #42 on: December 04, 2015, 23:01:40 pm »
Better, but all in the black frame can't be translated. (GroupBox ?)

in VB

Me.GroupBox1.Text = TextTranslation.Translate(Me.GroupBox1.Text)

translate the top text of the groupbox, like "Arrows" "Size" and "Fonts" in this image




TextTranslation.Translate(Me.GroupBox1.Controls, CamBamConfig.Defaults.Language)

Translate the controls contained in the GroupBox (you need to do that for each groupbox)

It is the same for tabs

Me.TabPage1.Text = TextTranslation.Translate(Me.TabPage1.Text)

will translate the text of the tab itsef ("Arrows", "Dimensions") and

TextTranslation.Translate(Me.TabPage1.Controls, CamBamConfig.Defaults.Language)

will translate the controls in the tab (but only those that are not in a groupbox I think)
You need to do that for each tab

++
David



« Last Edit: December 04, 2015, 23:04:09 pm by dh42 »

Offline newlinuxuser

  • Droid
  • **
  • Posts: 84
    • View Profile
Re: Wrapper Plugin
« Reply #43 on: December 05, 2015, 00:00:27 am »
Hello, I would just point out this little bug in the name of the output file:

Example input file:
/home/andrea/Documenti/Disegni/CamBam/Air4_marcatura_POMELLO.ngc

Related output file:
/home/andrea/Documenti/Disegni/CamBam\Air4_marcatura_POMELLO- Transformed.nc

As you can see, I use the linux version and linuxcnc.

Thanks for your good work,

Andrea
« Last Edit: December 05, 2015, 00:02:10 am by newlinuxuser »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4854
    • View Profile
Re: Wrapper Plugin
« Reply #44 on: December 05, 2015, 12:19:56 pm »
David,

Please try that now, I changed my CamBam to French and the exclamation marks show up on all untranslated text.

Andrea,

Fixed the file extension issue

Edit: see later post for more recent version
« Last Edit: December 06, 2015, 12:14:24 pm by EddyCurrent »
Made in England