Sketcher: Ellipse support
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Sketcher: Ellipse support
Hi guys!
This is just to inform that I am getting busy with adding Ellipse support in the Sketcher. I am still in a very very very preliminary stage (... and I do not even know if I will be able to do it)...
I have assigned to myself Mantis tickets: 0001328 and 0001297.
Just a teaser: There is still a looong way ahead...
This is just to inform that I am getting busy with adding Ellipse support in the Sketcher. I am still in a very very very preliminary stage (... and I do not even know if I will be able to do it)...
I have assigned to myself Mantis tickets: 0001328 and 0001297.
Just a teaser: There is still a looong way ahead...
Re: Sketcher: Ellipse support
great Abdullah!
I was wondering how it works, are you thinking it would be click on first Centre then Major then minor diameter? Although I suppose it will be just diameter 1 and diameter 2 as their size as determined by the point location which will in tern define which is minor and which is major?
Jim
I was wondering how it works, are you thinking it would be click on first Centre then Major then minor diameter? Although I suppose it will be just diameter 1 and diameter 2 as their size as determined by the point location which will in tern define which is minor and which is major?
Jim
Re: Sketcher: Ellipse support
I have an insertion method (with a button), with center point, vector of major axis (with modulus providing for major radius) and vector of minor axis (with modulus providing for minor radius). However, it still does not work properly (and I swiched to constraints, while I think about it), because I have to force somehow to two perpendicular axis, or the creation method (with reason) complains that they are not valid...
In the meanwhile I insert them with python as, for example:
App.ActiveDocument.Sketch.addGeometry(Part.Ellipse(App.Vector(20.000000,0,0),App.Vector(0,10.000000,0),App.Vector(10,10,0)))
Creation method has to provide somehow the angle between the X axis of the sketch and the X axis of the ellipse (via vector or other), otherwise we would not be able to have a "rotated" elipse...
... this also generates additional caveats regarding constraints:
1. New constraints? (now we have two radii)
2. New constraint for angle between elipse major axis and X axis?
...
I am still thinking about many things... when it is a little less alpha I will publish it to have some feedback.
In the meanwhile I insert them with python as, for example:
App.ActiveDocument.Sketch.addGeometry(Part.Ellipse(App.Vector(20.000000,0,0),App.Vector(0,10.000000,0),App.Vector(10,10,0)))
Creation method has to provide somehow the angle between the X axis of the sketch and the X axis of the ellipse (via vector or other), otherwise we would not be able to have a "rotated" elipse...
... this also generates additional caveats regarding constraints:
1. New constraints? (now we have two radii)
2. New constraint for angle between elipse major axis and X axis?
...
I am still thinking about many things... when it is a little less alpha I will publish it to have some feedback.
Re: Sketcher: Ellipse support
BTW, the padding works out of the box once when you have the elipses in...
-
- Posts: 655
- Joined: Fri Jul 22, 2011 8:37 pm
- Contact:
Re: Sketcher: Ellipse support
Hi abdullah,
Great work so far. Do you have this in your git repo just to have a look at?
Aren't ellipses usually defined by three points and then use distance constraints to determine major and minor axes and rotation? I guess there will be also an ellipse arc too for adding an angle constraint.
I'd be interested to see how you get the point on line constraint to work. Maybe it's simpler than I think it is and only requires tweaking the arc/circle code.
Luke
Great work so far. Do you have this in your git repo just to have a look at?
Aren't ellipses usually defined by three points and then use distance constraints to determine major and minor axes and rotation? I guess there will be also an ellipse arc too for adding an angle constraint.
I'd be interested to see how you get the point on line constraint to work. Maybe it's simpler than I think it is and only requires tweaking the arc/circle code.
Luke
Development blog - http://freecadamusements.blogspot.co.uk/
Re: Sketcher: Ellipse support
Thanks guys!!
... There are many possible methods (and I welcome suggestions). My best option at this moment is, center point, point defining the major axis (with respect to the center point), so this is also the major radius, and then as third point, a point the ellipse must go through...
At this moment the constraints dealing with the center of the ellipse seem to work (This is the same as in a Circle, so the code was there). The challenge is the constraints applying to the edge. Oh, well, first I need to make the basics work and then I will focus on the rest...
Not yet. At this stage it is still way too early. I am planning to release it when the implementation starts making sense. This would allow to debug and also get feedback from you guys.Do you have this in your git repo just to have a look at?
Well, to be honest with you my trigonometry knowledge is very rusted, but I think that an Ellipse should have 5 degrees of freedom (I see this as x,y of both focuses+constraint on distance to both focuses from any point = major diameter, 2*2+1=5). Those 3 points can not be any 3 points, or you would have infinite solutions. You might start adding "constraints" to those points, (that one is on the major axis, for example)...Aren't ellipses usually defined by three points and then use distance constraints to determine major and minor axes and rotation?
... There are many possible methods (and I welcome suggestions). My best option at this moment is, center point, point defining the major axis (with respect to the center point), so this is also the major radius, and then as third point, a point the ellipse must go through...
I plan to do it, but that is a next step.I guess there will be also an ellipse arc too for adding an angle constraint.
That is part of the "maybe I do not manage to do it"I guess there will be also an ellipse arc too for adding an angle constraint.
At this moment the constraints dealing with the center of the ellipse seem to work (This is the same as in a Circle, so the code was there). The challenge is the constraints applying to the edge. Oh, well, first I need to make the basics work and then I will focus on the rest...
Re: Sketcher: Ellipse support
I have lost count on all the things you do Really appreciate your efforts and everyone's else that are pushing this project forward at such a fast pace.abdullah wrote:This is just to inform that I am getting busy with adding Ellipse support in the Sketcher. I am still in a very very very preliminary stage (... and I do not even know if I will be able to do it)...
Re: Sketcher: Ellipse support
I would use the center point, end point of axis1 and a point the ellipse must go through, which defines the length of axis2.
In this way the center point of the ellipse and the rotation of the ellipse are defined. The rotation of the ellipse should not change, if axis2 becomes longer than axis1.
An arc of the ellipse will have two more constraints: start angle and end angle.
Ulrich
In this way the center point of the ellipse and the rotation of the ellipse are defined. The rotation of the ellipse should not change, if axis2 becomes longer than axis1.
An arc of the ellipse will have two more constraints: start angle and end angle.
Ulrich
Re: Sketcher: Ellipse support
This is great.
Next you will have to allow trimming of an ellipse.
Okay, I will shut up for now.
Thanks for your work! It is really cool to see new contributors to FreeCAD code base.
Next you will have to allow trimming of an ellipse.
Okay, I will shut up for now.
Thanks for your work! It is really cool to see new contributors to FreeCAD code base.
Re: Sketcher: Ellipse support
And then it's on to Bsplines and Bezier curves?Next you will have to allow trimming of an ellipse.
Yes, great work and looking good. Awaiting an upload to start testing with bated breath....
This post made with 0.0% Micro$oft products - GOT LINUX?