3D Surface - Face Selection (New feature) [Merged]

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
freman
Veteran
Posts: 2214
Joined: Tue Nov 27, 2018 10:30 pm

Re: 3D Surface - Face Selection (New feature)

Post by freman »

For lines this can currently be achieved by rotating the workpiece by 180° when generating paths but that is a little inconvenient and doesn't work for circular features.

Thank you very much,
jffmichi
Modifying the model I posted above, I now set start depth= -10 ; finish depth=0 ; step down= -1 and the paths are done in reverse order. Test with your circular features ...

new version attached.
Attachments
slope-reverse.FCStd
(28.41 KiB) Downloaded 46 times
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: 3D Surface - Face Selection (New feature)

Post by chrisb »

freman wrote: Mon Feb 24, 2020 5:37 pm I now set start depth= -10 ; finish depth=0 ; step down= -1 and the paths are done in reverse order.
Great idea! And it shows why I don't like too many system restrictions forbidding to set values which seem on first sight to be nonsense, such as stepdown being negative.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
freman
Veteran
Posts: 2214
Joined: Tue Nov 27, 2018 10:30 pm

Re: 3D Surface - Face Selection (New feature)

Post by freman »

Well my boundaryDressUp PR to allow negative boundaries got merged last week. I admit I was half expecting this not to be allowed as I tried it and was pleasantly surprised. Kudo -> Russ.

I just checked this in the sim and it is actually a bit weird because it still does the layers from top down even though I seem to have told it to start at the bottom. It's really handy in that it does just what was wanted but it seems to be a bug that it does so. :?

I also noted that it does unnecessary repeats on the upper steps, it seems that it produces multiple passes at the correct depth for the surface , so the top step gets machined a dozen times. All the steps get the same number of passes even though they have different heights. Probably just a tweak to the code required there.
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: 3D Surface - Face Selection (New feature)

Post by chrisb »

Did you check the GCode? I would not bet on the simulation.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: 3D Surface - Face Selection (New feature)

Post by chrisb »

If I try to set the values for bottom up milling I get the message "z_finish_step must be less than step_down" in report view. Perhaps you got this too and due to the error you still see the old paths?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
freman
Veteran
Posts: 2214
Joined: Tue Nov 27, 2018 10:30 pm

Re: 3D Surface - Face Selection (New feature)

Post by freman »

I do not see any warnings and I looked at the arrows on the 3D view to see path reversal.

You are correct to say I should not trust the sim, but looking at the Gcode it seems to be consistent. You have my FCStd file for the reversed version above, maybe you can check there is no contradiction with what I'm seeing.


Code: Select all

Path workbench activated
Wizard shaft module cannot be loaded
Path workbench deactivated
Path workbench activated
grbl_post: GCode postprocessor loaded.
grbl_post: GCode postprocessor loaded.
grbl_post: GCode postprocessor loaded.
grbl_post: GCode postprocessor loaded.
grbl_post: GCode postprocessor loaded.
grbl_post: GCode postprocessor loaded.
grbl_post: GCode postprocessor loaded.
Surfacing Select Mode
PathSurface.INFO: 
Begin 3D Surface operation...
PathSurface.INFO: Operation time: 1.3144962787628174 sec.
PathSurface.INFO: 
Begin 3D Surface operation...
PathSurface.INFO: Operation time: 0.8370604515075684 sec.
Free Select
PathSurface.INFO: 
Begin 3D Surface operation...
PathSurface.INFO: Operation time: 1.4129679203033447 sec.
grbl_post: GCode postprocessor loaded.
grbl_post: GCode postprocessor loaded.
PathSurface.INFO: 
Begin 3D Surface operation...
PathSurface.INFO: Operation time: 1.4213645458221436 sec.
grbl_post: GCode postprocessor loaded.
grbl_post: GCode postprocessor loaded.
PathSurface.INFO: 
Begin 3D Surface operation...
PathSurface.INFO: Operation time: 1.4202876091003418 sec.
Surfacing Select Mode
Free Select
Surfacing Select Mode
Free Select
PathSurface.INFO: 
Begin 3D Surface operation...
PathSurface.INFO: Operation time: 1.436408281326294 sec.
Surfacing Select Mode
PathSurface.INFO: 
Begin 3D Surface operation...
PathSurface.INFO: Operation time: 1.4854810237884521 sec.
Free Select
PathSurface.INFO: 
Begin 3D Surface operation...
PathSurface.INFO: Operation time: 1.4308133125305176 sec.
grbl_post: GCode postprocessor loaded.
grbl_post: GCode postprocessor loaded.
PathSurface.INFO: 
Begin 3D Surface operation...
PathSurface.INFO: Multi-pass op has 57 layers (step downs).
PathSurface.INFO: Operation time: 2.9565913677215576 sec.
Surfacing Select Mode
Free Select
PathSurface.INFO: 
Begin 3D Surface operation...
PathSurface.INFO: Multi-pass op has 12 layers (step downs).
PathSurface.INFO: Operation time: 1.656735897064209 sec.
Surfacing Select Mode
Free Select
PathSurface.INFO: 
Begin 3D Surface operation...
PathSurface.INFO: Multi-pass op has 12 layers (step downs).
PathSurface.INFO: Operation time: 1.6638684272766113 sec.
Surfacing Select Mode
Free Select
PathSurface.INFO: 
Begin 3D Surface operation...
PathSurface.INFO: Multi-pass op has 12 layers (step downs).
PathSurface.INFO: Operation time: 1.7897915840148926 sec.
post: grbl(/back/tmp/cnc/slope-rev.nc, --translate_drill)
grbl_post: GCode postprocessor loaded.
Post Processor: grbl_post postprocessing...
Done postprocessing.
OS: Fedora 31 (Thirty One) (LXDE/LXDE)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19591 (Git)
Build type: Release
Branch: 3D
Hash: 27771fc6ee93170b6ecb978ff4da438a5b9cfe97
Python version: 3.7.6
Qt version: 5.13.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: 3D Surface - Face Selection (New feature)

