Discussion: Path.Area and Path::FeatureArea (PR 460)

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!
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Discussion: Path.Area and Path::FeatureArea (PR 460)

Post by realthunder »

sliptonic wrote: I'm getting some very strange results.
Please sync the git, I have some follow up pushes to fix some Path.Area problem I've found. Maybe it has been fixed.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Discussion: Path.Area and Path::FeatureArea (PR 460)

Post by realthunder »

sliptonic wrote: Yeah, it's still rough but improving ;) I've started doing videos to document path but the basic workflow looks like:
What about pocketing. You'll need a 'negative' face, right? Any tools to help with that?
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Discussion: Path.Area and Path::FeatureArea (PR 460)

Post by sliptonic »

realthunder wrote:
sliptonic wrote: Yeah, it's still rough but improving ;) I've started doing videos to document path but the basic workflow looks like:
What about pocketing. You'll need a 'negative' face, right? Any tools to help with that?

Funny you mention that. A partial depth pocket is no problem because we can use the bottom face to control boundary. We just had discussion about thru-hole pockets. This is one reason I'm so interested in your stuff ;)
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Discussion: Path.Area and Path::FeatureArea (PR 460)

Post by sliptonic »

realthunder wrote:
sliptonic wrote: I'm getting some very strange results.
Please sync the git, I have some follow up pushes to fix some Path.Area problem I've found. Maybe it has been fixed.
Pulled and rebuilt with commit #736cd39851b03dcd84aa6d4a2ccf10d1fe342669

This still causes an error if run as a macro. But it works line by line in the console. Same error about wrong parameters.

Code: Select all

import Path
import Part
area = Path.Area(FitArc=True, Offset=1.0)
area.setPlane(Part.makeCircle(10))
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Discussion: Path.Area and Path::FeatureArea (PR 460)

Post by realthunder »

sliptonic wrote: This still causes an error if run as a macro. But it works line by line in the console. Same error about wrong parameters.
This an curious little bug. The error is cause by a typo. Should be ArcFits, not ArcFit. The error occurred in the constructor. But there is some thing peculiar about error handling in constructor that cause the error message to be delayed by one console line input. So if you type in

Code: Select all

area = Path.Area(FitArc=True)

and type two 'Enter', you'll get the error message.

I've fixed that in the recent push with clear message showing the wrong parameter name.

I also added some improvements. Iterate through sections is made easier, sample code below:

Code: Select all

import Path
area = Path.Area(SectionCount=-1,Offset=1.0,PocketMode=2)
area.add(Part.makeBox(10,10,10))
for s in area.Sections:
	Part.show(s)
You can now get Path.Area from a Path::FeatureArea. It's a copy, so any changes in the returned Path.Area won't affect the feature

Code: Select all

import Path, Part
doc=App.newDocument('test')
doc.addObject('Part::Feature','cube').Shape = Part.makeBox(10,10,10)
doc.addObject('Path::FeatureArea','area')
feature = doc.area
feature.Sources = [doc.cube]
feature.ViewObject.Visibility = False
feature.setParams(SectionCount=-1,Offset=1.0,PocketMode=2)
feature.recompute()
area = feature.getArea()
for s in area.Sections:
	Part.show(s)
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Discussion: Path.Area and Path::FeatureArea (PR 460)

Post by sliptonic »

This might help illustrate one of the problems we've got with pocketing now.
take a shape like my contour torture test. It has a sharp undercut that can't be milled in the current orientation.:
snapshot-7.png
snapshot-7.png (20.4 KiB) Viewed 2014 times
Still, we want to rough it out of a cuboid block. We could model the block and do a boolean to get the material to be removed:
snapshot-8.png
snapshot-8.png (40.76 KiB) Viewed 2014 times
And then use libarea to slice this into layers
snapshot-9.png
snapshot-9.png (46.64 KiB) Viewed 2014 times
The top layers are fine but when we get to the undercut, it's naively unaware of the layers above:
snapshot-10.png
snapshot-10.png (9.99 KiB) Viewed 2014 times
In a way, this is the reverse of the 3d printing problem with overhangs. They need to add 'support material' and we need to avoid cutting in areas that can't be reached from above.

The area in the bottom center that can actually be milled from above, isn't correlated to any one face or any set of edges that can be easily picked.
snapshot-12.png
snapshot-12.png (26.85 KiB) Viewed 2014 times
So we either need to identify areas that can be milled and let the user build operations for those areas. Or we need to identify areas that CAN'T be reached and subtract them from operations.

A 2D projection from above along the Z axis helps but I'm not sure what kind of user interface would let the user pick this area to mill.
herbk
Veteran
Posts: 2657
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: Discussion: Path.Area and Path::FeatureArea (PR 460)

Post by herbk »

Hi sliptonic,
is it possible to ad a inquiry into the code which compares the dimensions of the layer to cut with the layer bevore? Something like "if layer4 > layer3 then cut layer3"?
Gruß Herbert
chrisb
Veteran
Posts: 53920
Joined: Tue Mar 17, 2015 9:14 am

Re: Discussion: Path.Area and Path::FeatureArea (PR 460)

Post by chrisb »

herbk wrote:Hi sliptonic,
is it possible to ad a inquiry into the code which compares the dimensions of the layer to cut with the layer bevore? Something like "if layer4 > layer3 then cut layer3"?
What exactly do you want to compare? x and y componentwise won't do, because as in sliptonic's example the layers can be "twisted" against each other. What should happen, if the condition does not hold?
The approach with a 2d projection sounds promising. A question might be if the whole projection is calculated before the first step or if it is calculated before each layer. The latter being some kind of optimization already, yielding a sort of (Maya) pyramid.
I would vote for the former, because it is a very clear operation, usually performed with a rough mill. The UI seems simple to me: I would select the whole part, and contour cuts in 1 or more steps the 2D projection (which is for me, well, ... the contour :) ).
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
herbk
Veteran
Posts: 2657
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: Discussion: Path.Area and Path::FeatureArea (PR 460)

Post by herbk »

Hi Chris,
the whole thing sems to me, like it go's more to 3D (2,5D) milling, not only get a contour...
because as in sliptonic's example the layers can be "twisted" against each other
why? I understand, that the layers are produced by a slicer. Why should the slicer change the order of the layers? If you change it manuel it will break, of course...
What exactly do you want to compare?
The area/shape of the aktual layer with the layer done before. Will the tool break the the shape of the layer before, the use the same path as layer before.
I have no idea how this could be realized, but maybe someone else have... ;) ;)
Gruß Herbert
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Discussion: Path.Area and Path::FeatureArea (PR 460)

Post by wmayer »

Now the branch works on all supported platforms and is ready for merge. Does everybody agree to merge it?
Post Reply