Author Topic: Slotter - a new MOP type  (Read 65769 times)

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7597
    • View Profile
    • Cambam V1.0 French Doc
Re: Slotter - a new MOP type
« Reply #15 on: April 17, 2017, 15:35:28 pm »
OK, I now see that the ToolPath filter is not working, apart from setting the depth and offset index in the toolpath what else is required?

thanks

Geoff

Hello

I've really no idea about how works the toolpath filter from the point of view of coding ; I use it often, but I never tried to program it.

++
David

Offline karst.drenth

  • Droid
  • **
  • Posts: 59
    • View Profile
Re: Slotter - a new MOP type
« Reply #16 on: April 18, 2017, 08:58:42 am »
Hi Geoff,
Some week or two ago I started to try to do an AutoLeveling Engrave MOP.

My first tries were to see whether I could manipulate the toolparh in such a way that the GCODE generation would take it into account. I notices that just changing the ZOffset is working pretty OK. But... any other, more elmentary translations on the toolpath PolyLines generate a lot of weird artifacts.. Specially the extra 'Bulge' attribute is still a big mystery to me...

Here is a sample how I managed to skew/rotate the plane 10 degrees:

Code: [Select]
      CADFile cadfile = CamBamUI.MainUI.CADFileTree.CADFile;

      foreach (CAMPart part in cadfile.Parts)
      {
        foreach (MachineOp mop in part.MachineOps)
        {
          if (mop.Toolpaths2 != null)
          {
            foreach (ToolpathItem item in mop.Toolpaths2.Toolpaths)
            {
              item.Toolpath.Transform.RotY(Math.PI / 180f * 10f);
              item.Toolpath.ApplyTransformation();
              //for (int i = 0; i != item.Toolpath.Points.Count; i++)
              //  item.Toolpath.Points[i] = new PolylineItem(item.Toolpath.Points[i].Point.X,
              //                                             item.Toolpath.Points[i].Point.Y,
              //                                             item.Toolpath.Points[i].Point.Z + item.Toolpath.Points[i].Point.X * 0.1,
              //                                             item.Toolpath.Points[i].Bulge);

              //item.Toolpath.Update();
            }
            foreach (Polyline rapid in mop.Toolpaths2.Rapids)
            {
              rapid.Transform = Matrix4x4F.Identity;
              rapid.Transform.Translate(0,0,20);
              rapid.ApplyTransformation();
              rapid.Transform = Matrix4x4F.Identity;
            }
          }
        }
      }

It does do the majority of the toolpaths *AND* GCODE is generated accordingly  8) but... still there are sme weird things happening with fairly random lines just suddenly sticking out-of-plane ( either slanted or perpendicular )  :o :'(

Also note, that modifying the 'rapids' is only cosmetic, IRL the GCODE Generator only takes the 'Clearance-Height' into account to generate the output :-\ :-\

So I feel somehow, that it's a nessesity to override the whole ToolPath generation up front, and not trying to modify the already generated toolpath afterwards...

The commented lines in my code do also kinda work, but with the same effects as the rotation transformation...

Grtzz,

Karst

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1896
    • View Profile
Re: Slotter - a new MOP type
« Reply #17 on: April 19, 2017, 02:01:32 am »
HI Karst
Ran into this very problem while writing the Collision Detector plugin, what I noticed was that after using some cambam methods on a shapelist or primitive, that very many micro artifacts were produced and the "file cleaner plugin" was based on code from the collision Detector to eliminate them after they were produced, and I never found out what was causing them in the first place.
Dave

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 278
    • View Profile
Re: Slotter - a new MOP type
« Reply #18 on: April 19, 2017, 22:50:36 pm »
Dear Karst and Dave

I don't have any real suggestions, I am really a beginner in trying to understand the ins and outs of CamBam programming.

Karst, with regards to your sample code the only suggestion I have is to reset the transform for each "item" to the Identity after applying it, as you have done for each "rapid".  This step resolved a problem I had with creating and then transforming toolpaths.  In my case I also created the toolpaths from the geometry from first principles.

Geoff

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7597
    • View Profile
    • Cambam V1.0 French Doc
Re: Slotter - a new MOP type
« Reply #19 on: April 19, 2017, 23:21:57 pm »
Hello

Quote
Karst, with regards to your sample code the only suggestion I have is to reset the transform for each "item" to the Identity after applying it, as you have done for each "rapid".  This step resolved a problem I had with creating and then transforming toolpaths.

+1

I've had the same pb on a script that use polyline transformation (scale/move). If I well remember, after scaling the polyline (in XY), I had to apply transformation before moving it in Z ; if not, I got strange results.

just an idea ; sometimes some functions seems to be sensitive to the 'Spline to Polyline Tolerance' settings that is used as 'general' tolerance.

I also have unpredictable result with my Unroll script that seems to be sensitive to the triangle size (and I found no tolerance to change) and it's difficult to understand what exactly happens in the function ..

++
David
« Last Edit: April 19, 2017, 23:29:26 pm by dh42 »

Offline jim1108

  • Droid
  • **
  • Posts: 86
    • View Profile
Re: Slotter - a new MOP type
« Reply #20 on: July 16, 2018, 13:32:24 pm »
Slotter is a great plug-in and I have used it several times already and it works well.

There is one thing on the mop that I think needs to be made available as an option.

