Path.Area: Welcome, to the new era!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Path.Area: Welcome, to the new era!
Hi,
also it is important to look at the tool's shape, - not each contour ist to make with each rotary chisel.
also it is important to look at the tool's shape, - not each contour ist to make with each rotary chisel.
Gruß Herbert
- sliptonic
- Veteran
- Posts: 3459
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Path.Area: Welcome, to the new era!
@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?
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?
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: Path.Area: Welcome, to the new era!
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 simplysliptonic 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?
Code: Select all
print Path.Area.<method>.__doc__
Code: Select all
print Path.Area.setParams.__doc__
- sliptonic
- Veteran
- Posts: 3459
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Path.Area: Welcome, to the new era!
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) I want to get a contour path like this: But since PathArea calculates the sections itself, I get a path like this: If I use TechDraw.findShapeOutline() to get the silhouette and give that to PathArea I get a correct contour path like this: 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?
Starting with my profile object (note the overhang) I want to get a contour path like this: But since PathArea calculates the sections itself, I get a path like this: If I use TechDraw.findShapeOutline() to get the silhouette and give that to PathArea I get a correct contour path like this: 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?
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: Path.Area: Welcome, to the new era!
Ah, I got the notification, finally.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?
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.
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: Path.Area: Welcome, to the new era!
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 . 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.
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.
- Attachments
-
- lathepart1.fcstd
- (29.17 KiB) Downloaded 61 times
- sliptonic
- Veteran
- Posts: 3459
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Path.Area: Welcome, to the new era!
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]
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.
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)
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.
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: Path.Area: Welcome, to the new era!
Could you please attach your model file.sliptonic wrote:I'm trying to manually set section heights.
- sliptonic
- Veteran
- Posts: 3459
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Path.Area: Welcome, to the new era!
Well, the problem is showing up in a script so the model file isn't useful, but this macro reproduces it:realthunder wrote:Could you please attach your model file.sliptonic wrote:I'm trying to manually set section heights.
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
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: Path.Area: Welcome, to the new era!
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.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:
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())