Adaptive Path/CAM Operation

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!
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: Adaptive Path/CAM Operation

Post by RatonLaveur »

I think what bill is (nicely) demonstrating, is what the full implementation of Anders Wallin vision for OCL would be.

Indeed in his blog http://www.anderswallin.net/cam/ at the time, he did consider the use of the Waterline tool first as a roughing op with adaptive clearing paths at each layer, followed by the finishing which the current OCL Waterline kind of does.

I just think that neither should be dismissed and what we see in bill's post is part of the end-game of 3D surface machining:
Adaptive Waterline based clearing.
Waterline finishing.

The actual end-game being the ability to be feature based (i.e. generate the path on only one feature of the whole geometry).
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Adaptive Path/CAM Operation

Post by sliptonic »

I'm not arguing. I'm just trying understand the value of implementing the adaptive waterline independently when the OCL waterline does the same thing but with the added benefit of tool shape awareness.

I'm not opposed to implementing temporary solutions but, to quote the Zen of Python, "There should be one-- and preferably only one --obvious way to do it."

Russ has improved waterline a lot lately and I'd rather invest energy in making it perfect rather than implementing an alternative that will result in more code to maintain and possibly confuse new users.
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: Adaptive Path/CAM Operation

Post by RatonLaveur »

No argument there :)
User avatar
bill
Posts: 376
Joined: Fri Jan 09, 2015 9:25 pm

Re: Adaptive Path/CAM Operation

Post by bill »

sliptonic wrote: Mon Jun 10, 2019 11:40 pm ...to quote the Zen of Python, "There should be one-- and preferably only one --obvious way to do it."....
:lol:

This is the kind of fish hook that would have never got man to the moon!

<weakhumor>
Have you ever met two programmers simultaneously in the same room; the only thing obvious, is that there are at least 2 obvious ways, and both are trivial!
</weakhumor>

Thats why there is only one operating system, one computer language, one processor, and on, and on, etc.
And thats why Path is often refactored (not really, its because its evolving -- turns out things are not obvious),
And thats why Profile is supported by three discrete Ops/Icons in task bar and hovering over the Adaptive Icon yields "Adaptive Cleaing and Profiling"

Because, there is preferably only one --obvious way to do it.

And bits and pieces of path-like in i think the architecture wb; yeah the PanelTools

I came to freecad/path for the waterline-milling capability potential, which I have yet to see successfully implemented. As a matter of fact for a while it actually regressed from its initial state until very recently.

Could have easily secured all this functionality years ago very cheaply by purchasing DeskProto from Delft Splines; but any clown could do that.
I like the challenge.

Last of all, I never said to dump OCL; that would be just silly.

Things do often become overcome-by-events; this might be one of those cases.

But hey, fagetta bout it!
RatonLaveur
Posts: 991
Joined: Wed Mar 27, 2019 10:45 am

Re: Adaptive Path/CAM Operation

Post by RatonLaveur »

Hello bill,

Could you please explain how you achieved the adaptive clearing the way you did on the half sphere? I have trouble repeating the experiment. I've used a pad, a half sphere fused to it, and a tiny flat cut at the tip of the sphere. Yet whichever reference surface I use, Adaptive does not create a conformal path around the sphere.

Thanks in advance,
J.
User avatar
bill
Posts: 376
Joined: Fri Jan 09, 2015 9:25 pm

Re: Adaptive Path/CAM Operation

Post by bill »

Sorry, dont have the file anymore and dont remember since Ive moved on to other solutions to complete the machining.
Ended up using FEATUREAREA (silver-bullet) and a lot of BSTs :cry: to roll my own path.

I have a lot of confidence in russ's efforts.

Is he actually a.k.a. "Scott Evil"? :lol: No!, just reminds me of scott!
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Adaptive Path/CAM Operation

Post by sliptonic »

I'm still seeing the 'path to nowhere' bug but only in Python3. I'm not seeing much complaining about it though. Is it just me? I don't see a Mantis bug.
Has it been documented yet?
pathtonowhere.png
pathtonowhere.png (19.97 KiB) Viewed 1410 times
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Adaptive Path/CAM Operation

Post by sliptonic »

I've done a little more digging and it seems like the problem is coming from the C++ and not the python.

Here's a macro that shows the problem for me. This corresponds to a small square area to be cleared. I set a large tool, high stepover, and 90 degree helix to minimize the amount of output:

Code: Select all

import area