Some times when slotting, I do not want to take the full width of the woodruff/saw when stepping down in the "Z" axis. Lines can form between the steps, usually caused by push-off or a slightly worn tool, affecting the slot finish. Of course this would not matter on the first cut, just the second to the last.



If there was and option to take less that the full cut width it would eliminate the lines by overlapping cuts in "Z".


Thanks for the great plug-in.

« Last Edit: July 16, 2018, 13:43:34 pm by jim1108 »

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 278
    • View Profile
Re: Slotter - a new MOP type
« Reply #21 on: July 17, 2018, 07:39:00 am »
I am away from home for another week or so, but I will see what I can do when i return to provide an "overlap" in the Z drection.

Geoff

Offline jim1108

  • Droid
  • **
  • Posts: 86
    • View Profile
Re: Slotter - a new MOP type
« Reply #22 on: July 17, 2018, 11:19:25 am »
Great, thanks Geoff

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 278
    • View Profile
Re: Slotter - a new MOP type
« Reply #23 on: July 26, 2018, 07:51:11 am »
Dear jim1108

I am attaching below a new version of the Slotter plugin for you to test. There is a new parameter in the Tool section- Cut Overlap.  This is a fraction (>=0 && < 1.0) that sets the overlap in the Depth movements.  So, if you are using a 2mm wide cutter and the Cut Overlap is set at 0.2, then the Z increment will be 1.6 mm.

Please let me know if this is what you want, and if it works for you
thanks
Geoff

Offline jim1108

  • Droid
  • **
  • Posts: 86
    • View Profile
Re: Slotter - a new MOP type
« Reply #24 on: July 26, 2018, 11:57:54 am »
Well done Geoffrey. This is exactly what I was looking for. Thank you.

I drew up several different shapes (circles, open polylines, oddball shapes) and ran Slotter through the paces. The code was correct and the simulations looked good.

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7597
    • View Profile
    • Cambam V1.0 French Doc
Re: Slotter - a new MOP type
« Reply #25 on: July 27, 2018, 18:23:37 pm »
Hello Geof

I'm updating the web site/translating this plugin and I wonder if the properties of this mop are placed at the right section in the panel.  ???

Width of slot and Cut Increment are in Cutting Depht section ; I think they should be in Step Over section (it's horizontal cut)

Cut Overlap is in Tool section ; I think it should be in Cutting depth section because it's Z move

nice job ;)

++
David

edit: also, copy/paste format is not working when the source mop is a slotter (but works if If the source mop is a profile and the target a slotter) ; copy/paste of a slotter mop is not working too.

« Last Edit: July 27, 2018, 18:34:23 pm by dh42 »

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 278
    • View Profile
Re: Slotter - a new MOP type
« Reply #26 on: July 28, 2018, 07:43:25 am »
Dear David.

I was actually thinking about where to put the Cut Overlap parameter, so I will move it to the Step Over section in the next relsase.

I am not so sure about the other two (Width of Slot and Cut Increment) as these are not concerned with the cutter dimension, but more the Cutting Depth.

Regarding the copy/paste issue- I have no idea how to resolve this. I note that the same problem exists in the VEngrave plugin - that I was using as a "model" for my development.  Clearly I have missed out setting up the copy/paste functions- any advice (examples?) would be appreciated.

Geoff

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7597
    • View Profile
    • Cambam V1.0 French Doc
Re: Slotter - a new MOP type
« Reply #27 on: July 28, 2018, 20:47:02 pm »
Regarding the copy/paste issue- I have no idea how to resolve this. I note that the same problem exists in the VEngrave plugin - that I was using as a "model" for my development.  Clearly I have missed out setting up the copy/paste functions- any advice (examples?) would be appreciated.

Hello

No idea about this problem ; I never code MOP (and I only use VB) ; maybe JK can help you ... or its code for trochopocket MOP ?

Quote
I am not so sure about the other two (Width of Slot and Cut Increment) as these are not concerned with the cutter dimension, but more the Cutting Depth.

Yes, but it's horizontal cutting depth ; in my mind it's like the step over and the cut width of a regular profile MOP.

plugin Website updated ;)

++
David

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 278
    • View Profile
Re: Slotter - a new MOP type
« Reply #28 on: August 30, 2018, 23:40:49 pm »
Thanks to JK, problems with cut/paste fixed.  Version 1.0.4 attached to top of this thread.

Geoff

Offline jim1108

  • Droid
  • **
  • Posts: 86
    • View Profile
Re: Slotter - a new MOP type
« Reply #29 on: September 01, 2018, 19:18:03 pm »
Hello Geoff,

I downloaded version 1.04 which fixes the copy/paste of the slotter mop, but.....

I can now copy/paste, but when your post the code, the second mop g-code moves do not show up in the posted code. The copied mop is listed, but no code is produced.


This was tried  on polylines and circles, so it is not geometry specific. I also put a separate mop between the two slotter mop's with the same affect.


Now the other issues I have come across....

One problem is when the tool width is the same as the slot width, it gives an error of "the tool width is greater that the specified slot", but still outputs the code of the first mop only.

Another problem is when I have the slot geometry drawn already (snap ring groove for example), I do not need to add a slot depth, since I have the geometry drawn already.
 
If I put a "0" in the slot depth, telling slotter to profile the geometry exactly as drawn, it shows error in the slot depth box, but still outputs the code correctly.


Windows 10 build 1803, CamBam version 1.0,


Here is the test .cb file and the post processor I am using, Thanks, Jim