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

Here's the place for discussion related to CAM/CNC and the development of the Path module.
User avatar
-alex-
Posts: 546
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

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

Postby -alex- » Wed Feb 12, 2020 4:49 pm

5:03PM:
Russ4262 wrote:
Wed Feb 12, 2020 4:03 pm
I think we would only want/expect a path generated in the front left rectangular region of the selected yellow face. Correct?
5:24PM:
Russ4262 wrote:
Wed Feb 12, 2020 4:24 pm
Fixed.
Well done 8-)
And thanks for such improvements and great features :D
User avatar
freman
Posts: 1226
Joined: Tue Nov 27, 2018 10:30 pm

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

Postby freman » Wed Feb 12, 2020 4:50 pm

Nice work, that looks more sensible.

The diamond-circle-square test should be interesting.
Russ4262
Posts: 489
Joined: Sat Jun 30, 2018 3:22 pm

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

Postby Russ4262 » Wed Feb 12, 2020 5:42 pm

freman wrote:
Wed Feb 12, 2020 9:28 am
Here is a stress test model I submitted to sliptonic's CNC-torture collection.

Russ, you may like to throw a 3D over that and look at accuracy where the squares and circles touch. This brought out a bug in one of the 2.5D tools which did not handle a zero dimension correctly.

There should be an unbroken vertical line from the corners of the top square down to the base, touching both cuboids and the cylinder.
Attached image is at 0.015mm sample interval and 10% step over on a 3.175mm endmill - a fairly moderate resolution.

Russ
Attachments
3D_Surface-ver9d-sqrcirsqr-1.png
3D_Surface-ver9d-sqrcirsqr-1.png (253.14 KiB) Viewed 342 times
User avatar
freman
Posts: 1226
Joined: Tue Nov 27, 2018 10:30 pm

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

Postby freman » Wed Feb 12, 2020 5:55 pm

Thanks, that looks nice. What's happening on the LHS of the base there?

Is it cutting the whole height of that face in one cut or not machining it at all?

This obviously not the ideal tool to cut this part, it would be there all day to get a good resolution finish. But it's an interesting exercise to see how it handles it.
RatonLaveur
Posts: 793
Joined: Wed Mar 27, 2019 10:45 am

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

Postby RatonLaveur » Thu Feb 13, 2020 6:54 am

freman wrote:
Wed Feb 12, 2020 5:55 pm
Thanks, that looks nice. What's happening on the LHS of the base there?

Is it cutting the whole height of that face in one cut or not machining it at all?

This obviously not the ideal tool to cut this part, it would be there all day to get a good resolution finish. But it's an interesting exercise to see how it handles it.
LHS: the cutting direction being fully parallel to the edge there, the drop-cutter algorithm cannot distinguish it. Similar to waterline being unable to detect a horizontal plane. So technically yes it's "cutting the whole face at once" because the pattern encompasses the edge.
It's indeed not the right tool for that part. But good way to test the algo. If you want a nice finish on this part waterline it.
User avatar
freman
Posts: 1226
Joined: Tue Nov 27, 2018 10:30 pm

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

Postby freman » Thu Feb 13, 2020 8:11 am

Thanks, this is what is thought was going on but I wanted to confirm it.

So that path would simply break the tool. There is also the question of tool length and machine clearance.
Maybe there needs to be a control on cutting depth.
Similar to waterline being unable to detect a horizontal plane.
But waterline will correctly cut across a horizontal plane at a suitable speed and will clear the surface won't it ?

This case is pretty obvious to the trained eye since it is a large area with no paths and it is visible. I wonder about what happens on a less expansive face maybe not in plain sight. Perhaps the path tool should be throwing a warning about this kind of condition.

Even better, I think Russ showed that 3Dsurface can now do vertical planes and non planar faces, maybe this can be integrated if this condition is detected.

BTW this is not a "real" part, it is an ISO standard test piece to detect machine accuracy and repeatability. How about trying one on your laser mill ;)

It turns out to be quite good for testing CNC path generating software too.
If you want a nice finish on this part waterline it.
Yes, that would be another good test of the algo.
User avatar
freman
Posts: 1226
Joined: Tue Nov 27, 2018 10:30 pm

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

Postby freman » Sat Feb 15, 2020 12:45 am

Russ, what do I need on top of current master to test this?
Russ4262
Posts: 489
Joined: Sat Jun 30, 2018 3:22 pm

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

