Two bugs when using Profile Faces.

Here's the place for discussion related to CAM/CNC and the development of the Path module.
nahshon
Posts: 185
Joined: Wed Jul 24, 2013 8:06 pm

Two bugs when using Profile Faces.

Postby nahshon » Fri Jun 28, 2019 5:30 pm

I'm trying to use Profile Faces. I have simple extrusion with some round holes.

1. Some optimization was introduced in commit git commit 423830ba8c5 (Sabin Iacob, March 4 2019). Its really reducing the processing time, but in some cases it is processing the outside perimeter before the holes.
Before the change, each face had its holes processed before the perimeter.
(There were still some limitations that I will explain later in a reply to this post).

2. The Process Perimeter flag is not respected. Perimeters are always processed. That started with commit git commit 4c69b48dc67 (Russell Johnson, June 11 2019). I understand it's still a work in progress and I still have to learn the excellent new features that Russ is adding.

-- Itai
Last edited by nahshon on Sat Jun 29, 2019 4:38 pm, edited 1 time in total.
User avatar
Russ4262
Posts: 216
Joined: Sat Jun 30, 2018 3:22 pm

Re: Two bugs when using Profile Faces.

Postby Russ4262 » Sat Jun 29, 2019 1:20 pm

nahshon wrote:
Fri Jun 28, 2019 5:30 pm
I'm trying to use Profile Faces. I have simple extrusion with some round holes.

1. Some optimization was introduced in commit 423830ba8c5ece01055334e50be703dcf13c79a4 (Sabin Iacob, March 4 2019). Its really reducing the processing time, but in some cases it is processing the outside perimeter before the holes.
Before the change, each face had its holes processed before the perimeter.
(There were still some limitations that I will explain later in a reply to this post).

2. The Process Perimeter flag is not respected. Perimeters are always processed. That started with commit 4c69b48dc67680ac1c350fed4b1f154c730a7562 (Russell Johnson, June 11 2019). I understand it's still a work in progress and I still have to learn the excellent new features that Russ is adding.

-- Itai
I can take a look at #2 on the list. I know the last PR with an update to Profile Faces included fixes for the `Process Perimeter` toggle. I suppose the changes be incomplete, or are not producing the intended or purposed effect. I'll check it out.

Please post your FreeCAD information in Help->About FreeCAD section, pasting into your post. Also attach a model where the features are not working as indicated in your post. Attaching a screenshot or two might be useful. A summary of the steps taken to produce the undesired behavior would be beneficial.

Thanks,
Russ
User avatar
Kunda1
Posts: 5127
Joined: Thu Jan 05, 2017 9:03 pm

Re: Two bugs when using Profile Faces.

Postby Kunda1 » Sat Jun 29, 2019 3:00 pm

nahshon wrote:
Fri Jun 28, 2019 5:30 pm
423830ba8c5ece01055334e50be703dcf13c79a4

4c69b48dc67680ac1c350fed4b1f154c730a7562
If you wrap these in the commit tag they will automagically link to the commit on Github.

git commit 423830ba8c5ece01055334e50be703dcf13c79a4

You can also shorten them
git commit 423830ba8c5
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
nahshon
Posts: 185
Joined: Wed Jul 24, 2013 8:06 pm

Re: Two bugs when using Profile Faces.

Postby nahshon » Sat Jun 29, 2019 3:39 pm

I'm using the latest master as of yesterday.

Code: Select all

