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!
chrisb
Veteran
Posts: 54302
Joined: Tue Mar 17, 2015 9:14 am

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

Post by chrisb »

Use the current from the site you linked.

And get your quoting of your own messages right.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

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

Post by Kunda1 »

giedrius9999 wrote: Wed Mar 25, 2020 2:21 pm Version: 0.19.18356 (Git)
Please keep your dev version as updated as possible. You are way behind. Please download latest and re-test.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
giedrius9999
Posts: 24
Joined: Tue Apr 17, 2018 12:57 pm

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

Post by giedrius9999 »

...sorry guys...I have foggoten to copy PathSurfaceGui...

It work well!!!!!!

:D :D :D :D :D :D

thank you very much!!!!!
etrombly
Posts: 144
Joined: Thu Dec 05, 2019 6:50 pm

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

Post by etrombly »

I've been working on some improvements for processing time on this. If anyone wants to try it out it's at this branch https://github.com/etrombly/FreeCAD/tre ... rface_perf . You'll need to compile as I added in openmp for some parallel processing. I've only tested on linux, so some windows and mac testing would be appreciated.
giedrius9999
Posts: 24
Joined: Tue Apr 17, 2018 12:57 pm

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

Post by giedrius9999 »

Hello Guys,

Maybe any ideas why I still have Zigzag with ups and downs?
...how to set it up without?
Attachments
3D_Face.png
3D_Face.png (288.24 KiB) Viewed 1817 times
giedrius9999
Posts: 24
Joined: Tue Apr 17, 2018 12:57 pm

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

Post by giedrius9999 »

...here is the file
Attachments
3d face.FCStd
(32.83 KiB) Downloaded 45 times
User avatar
Gauthier
Posts: 123
Joined: Fri Jul 04, 2014 10:00 am
Location: Audenge, France

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

Post by Gauthier »

Hi All, Hi Russ,

I found little bugs in the new PathSurface.py code.
There is wrong comments on near the begining of the GCode output like this:

Code: Select all

(Surface001)
(Surface001)
Tool type: EndMill)
Compensated Tool Path. Diameter: 5.0)
Sample interval: 0.1)
Step over %: 60)
)
G0 F0.000000 Z5.000000
G0 F0.000000 X0.000000 Y0.000000
(Beginning of Single-pass layer.)
G0 F0.000000 X-0.500000 Y2.000000
(Begin step 0.)
(part 1.)
G1 X-0.500000 Y2.000000 Z0.300000 F300.000000
...
=> From line 3 to 7, the open parenthesis are missing and there is no comment in line 7.

I think the bug is comming from line 390 to 398 in PathSurface.py, when you plan to construct a multi-lines comment and pass it to the Path.Command() object.
Comments can't be multi-lines in GCode.

Replacing lines 390 to 398 in PathSurface.py with those ones can correct the problem:

Code: Select all

        if obj.Comment != '':
            self.commandlist.append(Path.Command('N ({})'.format(str(obj.Comment)), {}))
        self.commandlist.append(Path.Command('N ({})'.format(obj.Label), {}))
        self.commandlist.append(Path.Command('N (Tool type: {})'.format(str(obj.ToolController.Tool.ToolType)), {}))
        self.commandlist.append(Path.Command('N (Compensated Tool Path. Diameter: {})'.format(str(obj.ToolController.Tool.Diameter)), {}))
        self.commandlist.append(Path.Command('N (Sample interval: {})'.format(str(obj.SampleInterval.Value)), {}))
        self.commandlist.append(Path.Command('N (Step over %: {})'.format(str(obj.StepOver)), {}))

In addition, the G0 GCode does not have to have feedrate parameter, like I can see in lines 8,9 and 11 of PathSurface output...
Perhaps will it be fine to correct this.

Thanks again for your great job,

@++;
Gauthier.
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

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

Post by RatonLaveur »

First of all, I just had some time to review all the new options in the Data tab for 3D surface and they are all quite clear. I like it.
I especially appreciate that you brought back up to the GUI Linear Deflection and Angular Deflection, as well as their respective tooltips indicating the processing time cost associated. Real nice.
Issue found with the tool tips: "Smaller values yield a finer, more accurate the mesh." for both Angular and Linear Deflection. Should be "Smaller values yield a finer, more accurate mesh".

Now for the other issues:

I seem to have trouble with the Circular (and CIrcular ZigZag) patterns. See file attached.
Test_half_spheres.FCStd
(75.75 KiB) Downloaded 34 times
They compute fine on the flat surface in-between the half spheres but they crash on the half spheres themselves.

The issue seems to be a math error. Here the associated report:

Code: Select all

