[Merged] MillFace: add feature - exclude raised areas PR #2367

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Russ4262
Posts: 539
Joined: Sat Jun 30, 2018 3:22 pm

[Merged] MillFace: add feature - exclude raised areas PR #2367

Postby Russ4262 » Sun Jul 21, 2019 7:48 am

Morning,

MillFace needed(okay, would benefit from) this new feature: [Path] MillFace: add feature - exclude raised areas. You know you wanted it in the past. Here it is. "Exclude Raised Areas" is the new property to enable the self-titled feature. Pockets (holes, depressions, slots, etc...) are still milled over as expected; but, enable the new feature and that raised stud in the middle of the face will be excluded - left alone - not touched - safe - a tree in the midst of a milled plateau. Okay, you get the idea...

If not, I attached a few pics: before and after.

The new feature does NOT include avoidance detection. So, raised areas that are slanted out, angled out, bulging out, have overhangs pointing outward, etc... will not be adjusted for by the algorithm. Perpendicular areas and those sloped inward (half sphere, cone, studs, etc) should all be safe.

Descriptions of pics:
  1. Standard MillFace operation without adjustments - view 1
  2. Standard MillFace operation without adjustments - view 2 - model hidden
  3. NEW, 'ExcludeRaisedAreas' feature enabled - view 1
  4. NEW, 'ExcludeRaisedAreas' feature enabled - view 2 - slot is milled over, stud is excluded
Enjoy this gluten-free delight,
Russ
Attachments
MillFace_excluderaisedareas-1a.png
Standard MillFace operation without adjustments - view 1
MillFace_excluderaisedareas-1a.png (174.41 KiB) Viewed 685 times
MillFace_excluderaisedareas-1b.png
Standard MillFace operation without adjustments - view 2 - model hidden
MillFace_excluderaisedareas-1b.png (148.71 KiB) Viewed 685 times
MillFace_excluderaisedareas-1c.png
NEW, 'ExcludeRaisedAreas' feature enabled - view 1
MillFace_excluderaisedareas-1c.png (177.26 KiB) Viewed 685 times
MillFace_excluderaisedareas-1d.png
NEW, 'ExcludeRaisedAreas' feature enabled - view 2 - slot is milled over, stud is excluded
MillFace_excluderaisedareas-1d.png (145.68 KiB) Viewed 685 times
User avatar
dubstar-04
Posts: 571
Joined: Mon Mar 04, 2013 8:41 pm
Location: Manchester, UK
Contact:

Re: [Merged] MillFace: add feature - exclude raised areas PR #2367

Postby dubstar-04 » Wed Aug 14, 2019 6:16 am

Hi Russ,

Opening old models and trying to make facing operations active gives the following segfault:

Code: Select all

Traceback (most recent call last):
  File "/usr/share/freecad-daily/Mod/Path/PathScripts/PathUtils.py", line 64, in new_function
    res = function(*args, **kwargs)
  File "/usr/share/freecad-daily/Mod/Path/PathScripts/PathOp.py", line 503, in execute
    result = self.opExecute(obj) # pylint: disable=assignment-from-no-return
  File "/usr/share/freecad-daily/Mod/Path/PathScripts/PathAreaOp.py", line 400, in opExecute
    aOS = self.areaOpShapes(obj) # pylint: disable=assignment-from-no-return
  File "/usr/share/freecad-daily/Mod/Path/PathScripts/PathMillFace.py", line 126, in areaOpShapes
    if obj.ExcludeRaisedAreas is True:
<class 'AttributeError'>: 'FeaturePython' object has no attribute 'ExcludeRaisedAreas'
Program received signal SIGSEGV, Segmentation fault.
#0  /lib/x86_64-linux-gnu/libc.so.6(+0x43f60) [0x7fb3feb92f60]
#1  [0x557547ea5440]
File attached.

Partial version info here: (not sure why this is incomplete)

