[SOLVED] Setting sketch placement
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
[SOLVED] Setting sketch placement
When sweeping a sketch along an edge, is there a way to automatically align the sketch to the edge? By that, I don't just mean rotation (Part::Sweep appears to do that automatically). I mean, position the sketch such that it is coincident with the sweep path/edge, even if, prior to the sweep, the two are nowhere near each other.
The best I can figure is to do it in Python using the Placement property. However, I'm not quite sure how to go about that...
The best I can figure is to do it in Python using the Placement property. However, I'm not quite sure how to go about that...
Last edited by Joel_graff on Fri Nov 02, 2018 5:32 pm, edited 1 time in total.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Setting sketch placement
You can attach the sketch to the edge. I'd have to see your model to say exactly how to go about doing it.
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Setting sketch placement
That's the tricky part. I want to be able to sweep a sketch along an edge with arbitrary starting and stopping points. Since that isn't supported, I need to generate my own edge based on those positions and sweep the sketch along it, instead. Further, I anticipate the sketch will be auto-generated or possibly imported from another file, so I'm writing a custom tool to do all of this.TheMarkster wrote: ↑Fri Oct 05, 2018 7:26 pm You can attach the sketch to the edge. I'd have to see your model to say exactly how to go about doing it.
In other words, prior to the sweep, the sweep path doesn't exist and the sketch is arbitrarily placed in the 3D environment. To that point, I had planned on treating the sketch's origin as the point that's always attached to the generated edge to help simplify matters. Thus, hopefully, all I need to do is create a new placement for the sketch... unless there's another way to auto-align the two in a separate operation before sweeping.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
-
- Posts: 243
- Joined: Wed May 31, 2017 11:49 pm
Re: Setting sketch placement
Not sure if this is going to help but, it may lead to further 'inventive' ideas..
This example is for a Homemade Variable Radius (PartDesign does not have Variable Radius).
One Radius, Lofts one section to another of smaller radius's sketch.
The other Radius uses a Multi-Section Sweep along a Path. The Path was sketched using the existing edge (I think this is what you're interested in). The Icon/Tool in Sketch is "Create an Edge Linked to existing geometry"
[corrected typo]
Consider the attached: Wherever the part containing the edge is, create Datums for the Sweep Sections and Path.Joel_graff wrote: ↑Fri Oct 05, 2018 7:09 pm is there a way to automatically align the sketch to the edge?
This example is for a Homemade Variable Radius (PartDesign does not have Variable Radius).
One Radius, Lofts one section to another of smaller radius's sketch.
The other Radius uses a Multi-Section Sweep along a Path. The Path was sketched using the existing edge (I think this is what you're interested in). The Icon/Tool in Sketch is "Create an Edge Linked to existing geometry"
[corrected typo]
Last edited by oldmachine on Fri Oct 05, 2018 8:36 pm, edited 2 times in total.
MAC OSX Sierra
3D Parts & Links (made using FreeCad and Solidworks): https://www.thingiverse.com/Still_Breathing/designs
Android App & Links: https://play.google.com/store/apps/deta ... .bestknots
3D Parts & Links (made using FreeCad and Solidworks): https://www.thingiverse.com/Still_Breathing/designs
Android App & Links: https://play.google.com/store/apps/deta ... .bestknots
Re: Setting sketch placement
I am not sure or it does what you want but try the macro solid sweep
Re: Setting sketch placement
Working with Datum point, Datum line and Datum plane can be the solution
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Setting sketch placement
I don't see an attachment, unfortunately...oldmachine wrote: ↑Fri Oct 05, 2018 8:22 pm Consider the attached: Wherever the part containing the edge is, create Datums for the Sweep Sections and Path.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Setting sketch placement
Thanks for the video, but I'm still not certain how it helps.
Perhaps I could rephrase my question:
Could I use datum planes to arbitrarily control the starting and ending positions of a sweep along the sweep path?
If I can't specify the exact starting and ending points of a sweep along a given path of one or more edges, then I need to copy the portions of the path that I want the sweep to follow as separate edges, and use those edges exclusively for the sweep.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Setting sketch placement
Ok, so I've been working on this a bit more, and I think I'm close, but I still have some gaps in my understanding of manipulating a sketch via it's placement.
So in the atached file, I have a body which contains two sketches: the sweep path (Sketch) and the template to be swept (Sketch001).
In the python console, I've successfully oriented the sketch using the MapMode and Support properties to the arc in the sweep path.
However, I need to take the last step and position the sketch at the starting point of the sweep path. In the case of this example, the arc's "first" vertex is actually between the arc and line, but that's an issue I can address later.
Right now, I need to figure out how to set the position of the second sketch given a point of an edge in the first sketch.
So in the atached file, I have a body which contains two sketches: the sweep path (Sketch) and the template to be swept (Sketch001).
In the python console, I've successfully oriented the sketch using the MapMode and Support properties to the arc in the sweep path.
However, I need to take the last step and position the sketch at the starting point of the sweep path. In the case of this example, the arc's "first" vertex is actually between the arc and line, but that's an issue I can address later.
Right now, I need to figure out how to set the position of the second sketch given a point of an edge in the first sketch.
- Attachments
-
- test.FCStd
- (6.44 KiB) Downloaded 52 times
-
- Capture.JPG (28.97 KiB) Viewed 2616 times
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
Re: Setting sketch placement
Here some proposals to extend the sweep tools: https://forum.freecadweb.org/viewtopic.php?f=8&t=31610
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.