Author Topic: V-Engrave Plugin  (Read 377940 times)

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5330
  • Made in England
    • View Profile
Re: V-Engrave Plugin
« Reply #300 on: July 23, 2021, 21:43:39 pm »
New version 14 attached.

This solves an issue I had with Auto, default and value settings of Max Depth

I think one issue remaining is that copy and paste of the MOP causes interaction between them but if new V-Engrave MOPs are added manually it seems to work okay.

David, The Auto value is now shown in the bottom message window but please remember it is based upon the tool rather than the geometry.

Edit: I am attaching the source project files for version 14

Changes from the previous version.

1. New parameter added, Depth Increment
2. new variable added, Params.lowestPoint
3. Changes to method, CreateToolpathSequence
4. removal of testing code to simplify
5. reorganised code into more logical blocks

Bubba,
I like the file you attached, you could increase the depth increment I think.

Edit: files removed please see a newer post for the most up to date version.
« Last Edit: July 26, 2021, 18:43:40 pm by EddyCurrent »
Filmed in Supermarionation

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3381
    • View Profile
Re: V-Engrave Plugin
« Reply #301 on: July 24, 2021, 01:32:54 am »
I like the file you attached, you could increase the depth increment I think.
***********
Eddy,
I can see the depth increment be useful for others (machining metals, routers that not very sturdy, etc.) but in my case I have never experienced issues with V-Carving. So, all I care is the maximum depth option setting. Thanks for pointing out the option in earlier posts, it was starting point for me. So now, I got an answer I was looking for.... I think.     
« Last Edit: July 24, 2021, 01:35:18 am by Bubba »
My 2¢

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

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 278
    • View Profile
Re: V-Engrave Plugin
« Reply #302 on: July 24, 2021, 02:25:43 am »
Dear Edddy

I am attaching a test file (using VEngrave 1.4)

(1) On loading, Depth Increment is set to 0 and Max Depth to Infinity, tool diam to 0.0, tool tip diam = 0.0, 60 deg Vee: Result: Fail - computation goes on forever: This config should give the same result as V1.2, i.e. a single full depth cut.
(2) Though I am now also seeing Error icons in Max Depth and Depth Increment params at times, these must be edited to values values (say 1,10) to get a result
(2) Change depth increment to 2: Get error message: MaxDepth must be greater than zero, and get Error icon in Params list
(3)Change Max Depth to +10: now gives correct results.

There seems to be some issues with Depth increment, providing both Depth increment and Max Depth > 0.0 then seems to be OK.

Or, what I have I done wrong?

Geoff



Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 278
    • View Profile
Re: V-Engrave Plugin
« Reply #303 on: July 24, 2021, 02:49:33 am »
Dear Eddy

I have just discovered what you mean by "Auto" for the Max Depth, but I do not understand its value as displayed.  If I set Tool diam to 15 and tip diam to 1, then Auto = 12.12, but the max depth of cut is just less than 10 mm.!

Geoff

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5330
  • Made in England
    • View Profile
Re: V-Engrave Plugin
« Reply #304 on: July 24, 2021, 07:42:27 am »
Geoff,

Thanks for testing and providing feedback.


(1) On loading, Depth Increment is set to 0 and Max Depth to Infinity, tool diam to 0.0, tool tip diam = 0.0, 60 deg Vee: Result: Fail - computation goes on forever: This config should give the same result as V1.2, i.e. a single full depth cut.

I asked earlier if I should regard Depth Increment = 0 as meaning go to full depth so I shall now do that in the next update. All other aspects of the code remain unchanged by me.

There seems to be some issues with Depth increment, providing both Depth increment and Max Depth > 0.0 then seems to be OK.

That is correct, values of zero would make no sense.


I have just discovered what you mean by "Auto" for the Max Depth, but I do not understand its value as displayed.  If I set Tool diam to 15 and tip diam to 1, then Auto = 12.12, but the max depth of cut is just less than 10 mm.!

That value is calculated from the tool data, it is the theoretical maximum depth that the particular tool can manage, it is not the actual depth of cut. That part of the code has not been changed by me.
Filmed in Supermarionation

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 278
    • View Profile
Re: V-Engrave Plugin
« Reply #305 on: July 24, 2021, 07:56:32 am »
Dear Eddy

Thanks for the explanations, I will look forward to the next update.

Geoff

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5330
  • Made in England
    • View Profile
Re: V-Engrave Plugin
« Reply #306 on: July 24, 2021, 15:53:10 pm »
Geoff,

You may have missed this earlier so I'll post it again, this is the code  for" Auto" it is the original author's code.

Code: [Select]
private double ComputeAutoMaxDepth()
        {
            if (ToolDiameter.Cached <= 0)
            {
                return double.PositiveInfinity;
            }
            return 0.5 * (ToolDiameter.Cached - ToolTipDiameter.Cached) / Math.Tan(0.5 * ToolVAngle.Cached * DEGREES);
        }