Begin 3D Surface operation...
PathSurface.WARNING: Final Depth might need to be lower. Internal features detected in Face2.
Traceback (most recent call last):
  File "C:\Program Files\FreeCAD019\FreeCAD_0.19.20276_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathUtils.py", line 59, in new_function
    res = function(*args, **kwargs)
  File "C:\Program Files\FreeCAD019\FreeCAD_0.19.20276_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathOp.py", line 513, in execute
    result = self.opExecute(obj) # pylint: disable=assignment-from-no-return
  File "C:\Program Files\FreeCAD019\FreeCAD_0.19.20276_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathSurface.py", line 518, in opExecute
    CMDS.extend(self._processCutAreas(JOB, obj, m, FACES[m], VOIDS[m]))
  File "C:\Program Files\FreeCAD019\FreeCAD_0.19.20276_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathSurface.py", line 1568, in _processCutAreas
    final.extend(self._processPlanarOp(JOB, obj, mdlIdx, COMP, 0))
  File "C:\Program Files\FreeCAD019\FreeCAD_0.19.20276_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathSurface.py", line 1657, in _processPlanarOp
    geoScan = self._planarPerformOclScan(obj, pdc, pathGeom, offsetPoints=False)
  File "C:\Program Files\FreeCAD019\FreeCAD_0.19.20276_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathSurface.py", line 1961, in _planarPerformOclScan
    PNTSET = self._pathGeomToArcPointSet(obj, pathGeom)
  File "C:\Program Files\FreeCAD019\FreeCAD_0.19.20276_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathSurface.py", line 2369, in _pathGeomToArcPointSet
    tolrncAng = math.asin(space/rad)
<class 'ValueError'>: math domain error
1534.75 <App> Document.cpp(3715): Failed to recompute Unnamed#Surface: math domain error
Recompute failed! Please check report view.
Hopefully this helps you figure out what's wrong (the error may be sitting between the steering wheel and the driver's seat...)

EDIT: I started playing with the center used for the circular calculation just in case i was accidentally asking for something impossible to the algo, only XminYmin really worked. The result is shall I say interesting:
Circular_Xmin_Ymin.png
Circular_Xmin_Ymin.png (301.72 KiB) Viewed 1784 times
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20276 (Git)
Build type: Release
Branch: master
Hash: 3a0d9e8c514c163be0b750dd75bb4f2afe4f94f1
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Switzerland (en_CH)
Last edited by RatonLaveur on Fri Mar 27, 2020 5:55 pm, edited 1 time in total.
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

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

Post by RatonLaveur »

etrombly wrote: Fri Mar 27, 2020 2:12 am I've been working on some improvements for processing time on this. If anyone wants to try it out it's at this branch https://github.com/etrombly/FreeCAD/tre ... rface_perf . You'll need to compile as I added in openmp for some parallel processing. I've only tested on linux, so some windows and mac testing would be appreciated.
Unfortunately I am only a windows user, but I've been looking at your code and it seems cleaner indeed. Do you have an idea how much improvement you will be able to squeeze through this project? 10% faster? 100%?
Russ4262
Posts: 953
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

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

Post by Russ4262 »

Good morning,
giedrius9999 wrote: Fri Mar 27, 2020 2:41 pm Hello Guys,
Maybe any ideas why I still have Zigzag with ups and downs?
...how to set it up without?

Investigating your file and the 3D Surface operation, I found a few things.

The current solution:
  1. Change the `BoundBox` property to `Stock`
  2. Toggle the `Optimize Step Over Transitions` to `True`
Comments and Observations
  • Using the `Default Tool` in some cases will cause weird behaviors in some operations. I don't know if this has bee fixed completely in PathWB. So, just be aware. I suggest you load a tool and its tool controller for each Job, or set up a Job Template with the tool and controller loaded.
  • Generally, when we push new features to the PathWB, we need them to produce as safe, reliable, and accurate paths as reasonably possible. What that means for 3D Surface is that for each of the patterns, the tool will raise to SafeHeight after each break in the path, whether mid-line or between stepover transitions. While not ideal, or necessarily desirable, it keeps(should keep) your material and machine from breaking. So, be aware of the `Surface Optimization` group of properties in the Data tab. For all cut patterns, toggle the `Optimize Step Over Transitions` property to `True`. This will attempt to keep the cutter down on these zig-zags as well as other breaks or stepovers and attempt to minimize transitional paths as best possible by the algorithm.
  • I think what you are reporting is a bug because the intended behavior after applying the `Optimize Step Over Transitions` feature is that it should keep the ZigZag down in this case, without the need to change `BoundBox` to `Stock`. I think I might need to adjust the tolerances at play. I will take a look.
  • As an additional plug here, 3D Surface is the only (that I am aware of) operation in the PathWB capable of producing a 3D profile operation. So, I threw in a second 3D Surface operation to your file and set `ProfileEdges' to 'Only'. This cleans up the edges of your 3D top surface. I did find a transitional bug here with it set to `First` or `Last`. I need to fix the transition from clearing path to profile path.
Glad to have another FreeCAD PathWB user.

Russ

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20286 +23 (Git)
Build type: Release
Branch: Surface_Waterline_Split
Hash: 6ae6899c9e30c9315f4694d4f8f4aa71fa5335ee
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Attachments
3d face_A-1.png
3d face_A-1.png (196.37 KiB) Viewed 1798 times
3d face_A-2.png
3d face_A-2.png (189.19 KiB) Viewed 1798 times
Post Reply