Optimize Stepover Transitions In 3d Surface

Hi, It seems ‘optimize Stepover Transitions’ isn’t working correctly in 3d Surface. With it enabled, everything above StartDepth-(1xStepdown) is ignored.

Can anyone else confirm this?

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.31109 (Git)
Build type: Release
Branch: master
Hash: c23ee7ad88433a0f00e84afae0a62fe738be0c09
Python 3.10.8, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: German/Germany (de_DE)
Installed mods: 
  * CurvedShapes 1.0.4
  * Curves 0.5.3
  * FeedsAndSpeeds 0.4.0
  * Marz 0.0.26-alpha
  * Silk 1.0.0

TestOptimizeStepOverTransitions.FCStd (36.6 KB)

Yes, I see the same thing with your file.

I have never understood what this is supposed to do, and I never use it.

I vaguely recall there was some discussion quite a while ago that indicated the option was not working correctly.

Gene

Gene, Thank you for confirming. Without it enabled, the tool doesn’t start at uncut material, rather with every layer it starts in the middle at the top in my example and goes over already cut material which considerably increases milling time.

I’ve submitted a bug report
https://github.com/FreeCAD/FreeCAD/issues/7953

Hi everyone, just wondering if this bug could be fixed sometime soon; it’s been over a year since I submitted the bug report. With out this working properly, the 3d Surface functionality is compromised. Currently with ‘Optimize Stepover Transitions’ enabled, the work isn’t cut correctly - the section above the first stepdown is ignored. With ‘Optimize stepover Transitions’ disabled, for each pass the tool goes over already cut surfaces which drastically increases cutting time.

I’ve looked at the code several times myself, but fail to see what the problem could be. Would be fantastic if this could be fixed!

Many thanks!

It appears that the first step down mast be excluded of the optimization.

replace the following lines form file /Path/Op/Surface.py

line 1689 and 1710 ( At least in my file )
if optLinTrans is True:
with
if optLinTrans is True and layDep != (obj.OpStartDepth.Value - obj.StepDown.Value):


line 1837 ( At least in my file )
if obj.OptimizeStepOverTransitions:
with
if obj.OptimizeStepOverTransitions and p2.z != (obj.OpStartDepth.Value - obj.StepDown.Value):

That looks to be working for your file above.

Dimitrios2 Thank you so much for looking at this. I followed your instructions and with the example file achieve the same results as you did. I’ll test tomorrow with more files. Thanks again!

No problem.

Maybe this is a better approach.

Dimitrios2 Thank you for showing that, that path looks far more reasonable.

As I understand it, The Bounding Box options mean Should the operation be limited by the stock object or by the bounding box of the base object. If I make the size of the stock exactly the same size as the bounding box, surely the resulting path should be the same? When The ‘Bounding Box’ option is set to ‘Stock’ there’s a lot of jumping around to safe height on this example.

I think in the past, I automatically chose ‘Stock’ for this option because otherwise, larger models would never finish calculating, even if left overnight, whereas when set to ‘Stock’ the calculation would take around 10 minutes. Has this now been fixed?

Should this code change now be submitted as a bug fix?

I have no idea! I’m just a user like you.

To speed things up you can set the LinearDeflection on the Properties Tab of the Operation from 0.00 to 0.01mm.

Alternatively, you can change the following lines on Surface.py

Line 542
“AngularDeflection”: 0.01, #Change 0.25 to 0.01mm

Reasonable compromise between speed & precision

“LinearDeflection”: 0.01, #Change 0.001 to 0.01mm

Line 557
defaults[“LinearDeflection”] = job.GeometryTolerance.Value #Removed (/ 4) after Value

That should reduce calculation times dramatically!

Dimitrios2 This is great information, thank you!