Dear peoples,
how can i draw a mathematical functions?
I want to draw y=x²/4 and i need to set some drillings depending of this function.
Any ideas?
How to draw a mathmatical function?
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Re: How to draw a mathmatical function?
Check out this link. Since arbitrary parametric curves are not supported this solution does an approximation with line segments (simple) or B-spline curves.
viewtopic.php?f=13&t=6226#p50611
viewtopic.php?f=13&t=6226#p50611
Re: How to draw a mathmatical function?
Our geometry kernel support parabolas, so there should be no need to use an approximationsmilie wrote:I want to draw y=x²/4
http://opencascade.sourcearchive.com/do ... abola.html
the default Parabola seems to have the right scaling and position, but is symetrical to the x-axis.
Code: Select all
import FreeCAD
import Part
p=Part.Parabola
#p.Focal=1.0
p.rotate(FreeCAD.Placement(FreeCAD.Vector(),FreeCAD.Rotation(90,0,0)))
Re: How to draw a mathmatical function?
Hyperbola is there as well.
Re: How to draw a mathmatical function?
The parabolas are handled the geometric way so that converting the algebraic form y=x²/4 is not that easy. Besides that when using a B-Spline curve of degree two then it's not an approximation but 100% exact.Our geometry kernel support parabolas, so there should be no need to use an approximation
Re: How to draw a mathmatical function?
Why? I thought that i just need to set XDir to (0,1,0), YDir(1,0,0) and i would change Axis to (0,0,-1) to keep orientation right handed. The focal length (F) defaults to 1.0wmayer wrote:The parabolas are handled the geometric way so that converting the algebraic form y=x²/4 is not that easy.Our geometry kernel support parabolas, so there should be no need to use an approximation
Code: Select all
The Geom_Parabola parabola is parameterized as follows:
P(U) = O + U*U/(4.*F)*XDir + U*YDir
That is true for parabolas, but not for the hyperbolas jmaustpc mentioned in the meantime. And getting the 100% exact B-Spline representation is not obivous to me. (I wouldn't trust the OCCT interpolation functions on this).wmayer wrote:Besides that when using a B-Spline curve of degree two then it's not an approximation but 100% exact.