Sketcher: Ellipse support

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
DeepSOIC
Posts: 7832
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Sketcher: Ellipse support

Postby DeepSOIC » Fri Oct 31, 2014 10:05 pm

TangentViaPoint teaser.png
TangentViaPoint teaser.png (74.6 KiB) Viewed 1491 times
:mrgreen: :mrgreen: :mrgreen: :mrgreen: It's alive!

It's very raw now, but can be tried. To create the constraint, do this:
select two ellipses and a point (the point must be selected last!). Click tangency. Constrain the point to both ellipses using standard point on ellipse. Done.
https://github.com/DeepSOIC/FreeCAD-ell ... cyViaPoint
User avatar
DeepSOIC
Posts: 7832
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Sketcher: Ellipse support

Postby DeepSOIC » Sat Nov 01, 2014 1:31 am

Sorry, can't help myself... Another teaser :D
Attachments
TangentViaPoint teaser2.png
TangentViaPoint teaser2.png (108.03 KiB) Viewed 1478 times
abdullah
Posts: 3868
Joined: Sun May 04, 2014 3:16 pm

Re: Sketcher: Ellipse support

Postby abdullah » Sat Nov 01, 2014 10:59 am

DeepSOIC wrote:Sorry, can't help myself... Another teaser :D
I am happy you managed. ;)

Just a question: Apart from the aesthetics (a point may be more aesthetic than a construction line), do you see any functional advantage? (does it go smoothier,...)
jmaustpc
Posts: 10525
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Sketcher: Ellipse support

Postby jmaustpc » Sat Nov 01, 2014 11:29 am

abdullah wrote:
DeepSOIC wrote:Sorry, can't help myself... Another teaser :D
I am happy you managed. ;)

Just a question: Apart from the aesthetics (a point may be more aesthetic than a construction line), do you see any functional advantage? (does it go smoothier,...)
In a very general sense, one "problem" I have found with construction geometry in general is that to get a fully constrained sketch you need to also constraint the construction line, even when this constraint is meaningless, e.g. the length of a construction line can be meaning less if that line is just being used to define an angle, being used as a "PartDesign feature custom axis", or here where you are using it to make a tangent with two different curves...
abdullah
Posts: 3868
Joined: Sun May 04, 2014 3:16 pm

Re: Sketcher: Ellipse support

Postby abdullah » Sat Nov 01, 2014 1:09 pm

Ok. I see an advantage there.

Do we have this way (object1, object2, pointoftangency) supported for other elements like circles? Can this be seen as an extension of that mechanism, if existing?

DeepSOIC, your current implementation works for tangency Ellipse-Ellipse. Does it work for Ellipse-Circle too? In other words, these modification what does it cover exactly?

I am thinking of the following:

If this can be seen as an extension of such an existing mechanism, then both tangency methods can "live together". If the user does not select a point, the "ugly" with the construction line is generated, if the user does select a point the "beauty" is used.

Most of this, I could findout myself by looking into code and doing trials with FreeCAD. However, I am trying to invest the little time I have available for real coding... thanks for your patience!! :)
abdullah
Posts: 3868
Joined: Sun May 04, 2014 3:16 pm

Re: Sketcher: Ellipse support

Postby abdullah » Sat Nov 01, 2014 1:13 pm

Jim, if you have some time, could you checkout DeepSOIC's branch, give it a try and let us know your impressions from the user point of view??
jmaustpc
Posts: 10525
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Sketcher: Ellipse support

Postby jmaustpc » Sat Nov 01, 2014 1:28 pm

abdullah wrote:Jim, if you have some time, could you checkout DeepSOIC's branch, give it a try and let us know your impressions from the user point of view??
I am away from home for a few days so not until Tuesday.
abdullah
Posts: 3868
Joined: Sun May 04, 2014 3:16 pm

Re: Sketcher: Ellipse support

Postby abdullah » Sat Nov 01, 2014 1:43 pm

jmaustpc wrote:I am away from home for a few days so not until Tuesday.
Do not worry!! :)
User avatar
DeepSOIC
Posts: 7832
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Sketcher: Ellipse support

Postby DeepSOIC » Sat Nov 01, 2014 2:06 pm

Currently I have almost done support for any combinations of arcs, circles, ellipses and arcs of ellipses. But there are some todos, like adding automatic point-on-curve constraints. It will cause problems if I just blindly add two point-on-curves since the point can be an endpoint of an arc to be constrained, which is already on one of the curves. And I have used numeric partials for testing and still haven't changed that.

I have an interesting idea to generalize it into an angle constraint. Tangency is just an angle constraint with an angle of zero.
abdullah
Posts: 3868
Joined: Sun May 04, 2014 3:16 pm

Re: Sketcher: Ellipse support

Postby abdullah » Sat Nov 01, 2014 2:16 pm

Done!!

1. Tangency between two arcs of ellipse

https://github.com/abdullahtahiriyo/Fre ... master.git
1a57e2f..c6fc528 skt2_marktaff_creation