Path.Area: Welcome, to the new era!

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!
Post Reply
herbk
Veteran
Posts: 2657
Joined: Mon Nov 03, 2014 3:45 pm
Location: Windsbach, Bavarya (Germany)

Re: Path.Area: Welcome, to the new era!

Post by herbk »

Hi,
also it is important to look at the tool's shape, - not each contour ist to make with each rotary chisel.
Gruß Herbert
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Path.Area: Welcome, to the new era!

Post by sliptonic »

@realthunder,

I think I remember you posting something about documentation for PathArea and FeatureArea but I'm having trouble finding it.
What's the best place to find docs?
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Path.Area: Welcome, to the new era!

Post by realthunder »

sliptonic wrote:@realthunder,

I think I remember you posting something about documentation for PathArea and FeatureArea but I'm having trouble finding it.
What's the best place to find docs?
The Path.Area python object is documented through python docstring. You can find the document on each method using FC python console auto-complete by hovering mouse on the method, or simply

Code: Select all

print Path.Area.<method>.__doc__
To get the parameter document, you can either hovering mouse on any of the FeatureArea's property, or

Code: Select all

print Path.Area.setParams.__doc__
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: Path.Area: Welcome, to the new era!

Post by sliptonic »

I'm playing with PathArea to see if I can do things like 'contour' in a faster, cleaner, and more reliable way. These kinds of 2.5D operations are common and I'm not sure exactly how to handle them.

Starting with my profile object (note the overhang)
snapshot.png
snapshot.png (9.67 KiB) Viewed 2462 times
I want to get a contour path like this:
snapshot-1.png
snapshot-1.png (22.45 KiB) Viewed 2462 times
But since PathArea calculates the sections itself, I get a path like this:
snapshot-2.png
snapshot-2.png (20.04 KiB) Viewed 2462 times
If I use TechDraw.findShapeOutline() to get the silhouette and give that to PathArea I get a correct contour path like this:
snapshot-3.png
snapshot-3.png (6.03 KiB) Viewed 2462 times
But as a 2D object, I only get the single depth.

I also tried the makeSections() function and passed in depths but I think this is intended to cue PathArea the heights to create the sections of the solid and not duplicating a section at various heights.



Thoughts?
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Path.Area: Welcome, to the new era!

Post by realthunder »

sliptonic wrote:I'm playing with PathArea to see if I can do things like 'contour' in a faster, cleaner, and more reliable way. These kinds of 2.5D operations are common and I'm not sure exactly how to handle them.
Thoughts?
Ah, I got the notification, finally.

You'll need to find a way to fill the overhang. You can simply select the bottom overhang face, and extrude a solid, and create a FeatureArea containing both your model and the filling solid, then do an offset will get what you want.
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: Path.Area: Welcome, to the new era!

Post by realthunder »

About the lathe pattern, I'll add more build-in pocket patterns when I got time. With a few more exotic patterns, maybe PathArea can be used to build a 3D printing slicer :D. Every open source slicer is using ClipperLib anyway.

Meanwhile, you can use sketch to manually create straight line patterns. With the new sketcher array function, it's a piece of cake.

Once the sketch is done. Turn off FeatureArea packet. You'll get a cut face. Select the sketch in the TreeView, and Ctrl select the face in the 3D viewer window (not the Tree view), and create a new FeatureArea. Change Operation to 'Intersection, Explode to 'True'. You'll get the clipped wire. Select this FeatureArea, and create a FeaturePath of it. Set SortMode to 'None', there you go, a very "lathe alike" pattern. The rapid move still need some close look though. See the attached model file.
Screenshot from 2017-03-15 01-35-55.png
Screenshot from 2017-03-15 01-35-55.png (261.05 KiB) Viewed 2451 times
Attachments
lathepart1.fcstd
(29.17 KiB) Downloaded 59 times
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: Path.Area: Welcome, to the new era!

Post by sliptonic »

I'm trying to manually set section heights.

I have a list of desired heights like

L = [25.0, 20.0, 15.0, 10.0, 5.0, 0.0]

Code: Select all

profile = Path.Area(Offset=5.0,SectionCount=len(L))
profile.setPlane(Part.makeCircle(10))
profile.add(myObj)
profile.makeSections(heights=L)
But the sections don't seem to be at those heights. Instead they're at [5,4,3,2,1,0]
The number of sections always matches the length of the list but the actual postion always seems to increment by 1.
I've tried SectionMode set to workplane and absolute.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Path.Area: Welcome, to the new era!

Post by realthunder »

sliptonic wrote:I'm trying to manually set section heights.
Could you please attach your model file.
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: Path.Area: Welcome, to the new era!

Post by sliptonic »

realthunder wrote:
sliptonic wrote:I'm trying to manually set section heights.
Could you please attach your model file.
Well, the problem is showing up in a script so the model file isn't useful, but this macro reproduces it:

Code: Select all

import Path
myObj = App.ActiveDocument.addObject('Part::Feature','workpiece')
myObj.Shape = Part.makeBox(10,10,10)
myObj.ViewObject.Transparency = 70

L = [25.0, 20.0, 15.0, 10.0, 5.0, 0.0]

profile = Path.Area(Offset=5.0,SectionCount=len(L))
profile.setPlane(Part.makeCircle(10))
profile.add(myObj.Shape)
profile.makeSections(heights=L)
pp = Path.fromShapes(profile.getShape())
Path.show(pp)
for i in pp.Commands:
    print i
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Path.Area: Welcome, to the new era!

Post by realthunder »

sliptonic wrote:
realthunder wrote:
sliptonic wrote: Well, the problem is showing up in a script so the model file isn't useful, but this macro reproduces it:
makeSections returns a list of Area objects containing section slices. The returned area object has the same parameter setting as its parent, but independent of the parent, and independent of each other. You can do whatever you want for each individual sections. It doesn't affect the original Area object. The returned sections are transformed according to the work plane selection, which is a bit inconvenient. I've changed that behavior, and return the section in its correct position. Please sync with my branch. The modified code is shown below.

Code: Select all

App.newDocument()
import Path
myObj = App.ActiveDocument.addObject('Part::Feature','workpiece')
myObj.Shape = Part.makeBox(10,10,10)
myObj.ViewObject.Transparency = 70
L = [25.0, 20.0, 15.0, 10.0, 5.0, 0.0]
sections = Path.Area(Offset=5.0,SectionMode=0).add(myObj.Shape).makeSections(heights=L)
for s in sections:
	Part.show(s.getShape())
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
Post Reply