Post by chrisb »

I opened your file from this post:
freman wrote: Mon Feb 24, 2020 5:37 pm new version attached.
It doesn't show a path, and a full recompute shows this in report view:

Code: Select all

Reading failed from embedded file: Job.nc (46547 bytes, 2029 bytes compressed)
Reading failed from embedded file: Operations.nc (46547 bytes, 2029 bytes compressed)
Reading failed from embedded file: Surface.nc (46547 bytes, 2029 bytes compressed)
Traceback (most recent call last):
  File "/Users/cb/Desktop/FreeCAD.app/Contents/Resources/Mod/Path/PathScripts/PathUtils.py", line 59, in new_function
    res = function(*args, **kwargs)
  File "/Users/cb/Desktop/FreeCAD.app/Contents/Resources/Mod/Path/PathScripts/PathOp.py", line 513, in execute
    result = self.opExecute(obj) # pylint: disable=assignment-from-no-return
  File "/Users/cb/Desktop/FreeCAD.app/Contents/Resources/Mod/Path/PathScripts/PathSurface.py", line 368, in opExecute
    final = self._planarDropCutOp(obj, stl, bb)
  File "/Users/cb/Desktop/FreeCAD.app/Contents/Resources/Mod/Path/PathScripts/PathSurface.py", line 438, in _planarDropCutOp
    dep_par = PathUtils.depth_params(obj.ClearanceHeight.Value, obj.SafeHeight.Value, obj.StartDepth.Value, obj.StepDown.Value, 0.0, obj.FinalDepth.Value)
  File "/Users/cb/Desktop/FreeCAD.app/Contents/Resources/Mod/Path/PathScripts/PathUtils.py", line 734, in __init__
    raise ValueError('z_finish_step must be less than step_down')
<class 'ValueError'>: z_finish_step must be less than step_down
4.1e-08 <App> Document.cpp(3464): Failed to recompute slope_reverse#Surface: z_finish_step must be less than step_down
Recompute failed! Please check report view.
Perhaps I should wait for the next version?

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19694 (Git)
Build type: Release
Branch: master
Hash: 288456ee4beb9e8dc27d50a7984c40c45467161f
Python version: 3.8.1
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
freman
Veteran
Posts: 2214
Joined: Tue Nov 27, 2018 10:30 pm

Re: 3D Surface - Face Selection (New feature)

Post by freman »

Are we using the same version of Russ' script?

Code: Select all

__scriptVersion__ = "9d"
__lastModified__ = "2020-02-12 10:42 CST"
I downloaded from top post here.
https://forum.freecadweb.org/download/f ... ?id=103797
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: 3D Surface - Face Selection (New feature)

Post by chrisb »

Oops, I thought it was already in master.

It doesn't work here even if I exchange the file, so there is probably the other file too, which has to be exchanged. I think I should leave it as it is, it works in your version, and I can wait until we have it in master too.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54197
Joined: Tue Mar 17, 2015 9:14 am

Re: 3D Surface - Face Selection (New feature)

Post by chrisb »

Couldn't resist and replaced all files, PathSurfaceGui.py, PathSelection.py, PathSurface.py. Same error as before, perhaps some other version clash. I can wait.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply