Author Topic: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes  (Read 26952 times)

Online dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7580
    • View Profile
    • Cambam V1.0 French Doc
[V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« on: August 31, 2023, 19:32:54 pm »
Hello

If we do a Horizontal/Vertical sweep with two 3D scanline mops (and of course with the same settings for the 2 mops), in theory the X and Y paths should overlap everywhere, but this is not the case. You can see it clearly in this picture.



Ralf (Pixelmaker) has found that the bug go away if we use the same value for Step Over and Resolution.



++
David
« Last Edit: August 31, 2023, 19:41:43 pm by dh42 »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5330
  • Made in England
    • View Profile
Re: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« Reply #1 on: September 01, 2023, 10:15:33 am »
I don't know for certain if this has anything to do with it but ...

Looking in the code for CamBam.CAD.dll I found this under the method, "protected bool _GenerateScanlineToolpaths()"

Code: [Select]

        case Profile3DMethods.Horizontal:
num = ((base.ToolDiameter.Cached == 0.0) ? Resolution.Cached : (Resolution.Cached * base.ToolDiameter.Cached));
num2 = ((base.ToolDiameter.Cached == 0.0) ? StepOver.Cached : (StepOver.Cached * base.ToolDiameter.Cached));
break;
case Profile3DMethods.Vertical:
num = ((base.ToolDiameter.Cached == 0.0) ? StepOver.Cached : (StepOver.Cached * base.ToolDiameter.Cached));
num2 = ((base.ToolDiameter.Cached == 0.0) ? Resolution.Cached : (Resolution.Cached * base.ToolDiameter.Cached));
break;

num and num2 are used later in calculations.
You can see that in one instance num uses Resolution while in the other it uses StepOver, same for num2.

I would have thought both Horizontal and Vertical should use the same variables because they are essentially the same thing but just rotated 90 degrees.

It can also be seen that if the two varaibles are the same then the same paths will be calculated and that is what we see in example images.


Edit: I've decided the code is now okay, my fault to blame it.
« Last Edit: September 01, 2023, 19:23:45 pm by EddyCurrent »
Filmed in Supermarionation

Offline pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1995
    • View Profile
    • pixelmaker
Re: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« Reply #2 on: September 01, 2023, 11:59:51 am »
That is already correct.
If both variables have the same value, the error does not occur.
Since I use these values ( 0.1/0.1 and 0.2/0.2 ) as default I never noticed it.
I don't use stepover and resolution above 0.3 for 3D milling.
We need to get Andy to fix things like this.

ralf

Online dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7580
    • View Profile
    • Cambam V1.0 French Doc
Re: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« Reply #3 on: September 01, 2023, 16:56:57 pm »
Hello

Quote
I would have thought both Horizontal and Vertical should use the same variables because they are essentially the same thing but just rotated 90 degrees.

Yes, this make sense .... maybe you have found the lizard ... ;D

Quote
We need to get Andy to fix things like this.

Yes, sure ... I hope Andy will give some life sign soon .... and a Cambam update ... (last update 02/2020)

++
David

Online dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7580
    • View Profile
    • Cambam V1.0 French Doc
Re: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« Reply #4 on: September 01, 2023, 19:12:30 pm »
Quote
Quote
I would have thought both Horizontal and Vertical should use the same variables because they are essentially the same thing but just rotated 90 degrees.

Yes, this make sense .... maybe you have found the lizard ... ;D

Hum, in fact, not sure, because if we assume that one of the two statement is right and the other is bad, then at least one of them should produce right toolpaths ... but it is not the case, on the donut we can see that the defect is the same with horizontal or vertical scanline mode ...

++
David
« Last Edit: September 01, 2023, 19:16:57 pm by dh42 »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5330
  • Made in England
    • View Profile
Re: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« Reply #5 on: September 01, 2023, 19:20:51 pm »
I now think the code is okay.

Imagine that "num" is in the X direction and "num2" is in the Y direction.

So if Horizontal = X then num would be Resolution and num2 would be Stepover
if Vertical  = Y then num2 would now become Resolution and num Stepover.

Filmed in Supermarionation

Online dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7580
    • View Profile
    • Cambam V1.0 French Doc
Re: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« Reply #6 on: September 01, 2023, 19:51:28 pm »
I agree ...

And another strange thing is that the 2 values must be exactly the same, as example with one = 0.4 and the other = 0.401 the defect is almost the same than for 0.4/0.2 ....

++
David

Edit: and just by curiosity, I installed an old CamBam version (0.97f - 12/2009) .... and no bug !  :o
« Last Edit: September 01, 2023, 21:44:17 pm by dh42 »

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1894
    • View Profile
Re: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« Reply #7 on: September 02, 2023, 10:53:54 am »
I can't say that I came across this issue as like Ralf I set the step over value small as I want to
get a finish of the machine and avoid any secondary steps if I can.

Out of interest I took your model and generated the tool paths and simulated it with Comotics
I saved the cut surface and imported it back into CB to make a comparison see pic.

What I see is that the error is in one axis only.
Dave

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5330
  • Made in England
    • View Profile
Re: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« Reply #8 on: September 02, 2023, 16:53:12 pm »
David,

Can you attached the CamBam.CAD.dll file from version 0.9.7f ?
or send me a link to the download of that version.
Filmed in Supermarionation

Online dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7580
    • View Profile
    • Cambam V1.0 French Doc
Re: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« Reply #9 on: September 02, 2023, 17:47:46 pm »
David,

Can you attached the CamBam.CAD.dll file from version 0.9.7f ?
or send me a link to the download of that version.

http://www.atelier-des-fougeres.fr/temp/CamBamPlus-beta0.9.7f.msi

@dave
on the image on this post, I see the error in both X and Y
https://cambamcnc.com/forum/index.php?topic=10517.msg78178#msg78178

++
David
« Last Edit: September 02, 2023, 17:51:17 pm by dh42 »

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1894
    • View Profile
Re: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« Reply #10 on: September 03, 2023, 02:02:40 am »
David
What I did was make a two separate models of each horizontal and vertical sets of tool paths.
In the horizontal mode the error followed the axis that was the stepover,(the error was in Z though)
 if I rotated the tool paths 90 degrees in Z then that axis was ok, Y axis if I remember correctly, in the vertical tool path mode the
error still followed the stepover axis this time it was the X axis. But not both at the same time.
See pic It's the same tool path just looking from front and the side superimposed on each other just rotated 90 deg.
The tool path in one axis is following the model surface (where the Z value is correct)  only in the other axis is the Z value to high.
The Z error swaps axes whether doing a horr\vertical mop.
The Z offset from the model surface is incorrect in one axis.
This is what the original pic is showing where you can see more of the model in one axis than the other.
I don't know if it matters but the torus model was a little shorter in one axis than the other, this may have been due to the resolution on the stl.
Yes, this is a problem, don't know if we can do anything about it though, except make people aware.
of the bounds of the stepover and resolution settings when using the horr\vert mops.
What I'm thinking though is that after a few months and many posts later, that the information
here about the settings for resolution and stepover will get lost in the noise.

Dave

Online dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7580
    • View Profile
    • Cambam V1.0 French Doc
Re: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« Reply #11 on: September 03, 2023, 17:26:10 pm »
Hello

Yes on each axis the error is on the step over direction only, but along the toolpath, it is OK.

++
David

Offline pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1995
    • View Profile
    • pixelmaker
Re: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« Reply #12 on: September 03, 2023, 23:06:53 pm »
A few simple things I found to get clean 3D scanline toolpaths.

The values for resolution and stepover must be the same.
Only stepover and resolution 0.1/01, 0.2/0.2, 0.3/0.3 work cleanly for me. From 0.4/0.4 the toolpaths do not fit any more. Also the second decimal place does not bring clean results.


ralf
« Last Edit: September 03, 2023, 23:09:44 pm by pixelmaker »

Online dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7580
    • View Profile
    • Cambam V1.0 French Doc
Re: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« Reply #13 on: September 04, 2023, 23:33:53 pm »
after testing old versions, the problem is not present with CB 0.98L but is present with N ... I do not have the 2 versions between L and N on my hard drive (M beta 3 and N rc8) ... and unfortunately the links to the previous release download page seems to be all broken.

http://www.atelier-des-fougeres.fr/temp/CamBamPlus-0.9.8L.msi

http://www.atelier-des-fougeres.fr/temp/CamBamPlus-0.9.8N.msi

++
David

edit: I found them here too
https://gitlab.com/CamBamCNC/CamBam.releases/-/tree/master/Releases/0.9/stable
« Last Edit: September 05, 2023, 00:06:27 am by dh42 »

Offline pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1995
    • View Profile
    • pixelmaker
Re: [V1 - 76] Wrong Toolpath with 3D profile - scanline modes
« Reply #14 on: September 05, 2023, 10:15:53 am »
Hello David
V 0.9.8 was not available in 64bit.
This is the most important new feature in V 1.0 to perform extensive milling in 3D operations.
We need to put pressure on Andy to fix such bugs.
A new version doesn't have to be a completely new programme, but more often a version with bug fixes would help me.

ralf