Sketcher: Ellipse support

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Sketcher: Ellipse support

Post by DeepSOIC »

TangentViaPoint teaser.png
TangentViaPoint teaser.png (74.6 KiB) Viewed 2167 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
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Sketcher: Ellipse support

Post by DeepSOIC »

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

Re: Sketcher: Ellipse support

Post by abdullah »

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
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Sketcher: Ellipse support

Post by jmaustpc »

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
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Sketcher: Ellipse support

Post by abdullah »

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
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Sketcher: Ellipse support

Post by abdullah »

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
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Sketcher: Ellipse support

Post by jmaustpc »

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
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Sketcher: Ellipse support

Post by abdullah »

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

Re: Sketcher: Ellipse support

Post by DeepSOIC »

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
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Sketcher: Ellipse support

Post by abdullah »

Done!!

1. Tangency between two arcs of ellipse

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