3D part from mathematical formula
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!
3D part from mathematical formula
Hello All.
I hope that I've put this request in the correct place.
I'm beginning a new project to create some acoustic horns, which are defined by an equation which allows me to calculate the width based upon the height (Z relative to the mouth at Z-0). Ideally I'd like to work in spherical polar coordinates but I can happily convert the equations to polar if that's what's required.
I've done some searching but so far i haven't managed to find any examples of how I can create a sketch or solid based upon an equation.
Is this possible? and if so can anybody provide me with either a link to an example or details of how i should proceed? I'm happy to expand upon the details of the kind of shape I need to produce if that would be of help.
Thanks
Russell
I hope that I've put this request in the correct place.
I'm beginning a new project to create some acoustic horns, which are defined by an equation which allows me to calculate the width based upon the height (Z relative to the mouth at Z-0). Ideally I'd like to work in spherical polar coordinates but I can happily convert the equations to polar if that's what's required.
I've done some searching but so far i haven't managed to find any examples of how I can create a sketch or solid based upon an equation.
Is this possible? and if so can anybody provide me with either a link to an example or details of how i should proceed? I'm happy to expand upon the details of the kind of shape I need to produce if that would be of help.
Thanks
Russell
Re: 3D part from methematical formula
Hi Russel, and welcome! The trick is to know what phrases to use in your search. For your use case I think you will want to make use of the SpreadSheet WB, and use Expressions in the Sketcher WB so you an use the value of a cell as the numeral in a Constraint.
https://www.freecadweb.org/wiki/index.p ... _Workbench
https://www.youtube.com/watch?v=b07qbhYHZbU
https://www.youtube.com/watch?v=-HRDcCL73lM
https://www.youtube.com/watch?v=9DzpRqTvdU4
I think someone (maybe @DeepSOIC ?) has already done that to create an acoustic horn, but I can't find it...
https://www.freecadweb.org/wiki/index.p ... _Workbench
https://www.youtube.com/watch?v=b07qbhYHZbU
https://www.youtube.com/watch?v=-HRDcCL73lM
https://www.youtube.com/watch?v=9DzpRqTvdU4
I think someone (maybe @DeepSOIC ?) has already done that to create an acoustic horn, but I can't find it...
Re: 3D part from methematical formula
Hi, I could find the thread about the horn https://forum.freecadweb.org/viewtopic.php?t=14663, but unfortunately the file is not any more in Dropbox
Re: 3D part from methematical formula
hi
for equation tray Macro_WorkFeatures menu Wires > Curves and surface > Launch curves and surface menu
and Macros_recipes section mathematical functions
mario
for equation tray Macro_WorkFeatures menu Wires > Curves and surface > Launch curves and surface menu
and Macros_recipes section mathematical functions
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: 3D part from methematical formula
Yep that was me!
https://forum.freecadweb.org/viewtopic.php?f=24&t=7822
I made an approximate tractrix by using a geometric method of construction, no formulas were involved.
I was happy with everything about it except for the actual sound
There are macros in Macros recipes that let one generate a curve by typing in parametric equations. Use them as basis for your solid.
Re: 3D part from methematical formula
Thanks all.
I'll have to do some reading and watching to try and work out how best to attack the problem. I had come across the spreadsheet functionality during my searched by concluded that it probably wasn't what I needed.
I'm trying to produce something like this
Whilst I was sure that I could create the basic shape using a sketch of some form I've only ever used rotations and extrusions from a sketch. whereas what i need to produce while symmetrical has a different dimension down the X to the Y axis and thus couldn't be created using a rotation.
As I say I'll have a proper read and come back once I feel I'm properly informed on what's ben suggested so far.
Thanks again
Russell
I'll have to do some reading and watching to try and work out how best to attack the problem. I had come across the spreadsheet functionality during my searched by concluded that it probably wasn't what I needed.
I'm trying to produce something like this
Whilst I was sure that I could create the basic shape using a sketch of some form I've only ever used rotations and extrusions from a sketch. whereas what i need to produce while symmetrical has a different dimension down the X to the Y axis and thus couldn't be created using a rotation.
As I say I'll have a proper read and come back once I feel I'm properly informed on what's ben suggested so far.
Thanks again
Russell
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: 3D part from mathematical formula
Then, you can use Part Loft. It will take quite a bit more work of course, compared to a simple revolution.
Also, you can consider non-uniform scaling to squeeze a revolved shape to become more elliptical.
Re: 3D part from mathematical formula
You can obtain non-uniform scaling with a Draft Clone.
- thomas-neemann
- Veteran
- Posts: 11858
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: 3D part from mathematical formula
in the event that further suggestions are sought, here is a suggestion for a macro
https://www.youtube.com/watch?v=HMY3Ki1iatM
edit
https://www.youtube.com/watch?v=HMY3Ki1iatM
edit
Code: Select all
import FreeCAD
import Draft
import math
for r in range(5, 360,10):
for t in range(0, 360,10):
Draft.makePoint(r*math.cos(t*0.017452)*0.1, r*math.sin(r*0.017452)*0.1, r*math.sin(t*0.017452)*0.1)
Re: 3D part from mathematical formula
FormZ has an interesting closed rotational loft facility that's continuously tangential through the first profile, which is also the last profile. For other loft systems like FreeCAD, we get the same result by lofting through circles in the other direction to make a cylinder, tube or truncated cone. Which is how you can loft your horn, with circles or ellipses or rectangles with custom fillets in either the profiles or in the solid or surface result. I think
that offset will work painlessly with it too.
that offset will work painlessly with it too.