Postby Russ4262 » Sat Feb 15, 2020 2:06 am

Evening Freman,
freman wrote:
Sat Feb 15, 2020 12:45 am
Russ, what do I need on top of current master to test this?

I just updated the script in the OP of this thread; I also added installation instructions/options for Windows users and those building from source.

Cheers,
Russ
User avatar
freman
Posts: 1226
Joined: Tue Nov 27, 2018 10:30 pm

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

Postby freman » Sat Feb 15, 2020 2:25 am

Thanks Russ, I'll try to find time to build it this w/e. It's come a long way since last time I used it.
User avatar
Gauthier
Posts: 103
Joined: Fri Jul 04, 2014 10:00 am
Location: Audenge, France

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

Postby Gauthier » Sat Feb 15, 2020 3:40 pm

Hi Russ,

Many thanks for your great job.
It seems to work fine for simple surfaces, but for my complex geometry that I need to mill, it don't work at all :-(
Surface3D-v0.19-Exception.png
Surface3D-v0.19-Exception.png (235.38 KiB) Viewed 216 times
This is the output in report view :

Code: Select all

<Exception> shapes are not planar
Traceback (most recent call last):
  File "/home/gauthier/src/FreeCAD/build/Mod/Path/PathScripts/PathUtils.py", line 59, in new_function
    res = function(*args, **kwargs)
  File "/home/gauthier/src/FreeCAD/build/Mod/Path/PathScripts/PathOp.py", line 513, in execute
    result = self.opExecute(obj) # pylint: disable=assignment-from-no-return
  File "/home/gauthier/src/FreeCAD/build/Mod/Path/PathScripts/PathSurface.py", line 324, in opExecute
    (faceShapesList, voidShapesList) = self._preProcessModel(JOB, obj)
  File "/home/gauthier/src/FreeCAD/build/Mod/Path/PathScripts/PathSurface.py", line 540, in _preProcessModel
    clsdAreas = self._extractFaceLoopFeatures(base, shape)  # returns all closed loops
  File "/home/gauthier/src/FreeCAD/build/Mod/Path/PathScripts/PathSurface.py", line 860, in _extractFaceLoopFeatures
    fcShp = self._wireToFlatFaceShape(fc, wire)  # complete object
  File "/home/gauthier/src/FreeCAD/build/Mod/Path/PathScripts/PathSurface.py", line 899, in _wireToFlatFaceShape
    env = PathUtils.getEnvelope(NW.Shape, depthparams=self.depthParams)
  File "/home/gauthier/src/FreeCAD/build/Mod/Path/PathScripts/PathUtils.py", line 313, in getEnvelope
    sec = area.makeSections(heights=[0.0], project=True)[0].getShape()
<class 'ValueError'>: {'sclassname': 'N4Base10ValueErrorE', 'sErrMsg': 'shapes are not planar', 'sfile': '', 'iline': 0, 'sfunction': '', 'swhat': 'shapes are not planar', 'btranslatable': False, 'breported': True}
6.9e-08 <App> Document.cpp(3462): Failed to recompute MouleCabane3#Surface: {'sclassname': 'N4Base10ValueErrorE', 'sErrMsg': 'shapes are not planar', 'sfile': '', 'iline': 0, 'sfunction': '', 'swhat': 'shapes are not planar', 'btranslatable': False, 'breported': True}
Recompute failed! Please check report view.
The old full solid selection worked in both v0.18 & v0.19 with little bugshttps://forum.freecadweb.org/viewtopic.php?f=15&t=43310, but worked :
Capture d’écran_2020-02-15_16-27-18.png
Capture d’écran_2020-02-15_16-27-18.png (312.29 KiB) Viewed 216 times
Perhaps it will be possible to keep both 3D_Solid (the old 3D surface algorithme) and your new surface algo ?


OS: Debian GNU/Linux bullseye/sid (XFCE/xfce)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19535 (Git)
Build type: Release
Branch: master
Hash: 8deed98acec8f31ec946c95d0aa0c2767223baa3
Python version: 3.7.5
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)

- Path/PathScripts/3DSurface : Version 9d

The model is too big to be uploaded in this forum, you can download it on my Google drive : https://drive.google.com/file/d/1V_2wbv ... sp=sharing

@++;
Gauthier.