OS: "Fedora release 28 (Twenty Eight)" (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17167 (Git)
Build type: Debug
Branch: master
Hash: 9e174f1115ebd312c3245b2b4a364de798f00e62
Python version: 2.7.15
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1.oce-0.18
Locale: English/UnitedStates (en_US)
I want to cut a small part with holes out of 3 mm acrylic board. Using 1.5mm EndMill. To work around the other problem I had to separate the holes and the perimeter to two operations, where I hit this problem.
In PathProfileFaces.py near line 252 you added the else part for the 'if obj.processPerimeter:'.

-- Itai
Attachments
PS500W_plate.FCStd
(14.01 KiB) Downloaded 6 times
nahshon
Posts: 185
Joined: Wed Jul 24, 2013 8:06 pm

Re: Two bugs when using Profile Faces.

Postby nahshon » Sat Jun 29, 2019 4:39 pm

Kunda1 wrote:
Sat Jun 29, 2019 3:00 pm
nahshon wrote:
Fri Jun 28, 2019 5:30 pm
423830ba8c5ece01055334e50be703dcf13c79a4

4c69b48dc67680ac1c350fed4b1f154c730a7562
If you wrap these in the commit tag they will automagically link to the commit on Github.

git commit 423830ba8c5ece01055334e50be703dcf13c79a4

You can also shorten them
git commit 423830ba8c5
Thanks for the tip! Updating my post.
nahshon
Posts: 185
Joined: Wed Jul 24, 2013 8:06 pm

Re: Two bugs when using Profile Faces.

Postby nahshon » Sat Jun 29, 2019 8:39 pm

nahshon wrote:
Fri Jun 28, 2019 5:30 pm
(There were still some limitations that I will explain later in a reply to this post).
I wrote earlier about wanting to process the perimeter after any holes. In the more general case, we may optimize material usage by placing small parts into holes in larger parts. I created this Yin-Yang example to show my idea.
YinYang.png
YinYang.png (8.41 KiB) Viewed 333 times
The operation consists of 10 closed paths. We can cut this with a CNC router, Laser, Plasma or Drag-knife. In all cases we want to start with the inner paths and proceed to outer part only after the parts that are contained in them are done.

I assume that paths in a single CNC operation never intersect. (this is not checked by FreeCAD!). For my test code I even assume that paths so not touch (that's good enough for most cases)

Maybe the simplest way is to sort the paths by their size (can use the area). A path with small area cannot contain a path with a larger area. If the paths cannot touch then sorting by XMax-XMin or YMax-YMin may be more efficient. Then process them in order - smaller to larger.

When ordering the paths we also want to plan for minimal jogging (G0 moves) between paths. This calls for topological sorting - actually build a dependency graph. When that dependency graph is sparse there is still some freedom to optimize moves.

Code for playing with is in https://github.com/itain/FreeCAD/tree/PathTopoSort. Branch PathTopoSort. It's not ready for PR yet. Asking for more ideas and some feedback.

-- Itai
Attachments
Yin-Yang-Example.FCStd
(41.33 KiB) Downloaded 6 times
User avatar
Russ4262
Posts: 216
Joined: Sat Jun 30, 2018 3:22 pm

Re: Two bugs when using Profile Faces.

Postby Russ4262 » Sun Jun 30, 2019 4:08 am

nahshon wrote:
Sat Jun 29, 2019 3:39 pm
I want to cut a small part with holes out of 3 mm acrylic board. Using 1.5mm EndMill. To work around the other problem I had to separate the holes and the perimeter to two operations, where I hit this problem.
In PathProfileFaces.py near line 252 you added the else part for the 'if obj.processPerimeter:'.

-- Itai
I loaded your file and ran with a recent script prior to the `Else` block.


I then ran it with the current version which includes the `Else` statement. I see the difference. This is not the intent for which I included the `Else`. Short answer is I'll fix it promptly. Thanks for bringing it to my attention. The new `Else` block has some usefulness, but I can see it needs to be triggered by a property toggle, not simply true if `obj.processPerimeter` is False. I see my error, Jedi master. I will use the Force (or keyboard) and fix this.

Thanks,
Russ
User avatar
Russ4262
Posts: 216
Joined: Sat Jun 30, 2018 3:22 pm

Re: Two bugs when using Profile Faces.

Postby Russ4262 » Sun Jun 30, 2019 10:52 pm

Number 2 on OP list is now fixed as of PR 2306 being merged. Please forgive the error. The `Process Perimeter` flag behavior is restored. This topic is partially fixed. Number 1 on the list, pertaining to path optimization, may require additional modifications.

Russ
nahshon
Posts: 185
Joined: Wed Jul 24, 2013 8:06 pm

Re: Two bugs when using Profile Faces.

Postby nahshon » Mon Jul 01, 2019 3:35 pm

I saw the fix for #2. I will hold my comments until after I will actually test it later tonight.
For #1 I have a suggested fix in my repo (asking for comments). See https://github.com/itain/FreeCAD/tree/PathTopoSort.

-- Itai
nahshon
Posts: 185
Joined: Wed Jul 24, 2013 8:06 pm

Re: Two bugs when using Profile Faces.

Postby nahshon » Mon Jul 01, 2019 9:35 pm

Trying the very latest GIT commits gave me an exception when I try to open the JOB Gui.
Recompiling latest commit from Sunday to try find where thee problem started.

Code: Select all

PathJobGui.ERROR: 'NoneType' object is not iterable
Traceback (most recent call last):
  File "/home/itai/Freecad-src/build/Mod/Path/PathScripts/PathJobGui.py", line 1273, in Create
    obj.ViewObject.Proxy.editObject(obj.Stock)
  File "/home/itai/Freecad-src/build/Mod/Path/PathScripts/PathJobGui.py", line 175, in editObject
    return self.openTaskPanel('Stock')
  File "/home/itai/Freecad-src/build/Mod/Path/PathScripts/PathJobGui.py", line 155, in openTaskPanel
    self.taskPanel = TaskPanel(self.vobj, self.deleteObjectsOnReject())
  File "/home/itai/Freecad-src/build/Mod/Path/PathScripts/PathJobGui.py", line 529, in __init__
    self.template = PathJobDlg.JobTemplateExport(self.obj, self.form.jobBox.widget(1))
  File "/home/itai/Freecad-src/build/Mod/Path/PathScripts/PathJobDlg.py", line 289, in __init__
    self.updateUI()
  File "/home/itai/Freecad-src/build/Mod/Path/PathScripts/PathJobDlg.py", line 323, in updateUI
    opsWithSettings = job.SetupSheet.Proxy.operationsWithSettings()
  File "/home/itai/Freecad-src/build/Mod/Path/PathScripts/PathSetupSheet.py", line 248, in operationsWithSettings
    for prop in value.registeredPropertyNames(name):
  File "/home/itai/Freecad-src/build/Mod/Path/PathScripts/PathSetupSheet.py", line 278, in registeredPropertyNames
    return [OpPropertyName(name, prop) for prop in self.properties()]
TypeError: 'NoneType' object is not iterable