OS: Ubuntu 19.04 (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.7.3
Qt version: 5.12.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
Attachments
DizzyBlank2-CAM.fcstd
(237.88 KiB) Downloaded 26 times
Last edited by dubstar-04 on Wed Aug 14, 2019 6:32 am, edited 1 time in total.
chrisb
Posts: 29061
Joined: Tue Mar 17, 2015 9:14 am

Re: [Merged] MillFace: add feature - exclude raised areas PR #2367

Postby chrisb » Wed Aug 14, 2019 6:32 am

dubstar-04 wrote:
Wed Aug 14, 2019 6:16 am
Opening old models and trying to make facing operations active gives the following segfault:
They were built with which version? If it is 0.19 I would not consider this as really serious., because rebuilding them shows no issues.

But there is something else which should be fixed by reattaching Sketch003: You have a cyclic dependency in your model.
Attachments
Snip macro screenshot-608492.png
Snip macro screenshot-608492.png (17.47 KiB) Viewed 582 times
A Sketcher Lecture with in-depth information is available in English, auf deutsch, en français, en español.
User avatar
dubstar-04
Posts: 571
Joined: Mon Mar 04, 2013 8:41 pm
Location: Manchester, UK
Contact:

Re: [Merged] MillFace: add feature - exclude raised areas PR #2367

Postby dubstar-04 » Wed Aug 14, 2019 6:52 am

chrisb wrote:
Wed Aug 14, 2019 6:32 am
dubstar-04 wrote:
Wed Aug 14, 2019 6:16 am
Opening old models and trying to make facing operations active gives the following segfault:
They were built with which version? If it is 0.19 I would not consider this as really serious., because rebuilding them shows no issues.

But there is something else which should be fixed by reattaching Sketch003: You have a cyclic dependency in your model.
How do you reply to all these posts so quickly? Amazing service!!

This is my testing model. The path objects have been built recently (2 weeks ago?) using daily versions of 0.19.

I have reattached that sketch, new file attached.

FreeCAD no longer segfaults, but it would be nice if the error was handled a little better.

Thanks,

Dan
Attachments
DizzyBlank3-CAM.fcstd
(239.08 KiB) Downloaded 10 times
chrisb
Posts: 29061
Joined: Tue Mar 17, 2015 9:14 am

Re: [Merged] MillFace: add feature - exclude raised areas PR #2367

Postby chrisb » Wed Aug 14, 2019 11:38 am

dubstar-04 wrote:
Wed Aug 14, 2019 6:52 am
How do you reply to all these posts so quickly? Amazing service!!
This is a special kind of lazyness: I actually should do something else, but sometimes I prefer to work through the forum here.
A Sketcher Lecture with in-depth information is available in English, auf deutsch, en français, en español.
User avatar
dubstar-04
Posts: 571
Joined: Mon Mar 04, 2013 8:41 pm
Location: Manchester, UK
Contact:

Re: [Merged] MillFace: add feature - exclude raised areas PR #2367

Postby dubstar-04 » Wed Aug 14, 2019 11:52 am

chrisb wrote:
Wed Aug 14, 2019 11:38 am
dubstar-04 wrote:
Wed Aug 14, 2019 6:52 am
How do you reply to all these posts so quickly? Amazing service!!
This is a special kind of lazyness: I actually should do something else, but sometimes I prefer to work through the forum here.
Well keep it up. Having people like you that provide such great support is what makes FreeCAD so special. :D
Russ4262
Posts: 539
Joined: Sat Jun 30, 2018 3:22 pm

Re: [Merged] MillFace: add feature - exclude raised areas PR #2367

Postby Russ4262 » Thu Aug 15, 2019 1:29 am

Afternoon, Sir,
As ChrisB has mentioned, this error is not a high priority and has an existing solution.
dubstar-04 wrote:
Wed Aug 14, 2019 6:16 am
Hi Russ,
Opening old models and trying to make facing operations active gives the following segfault: ...
This error stems from the method used by devs to add a new property to an existing operation or tool. If the dev simply declares the property upon initialization, the property is only added upon initial creation of the operation - meaning, no backwards compatibility with operations/jobs created with previous versions of FreeCAD. The second method involves the inclusion of a simple test case to determine if the property exists when the operation is recomputed or recovered (when a document is reopened), with the occasional line or two of additional code to ensure the property existence test is run each time the document is opened/recomputed.

I suspect the first method mentioned is the source of the error here. You will simply have to delete and re-create the operation within the new FreeCAD version so the new, additional properties are included with the operation.

I am one of the devs responsible for using the first method at times within my contributions to the PathWB - it is quick and easy. You may run into this error using pre_0.19 when opening files with jobs and operations created in previous versions -- that have had additional properties added as dependencies of new features, or improvements of existing features.

I think checking each operation/job/tool script in PathWB having received property modifications in pre_0.19 would be a great task to add to the pre-release polishing for PathWB before the official release is made, to allow existing files containing jobs and operations to be opened and compatible with what will be the new release - without having to re-create jobs or operations.

Thanks for the feedback.

Russell
User avatar
dubstar-04
Posts: 571
Joined: Mon Mar 04, 2013 8:41 pm
Location: Manchester, UK
Contact:

Re: [Merged] MillFace: add feature - exclude raised areas PR #2367

Postby dubstar-04 » Thu Aug 15, 2019 11:49 am

Russ4262 wrote:
Thu Aug 15, 2019 1:29 am

I think checking each operation/job/tool script in PathWB having received property modifications in pre_0.19 would be a great task to add to the pre-release polishing for PathWB before the official release is made, to allow existing files containing jobs and operations to be opened and compatible with what will be the new release - without having to re-create jobs or operations.
Hi Russ,

Thanks for the reply. ^^ This certainly would be nice if someone had time.

Dan