mill face miss face.

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!
Post Reply
User avatar
freman
Veteran
Posts: 2188
Joined: Tue Nov 27, 2018 10:30 pm

mill face miss face.

Post by freman »

Hi,

I just set up a millface operation. I misses the face by 0.6mm.

The actual face selected is at 56.326mm. OpFinalDepth shows 56.33mm ( rounding up to 2dp it seems ). However, the lowest path is at 56.826mm, ie 0.5mm above the model face.

I set Finish Step Down to 0.5mm , I get the smaller final cut but it misses.

If this is not me being forgetful please move to Path forum as a bug.

Yep, this looks like a new bug. If I set last cut to 0.75, it stops 0.75 above that face; Finish Step Down to 0 ends at last full step.
Who has been poking and not testing?

TIA

recent master:

Code: Select all

OS: Fedora Linux 36 (Thirty Six) (LXQt/lxqt)
Word size of FreeCAD: 64-bit
Version: 0.21.0.32323 (Git)
Build type: Release
Branch: master
Hash: 5ac308e8a65c7022ef851463d8ab5e1ba4b5edbe
Python 3.10.10, Qt 5.15.8, Coin 4.0.0, Vtk , OCC 7.6.3
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * FreeCAD_Assembly4 0.11.10
  * FreeCAD_assembly3
Attachments
mill-miss.png
mill-miss.png (68.52 KiB) Viewed 980 times
mill-miss.FCStd
(171.09 KiB) Downloaded 20 times
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: mill face miss face.

Post by chrisb »

Moved to Path forum (be it a bug or not: here are the experts).
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53785
Joined: Tue Mar 17, 2015 9:14 am

Re: mill face miss face.

Post by chrisb »

freman wrote: Sat Mar 18, 2023 2:34 pm I just set up a millface operation. I misses the face by 0.6mm.
It's always nice and helpful for the helpers to upload minimized files showing the issue. I made this here for you:
Attachments
mill-miss_minimized.FCStd
(88.49 KiB) Downloaded 15 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: mill face miss face.

Post by GeneFC »

I agree that Mill Face is broken. (I never use it, so I had not seen the problem.)

I tried a very, very simple test with a cuboid. Top surface at Z=0.

What I discovered is that Mill Face selects its z-layers based on the lower face of the cuboid, not the top face that was selected.

This may be related to the problem that was discussed here a few days ago where the Mill Face operation would do nothing unless the chosen-to-be-milled surface was set below the actual surface.

The "stock" outline shape gets moved for some reason when entering the Mill Face task panel.

Definitely a bug, but probably a very simple fix.

Gene
User avatar
freman
Veteran
Posts: 2188
Joined: Tue Nov 27, 2018 10:30 pm

Re: mill face miss face.

Post by freman »

I've used millFace quite a bit but not recently . I've not seen this kind of defect before.

I'm also having trouble getting two millface ops with dressups on the same surface. In one case it worked but the other one or other of the dress up stocks keeps moving.

If someone has been poking this code recently they probably need to back out the PRs until more thoroughly tested.
Russ4262
Posts: 941
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: mill face miss face.

Post by Russ4262 »

freman wrote: Sat Mar 18, 2023 2:34 pm ... Yep, this looks like a new bug. ...
Not a new bug. Old one that didn't get fixed across the board. Internal rounding error that was identified some time back in the PocketShape op and in MillFace. Due to multiple 'Boundary Shape' options, the fix did not make it to all the available options. To see this, change the 'Boundary Shape' to 'Face Region' for the MillFace op in question and you will get the last cut at face depth.

The fix back then was to extend the target shape envelope slightly below the Final Depth to compensate for the internal rounding error. This fix exists for the 'Face Region' option (line 294), but is lacking for the 'Boundbox' option. The fix is about three lines of code. Looking at the code, looks like 'Face Region' option is the only one with this fix.

Change line 234 from:

Code: Select all

            env = PathUtils.getEnvelope(partshape=bbperim, depthparams=self.depthparams)
to ...

Code: Select all

            # Calculate custom depth params for removal shape envelope, with start and final depth buffers
            custDepthparams = self._customDepthParams(
                obj, obj.StartDepth.Value + 0.2, obj.FinalDepth.Value - 0.1
            )  # only an envelope
            env = PathUtils.getEnvelope(partshape=bbperim, depthparams=custDepthparams)
Russell

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.32198 (Git)
Build type: Release
Branch: master
Hash: f51b2156f35399cab38eef1e957a59ad5a11de66
Python 3.8.16, Qt 5.15.6, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * FC_SU
  * freecad.gears 1.0.0
  * PathExp
  * Z_MacroStartup
Attachments
Cut at Final Depth is made when the target shape envelope is extended slightly below the Final Depth.
Cut at Final Depth is made when the target shape envelope is extended slightly below the Final Depth.
Snip macro screenshot-14ad98.png (97.42 KiB) Viewed 774 times
User avatar
freman
Veteran
Posts: 2188
Joined: Tue Nov 27, 2018 10:30 pm

Re: mill face miss face.

Post by freman »

Hi Russ. Many thanks for taking a look and identifying the issue. Hopefully these relatively trivial changes will get applied to the other cases affected.

I've used millface with boundary dress-up quite a bit over the years. I'm sure I'd have noticed if it was always there. Did this get introduced in the major code reorganisation of Path WB?

I found a work around by using a final step of 1nm ( which fails to materialise ) and then juggling with start height and step depth to get the penultimate step where I need the final cut. It works but it's a PITA and massive waste of time.

TBO, FreeCAD Path is starting to cost more time than it is worth for many jobs. After wasting two evenings battling with multiple breakage, regression and bugs in FC I ended up spending an hour with a text editor and produced a file with one third the number of lines and machine time a faction of what Path tools produced . ( Applying a Boundary dressup necessarily produces a lot of unnecessary retractions and feedrate descents cutting air. )

The 3D model part of FreeCAD was great for modelling this part but I'm experiencing negative utility in Path WB. Next time I'm going to go straight for the text editor and only use FC for more complex paths like engraving text and paths with arcs.

I also needed drill path for the two holes. I have a clamp in the middle of the part, so I set clearance and safety around 90mm. Instead it uses the start depth + safety offset to rapid between the two , smashing into the clamp. All part of the never resolved discussion on what should happen between holes. More hand editing required.

This should be simple but it's become very complicated.

Is there a previous version where this works? I'm sure I would have noticed this before.
Russ4262
Posts: 941
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: mill face miss face.

Post by Russ4262 »

freman wrote: Tue Mar 21, 2023 8:03 am ... Did this get introduced in the major code reorganisation of Path WB? ...
No.

freman wrote: Tue Mar 21, 2023 8:03 am ... Is there a previous version where this works? ...
Cannot say yes.
Per GH and the original forum thread, the 'Face Region' fix was applied at end of 2020 when reported. Had I a better mindset back then, I would have thought to check each of the 'Boundary Shape' options for the same bug rather than only the reported 'Face Region'.

Have a great evening.

Russell
User avatar
freman
Veteran
Posts: 2188
Joined: Tue Nov 27, 2018 10:30 pm

Re: mill face miss face.

Post by freman »

Hi Russ. I don't think this is due to the bug you refer to. The problem is not in the dress-up , though if that rounding error issue may apply to all dressups, that's obviously worth checking.

The underlying millface operation is where the problem occurs here.
Post Reply