stockPath2d = [[[-101.0, -101.0], [101.0, -101.0], [101.0, 101.0], [-101.0, 101.0], [-101.0, -101.0]]]
path2d = [[[-28.7868, 28.7868], [-28.7868, 71.2132]], [[-28.7868, 71.2132], [-71.2132, 71.2132]], [[-71.2132, 71.2132], [-71.2132, 28.7868]], [[-71.2132, 28.7868], [-28.7868, 28.7868]]]

def progressFn(tpath):
    pass
    return

a2d = area.Adaptive2d()
opType = area.AdaptiveOperationType.ClearingInside
a2d.stepOverFactor = 0.01 * 75
a2d.toolDiameter = 14.0
a2d.helixRampDiameter =  0.0
a2d.keepToolDownDistRatio = 3.0
a2d.stockToLeave = 0.0
a2d.tolerance = 0.1
a2d.forceInsideOut = False
a2d.opType = opType
results = a2d.Execute(stockPath2d,path2d, progressFn)
for result in results:
    for path in result.AdaptivePaths:
        sys.stdout.write("AP: {}\n".format(path))


OUTPUT. Note that the second adaptive path in the results contains huge numbers where the path shoots off into positive X territory.:

Code: Select all

AP: (0, [(-49.99375, 44.74375), (-49.91875, 44.66875), (-49.8625, 44.58125), (-49.84375, 44.48125), (-49.225, 43.1625), (-48.74375, 42.51875), (-48.4, 42.2125), (-48.15625, 42.0375), (-47.85, 41.875), (-47.50625, 41.7625), (-47.2, 41.63125), (-46.45, 41.34375), (-45.66875, 41.1625), (-44.90625, 41.11875), (-44.55, 41.13125), (-43.7125, 41.225), (-42.9375, 41.4375), (-42.4, 41.6125), (-41.8, 41.8875), (-41.375, 42.125), (-40.9125, 42.44375), (-40.48125, 42.80625), (-40.05, 43.11875), (-39.475, 43.675), (-38.95, 44.23125), (-38.46875, 44.86875), (-38.1625, 45.31875), (-37.58125, 46.35625), (-37.025, 48.025), (-36.46875, 52.525), (-36.63125, 55.05625), (-37.0625, 56.6375), (-37.425, 57.425), (-38.06875, 58.36875), (-39.1, 59.58125), (-39.63125, 60.175), (-40.23125, 60.7), (-40.7875, 61.13125), (-41.33125, 61.525), (-42.0125, 61.93125), (-43.18125, 62.5375), (-43.64375, 62.65625), (-44.01875, 62.69375), (-44.10625, 62.73125), (-45.5125, 63.06875), (-50.95, 63.4875), (-53.66875, 63.26875), (-55.35625, 62.83125), (-55.98125, 62.5375), (-56.21875, 62.3625), (-56.2875, 62.29375), (-56.375, 62.25625), (-56.5375, 62.14375), (-57.675, 61.54375), (-58.3625, 61.14375), (-59.0, 60.6625), (-59.4625, 60.2625), (-59.9125, 59.84375), (-60.44375, 59.24375), (-60.85625, 58.70625), (-61.25, 58.125), (-61.6875, 57.5375), (-62.18125, 56.6625), (-62.54375, 55.71875), (-62.83125, 54.51875), (-63.18125, 51.51875), (-63.1, 48.21875), (-62.875, 46.51875), (-62.54375, 45.425), (-61.93125, 44.1125), (-61.63125, 43.36875), (-61.3, 42.6375), (-60.8875, 41.95), (-60.025, 40.66875), (-59.5125, 40.04375), (-58.975, 39.44375), (-58.5, 38.79375), (-57.34375, 37.53125), (-57.0125, 37.2625), (-56.74375, 37.10625), (-55.90625, 36.33125), (-55.80625, 36.3125), (-37.10625, 36.36875), (-36.60625, 36.45), (-36.5125, 36.4875), (-36.3625, 36.6125), (-36.325, 36.7), (-36.3125, 43.825)])
AP: (0, [(-36.3125, 43.825), (15560610.21875, 43.93125)])
AP: (1, [])
AP: (0, [(17528048.28125, 43.875), (13280170.63125, 43.75625), (8187685.7375, 43.725), (3881844.85, 43.81875), (-36.3125, 43.95625)])
AP: (0, [(-36.3125, 43.95625), (-36.3125, 44.70625)])
AP: (0, [(-36.3125, 44.70625), (15560610.19375, 45.225), (17528048.2, 45.74375), (13295075.26875, 46.25), (8346670.275, 46.74375), (4670144.3875, 47.21875), (2415650.04375, 47.69375), (1179836.70625, 48.19375)])
AP: (1, [])
AP: (0, [(551502.7375, 48.7375), (248989.7375, 49.30625), (109278.23125, 49.875), (46842.05, 50.4125), (19675.33125, 50.925), (8113.93125, 51.41875), (3284.9375, 51.90625), (1300.0125, 52.4), (495.3625, 52.90625), (172.875, 53.41875), (41.9, 53.93125), (-36.3125, 54.45625)])
AP: (0, [(-36.3125, 54.45625), (-36.3125, 63.175), (-36.325, 63.26875), (-36.4, 63.45), (-36.45625, 63.53125), (-36.6125, 63.63125), (-36.79375, 63.68125), (-45.04375, 63.68125)])
AP: (0, [(-45.04375, 63.68125), (15560601.2125, 63.6375), (17528038.79375, 63.5625), (8346659.98125, 63.30625), (4670133.7, 63.175)])
AP: (1, [])
AP: (0, [(2415638.96875, 63.08125), (1179825.2375, 63.06875), (551490.85, 63.125), (248977.375, 63.2375), (109265.33125, 63.36875), (46826.25, 63.48125), (19612.65625, 63.5625), (-52.5, 63.68125)])
AP: (0, [(-52.5, 63.68125), (-63.0, 63.6375), (-63.28125, 63.6125), (-63.375, 63.5875), (-63.55, 63.49375), (-63.61875, 63.41875), (-63.68125, 63.225), (-63.68125, 36.825), (-63.66875, 36.725), (-63.6375, 36.625), (-63.525, 36.45625), (-63.44375, 36.39375), (-63.25625, 36.3125), (-61.85625, 36.3125)])
AP: (0, [(-61.85625, 36.3125), (15560585.58125, 36.30625)])
AP: (1, [])
AP: (0, [(17528023.75625, 36.30625), (4670118.95, 36.3), (2415624.33125, 36.275), (1179626.85625, 36.2125), (548532.7625, 36.1), (226473.90625, 35.95), (-63.09375, 35.78125)])
AP: (0, [(-63.09375, 35.78125), (-37.025, 35.78125), (-36.70625, 35.8), (-36.525, 35.83125), (-36.33125, 35.9125), (-36.1375, 36.05625), (-35.95, 36.26875), (-35.8875, 36.4), (-35.8, 36.64375), (-35.78125, 36.9), (-35.79375, 63.24375), (-35.83125, 63.4625), (-35.9125, 63.65625), (-36.05, 63.85), (-36.26875, 64.04375), (-36.425, 64.11875), (-36.64375, 64.19375), (-36.9, 64.2125), (-63.24375, 64.2), (-63.46875, 64.1625), (-63.6625, 64.08125), (-63.86875, 63.925), (-64.04375, 63.725), (-64.11875, 63.56875), (-64.19375, 63.35), (-64.2125, 63.05625), (-64.2, 36.75), (-64.1625, 36.525), (-64.08125, 36.33125), (-63.9375, 36.1375), (-63.725, 35.95), (-63.56875, 35.875), (-63.35, 35.8), (-63.09375, 35.78125), (-63.09375, 35.78125)])
OS: Debian GNU/Linux 10 (buster) (i3/i3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17084 +8 (Git)
Build type: Unknown
Branch: lgtmcleanup
Hash: fe14f65c068f8fde4c99e19d42b2dcf7caf01195
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)


Running the same thing on my work machine with python2.7 on Linux Mint doesn't see the problem.
chrisb
Veteran
Posts: 53939
Joined: Tue Mar 17, 2015 9:14 am

Re: Adaptive Path/CAM Operation

Post by chrisb »

The example I had given above works here now. Recompute didn't work, I had to recreate the adaptive path operation due to internal changes of adaptive path.
So here is the version working with my current 0.19. Please retest on different OSs.
Please retest
OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16933 (Git)
Build type: Release
Branch: master
Hash: 4494d384a6b7e183dd4ae12baadfcf6972039c45
Python version: 3.7.3
Qt version: 5.9.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Germany (en_DE)
Attachments
adaptive_cb_0.19.FCStd
(61.45 KiB) Downloaded 42 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53939
Joined: Tue Mar 17, 2015 9:14 am

Re: Adaptive Path/CAM Operation

Post by chrisb »

I tried the first failing example and recreating the adaptive path works here again.
sliptonic wrote: Fri Jun 21, 2019 1:51 pm I'm still seeing the 'path to nowhere' bug but only in Python3.
Can you give a link to your example? I know it is somewhere here, but don't know where.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply