"Cone" with ellipse on bottom and top
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!
-
- Posts: 12
- Joined: Thu Mar 31, 2011 7:36 pm
"Cone" with ellipse on bottom and top
Hi,
Is there a simple way to create cone like part with ellipse instead of circle on bottom and top of it?
Regards
Jacek
Is there a simple way to create cone like part with ellipse instead of circle on bottom and top of it?
Regards
Jacek
Re: "Cone" with ellipse on bottom and top
Yep.
Code: Select all
import Part
cone=Part.makeCone(2,4,10)
from FreeCAD import Base
mat=Base.Matrix()
mat.A22=1.5
cone=cone.transformGeometry(mat)
Part.show(cone)
Re: "Cone" with ellipse on bottom and top
Thank you for the tip. At a start I thought about same solution but it doesn't completely solve my problem. It will resize same way top and bottom circle to ellipse and I need separate way of controlling top and bottom ellipse size.
My part to model is elliptically shaped (but starts with circle) horn.
I have calculated about 400 ellipses for different layers of the horn (they are not equally spaced). I thought that there may be a way to create two 2D ellipses and than do something to connect their edges to full 3d "cone". Or maybe there is a way to model it other way than my set of elliptical cones?
My part to model is elliptically shaped (but starts with circle) horn.
I have calculated about 400 ellipses for different layers of the horn (they are not equally spaced). I thought that there may be a way to create two 2D ellipses and than do something to connect their edges to full 3d "cone". Or maybe there is a way to model it other way than my set of elliptical cones?
Re: "Cone" with ellipse on bottom and top
Hi,
400 ellipses? The makeLoft command could do this with three, but it makes a surface opened on both ends. So you'll need to close the ends and make a solid, a few more operations involved (I think with makeSolid but I've never tried it). Plus I don't even know if it's possible to draw a 2D ellipse at the moment.
If you want to look into using makeLoft, search the forum, I got help from Werner and Yorik a few weeks ago.
Edit: looked at the Python scripting API, especially at transformGeometry, it looks like the transformation could be made to the 2D elements instead of the 3D shape, but I'm not sure. I'm still very green at this. So you draw circles for your profiles, transform the bottom and mid one to ellipses, then you execute makeLoft.
Edit Nº 2: for the fun of it, I drew ellipses in QCad, saved as dxf to import it in FreeCAD, but the ellipses are not recognized.
400 ellipses? The makeLoft command could do this with three, but it makes a surface opened on both ends. So you'll need to close the ends and make a solid, a few more operations involved (I think with makeSolid but I've never tried it). Plus I don't even know if it's possible to draw a 2D ellipse at the moment.
If you want to look into using makeLoft, search the forum, I got help from Werner and Yorik a few weeks ago.
Edit: looked at the Python scripting API, especially at transformGeometry, it looks like the transformation could be made to the 2D elements instead of the 3D shape, but I'm not sure. I'm still very green at this. So you draw circles for your profiles, transform the bottom and mid one to ellipses, then you execute makeLoft.
Edit Nº 2: for the fun of it, I drew ellipses in QCad, saved as dxf to import it in FreeCAD, but the ellipses are not recognized.
- Attachments
-
- loft_trumpet.jpg (24.13 KiB) Viewed 4580 times
Re: "Cone" with ellipse on bottom and top
Doing it with makeLoft should work. Another way could be Part.Wire.makePipeShell() if you know the curve along the ellipses -- it looks like a parabola. Here is a simplified script which just uses a straight line but it's good enough to demonstrate the idea.
Code: Select all
import Part
from FreeCAD import Base
c=Part.makeCircle(2,Base.Vector(0,0,10))
e=Part.makeCircle(20)
m=Base.Matrix()
m.A22=0.7
e=e.transformGeometry(m)
e=Part.Edge(e)
Part.show(c)
Part.show(e)
w1=Part.Wire(e)
w2=Part.Wire(c)
l=Part.makeLine(e.valueAt(0),c.valueAt(0))
Part.show(l)
w3=Part.Wire(l)
shell=w3.makePipeShell([w1,w2])
Part.show(shell
Re: "Cone" with ellipse on bottom and top
Cool!
It is better since you can control the trajectory. Can a BSpline be used for the curve between the elllipes? Can two or more different curves be used?
It is better since you can control the trajectory. Can a BSpline be used for the curve between the elllipes? Can two or more different curves be used?
Re: "Cone" with ellipse on bottom and top
You can use whatever you want. The only important thing is that the object of which you call "makePipeShell" is a wire. Btw, this method is available for wires only anyway. Since a wire can consist of several curves the second point is also possible.It is better since you can control the trajectory. Can a BSpline be used for the curve between the elllipes? Can two or more different curves be used?
Re: "Cone" with ellipse on bottom and top
But with 3 ellipses you will not get profile I want. I think I can live happily with 40-80.normandc wrote:400 ellipses? The makeLoft command could do this with three.
I have tried makeLoft way. For a test I used 11 layers.
For a start tried to run makeLoft for all of them but result was incorrect.
Next try was to run makeLoft for group of 3 ellipses.
But union of them gave strange result
So I grouped them by 2 and union result was correct
So now I have to figure out how to close top and bottom because makeSolid failed to do that.
And/or try second approach.
btw. I used Part.Ellipse. Is is something wrong with it?
Any way thank you both for help
Re: "Cone" with ellipse on bottom and top
Hi!
Nice work! But...
To be honest though, I don't know how makePipeShell() works. In commercial parametric CAD packages you can create lofts with multiple profiles along with multiple guide curves that are in contact with the profiles. This would be the best tool for your "trumpet" I think.
If you did, then let's wait for Werner's answer because I want to know how to do this too.
Nice work! But...
It is just my opinion, and I am in no way an expert, but it's based on the surfacing work (product design) I did in Solid Edge for two years, as well as reading some surfacing guidelines for SolidWorks (the principles are universal). It seems to me like you are making your shape uselessly complicated with so many profiles. Plus you have to calculate your ellipses' positions and dimensions perfectly or you won't get a nice smooth curve in between, rather you'll get a bumpy or uneven surface. In this case Werner's suggestion of using makePipeShell() may ensure you get the exact curve you want, with very few profiles.Guest wrote:But with 3 ellipses you will not get profile I want. I think I can live happily with 40-80.normandc wrote:400 ellipses? The makeLoft command could do this with three.
To be honest though, I don't know how makePipeShell() works. In commercial parametric CAD packages you can create lofts with multiple profiles along with multiple guide curves that are in contact with the profiles. This would be the best tool for your "trumpet" I think.
Hope you won't mind my asking, but I imagine you made sure you had surfaces at top and bottom before executing the makeSolid command?So now I have to figure out how to close top and bottom because makeSolid failed to do that.
If you did, then let's wait for Werner's answer because I want to know how to do this too.
My mistake. It is not listed in the wiki, so I assumed it didn't exist. Just saw it in the console's completion mode. I confess I don't use it much. I don't even have a working knowledge of Python yet...btw. I used Part.Ellipse. Is is something wrong with it?
Re: "Cone" with ellipse on bottom and top
To get a closed solid you have to do two further steps. From the top and bottom profiles make a face and then make a compound of the three objects which then can be converted into a solid.Hope you won't mind my asking, but I imagine you made sure you had surfaces at top and bottom before executing the makeSolid command?
If you did, then let's wait for Werner's answer because I want to know how to do this too.
Code: Select all
...
f1=Part.Face(w1)
f2=Part.Face(w2)
comp=Part.Compound([shell,f1,f2])
solid=Part.Solid(Part.Shell(comp.Faces))
Part.show(solid)