So you can see the calculation uses;

ToolDiameter
ToolTipDiameter
ToolVAngle

It makes it quite important to get those parameters in your tool table before using this plugin.
« Last Edit: July 24, 2021, 15:58:52 pm by EddyCurrent »
Filmed in Supermarionation

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3381
    • View Profile
Re: V-Engrave Plugin
« Reply #307 on: July 24, 2021, 16:20:48 pm »
Eddy, did you take a look at the CB file I posted earlier. What do think of that approach?
My 2¢

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

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 278
    • View Profile
Re: V-Engrave Plugin
« Reply #308 on: July 25, 2021, 00:37:43 am »
Dear Eddy

I did see the earlier post, but did not appreciate how to set the Max Depth to "Auto". 

On a related matter: how do you input "Infinity" into the Max Depth field?

thanks
Geoff

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5330
  • Made in England
    • View Profile
Re: V-Engrave Plugin
« Reply #309 on: July 25, 2021, 15:59:32 pm »
Geoff,

I attached the full source code for v14 to a previous post.


Re. setting infinity, see code below

Code: [Select]
[DisplayName("Max Depth"),
         Description("Maximum depth for cuts"), Category("Cutting Depth")]
        public CBValue<double> MaxDepth
        {
            set
            {
                if (value.IsValue && value.Value <= 0)
                {
                    _maxDepth.SetState(CBValueStates.Error);
                    _log.Log(ERROR, "MaxDepth must be greater than zero.");
                    return;
                }
                _maxDepth = value;
                if (_maxDepth.IsDefault)
                {
                    _maxDepth.SetCache(Double.PositiveInfinity);
                    _maxDepth.Value = _maxDepth.Cached;
                }
            }
            get
            {
                if (_maxDepth.IsAuto && !_maxDepth.IsCacheSet)
                {
                    _maxDepth.SetCache(ComputeAutoMaxDepth());
                }
                return _maxDepth;
            }
        }

Filmed in Supermarionation

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5330
  • Made in England
    • View Profile
Re: V-Engrave Plugin
« Reply #310 on: July 25, 2021, 21:04:33 pm »
Eddy, did you take a look at the CB file I posted earlier. What do think of that approach?

Bubba,

The text reads "Test 1278", if you use the text outlines and apply an offset of -0.1 it will produce those pocket outlines right away.
Next, if you take the tool angle and offset the tip by 0.1 it shows that the depth of cut will be 0.17321.

This calculation could be carried out by the plugin if it knew the required offset, or a simple spreadsheet calculation could be used.

Now if you set Max Depth in the V-Engrave plugin (v12) to 0.17321 it will produce the required toolpaths.
If you use the latest version of the plugin with Depth Increment you should also set that to 0.17321
« Last Edit: July 25, 2021, 21:08:33 pm by EddyCurrent »
Filmed in Supermarionation

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7580
    • View Profile
    • Cambam V1.0 French Doc
Re: V-Engrave Plugin
« Reply #311 on: July 25, 2021, 22:06:35 pm »
Hello

Works well !! thank Eddy  ;D

++
David

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3381
    • View Profile
Re: V-Engrave Plugin
« Reply #312 on: July 25, 2021, 23:13:12 pm »
Thanks Eddy for this. I will try it with 'new' approach.
My 2¢

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

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 278
    • View Profile
Re: V-Engrave Plugin
« Reply #313 on: July 26, 2021, 01:02:52 am »
Dear Eddy

OK, I am now understanding better.

What I was missing was the following:

(1) to set "Max depth" to "Auto" you need to type "Auto" into the Max depth field.
(2) to set "Max Depth" to "Infinity" you need to type "Default" into the Max Depth field.

With this information, my issue is really just about setting the "Depth Increment" to 0.0, I think I am suggesting that for consistency with V12 a Depth Increment of 0.0 with a Max Depth of Infinity should give the same result in v14 (and not go into an infinite loop).

On another question: If you use "Tool Paths to Geometry" for the generated tool Paths the order of the polylines is not always "correct" , i.e. not in "increasing max depth" order as one might expect - particularly if you intend to use the new Polylines to create an Engrave MOP.

I am also not sure whether it might also be useful to consider modifying the Max Depth values so they are consistent with all (?) other MOPS, i.e with -ve values (for going downwards).  Perhaps open for opinions?

Many thanks

Geoff


Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7580
    • View Profile
    • Cambam V1.0 French Doc
Re: V-Engrave Plugin
« Reply #314 on: July 26, 2021, 03:05:13 am »
Hello

You can use the menu to set Auto, Default or Value.  ;)


++
David