[Sketcher] Convert coincidence+perpendicular to endpoint perpendicularity ?

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
chrisb
Posts: 29041
Joined: Tue Mar 17, 2015 9:14 am

Re: [Sketcher] Convert coincidence+perpendicular to endpoint perpendicularity ?

A problem is, that showing the right symbol in 3D is one thing, but selecting is another. In 3D view I think that two icons suffice: the well known icon for line-line-tangency and second line second or third icon if a point is involved. But it would be a significant handling change if I had to select the appropriate icon to apply e.g. a point-point tangency and what would the other icons do on that selection, throw an error message?
A Sketcher Lecture with in-depth information is available in English, auf deutsch, en français, en español.
Jee-Bee
Posts: 2145
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: [Sketcher] Convert coincidence+perpendicular to endpoint perpendicularity ?

Can you explain the point - point tangency? In my opinion it don't exist.

i want to create an example but it fails for now. see picture what i want to do.
Screen Shot 2019-03-12 at 07.10.47.png (31.14 KiB) Viewed 884 times
but when trimming the lines it remove the tangend what i didn't expect.
What i basically want to show that in both cases the lines are tangend but that in one case the two end point are coincident what in the left example isn't the case.
chrisb
Posts: 29041
Joined: Tue Mar 17, 2015 9:14 am

Re: [Sketcher] Convert coincidence+perpendicular to endpoint perpendicularity ?

Jee-Bee wrote:
Tue Mar 12, 2019 6:29 am
Can you explain the point - point tangency?
It is from a geometric point of view not a special tangency but two constraints: point-point tangency can be applied to the endpoints of two curves/lines and means that these both elements are tangent and have a coincidence in the endpoints. This is used quite often in sketches where you want smooth transitions and the end of one element is the beginning of the next.
A Sketcher Lecture with in-depth information is available in English, auf deutsch, en français, en español.
openBrain
Posts: 4872
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Sketcher] Convert coincidence+perpendicular to endpoint perpendicularity ?

chrisb wrote:
Tue Mar 12, 2019 12:39 am
A problem is, that showing the right symbol in 3D is one thing, but selecting is another. In 3D view I think that two icons suffice: the well known icon for line-line-tangency and second line second or third icon if a point is involved. But it would be a significant handling change if I had to select the appropriate icon to apply e.g. a point-point tangency and what would the other icons do on that selection, throw an error message?
The idea is of course that there is only one action button to set tangency/colinearity (the one I drew at the top in the previous post) as of today. The other symbols are just display ones that sketcher automatically choose so the user has a better view of the exact constraint that is applied.
No way that the user has to choose the right one.
Jee-Bee wrote:
Tue Mar 12, 2019 6:29 am
Can you explain the point - point tangency? In my opinion it don't exist.
This is often called a "smooth joint".
This is case #2 in Sketcher ConstrainTangent.
abdullah
Posts: 3583
Joined: Sun May 04, 2014 3:16 pm

Re: [Sketcher] Convert coincidence+perpendicular to endpoint perpendicularity ?

Jee-Bee wrote:
Mon Mar 11, 2019 3:04 pm

What i questioning my self now is that is the way the solver have to handle multiple combinations of constraints (on lines, on boints or on both) the issue we have this weird behavour.
Sometimes we need the combination of constraints. sometimes we choose to make a constraint independend when it is just a special case.
I think we make the solver too error prone this way. below is how is see the relation between 3 different constraints who are basically the same.
• coincident is a constraint which solve the coincidence of a point on a point
• "point on a line" is a constraint which solve the coincidence of a point on a (point from a) line
• colinearity is a constraint which solve the coincidence of a two points from a line on (two points from another) line
You have to take into account that sketcher constraint is different from solver constraint.

Many sketcher constraints are implemented via several solver constraints. Solver constraints take a single DoF.
Jee-Bee wrote:
Mon Mar 11, 2019 3:04 pm
I wanna do thought experiment:
I create two lines. the first is infinite the second finite.
I think i left here a bit the regulations inside FC a bit. since point on object is just a coincident of a poitn on a line...
so i add two coincidents of both end points of the finite line on the infinite line.
Am i free to move the finite line over the infinite line? yes since two degrees of freedom are open it should.

Another thought experiment:
Again two lines but now bothe finite. Again i add two coincidents now betweent the the first finite line and two end points from the other finite line.
What the case should be now is that the second could be moved outside the boundary of the fist line.

And what do we have colinearity.
Line to line tangency is actually implemented as solver point on line constraints (int Sketch::addTangentConstraint(int geoId1, int geoId2) in Sketch.cpp):

Code: Select all

``````    if (Geoms[geoId2].type == Line) {
if (Geoms[geoId1].type == Line) {
GCS::Line &l1 = Lines[Geoms[geoId1].index];
GCS::Point &l2p1 = Points[Geoms[geoId2].startPointId];
GCS::Point &l2p2 = Points[Geoms[geoId2].endPointId];
int tag = ++ConstraintsCounter;
return ConstraintsCounter;
}
else
std::swap(geoId1, geoId2);
}
``````
You may see a tangency in the sketcher, but under the hood is that above
Jee-Bee
Posts: 2145
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: [Sketcher] Convert coincidence+perpendicular to endpoint perpendicularity ?

Jee-Bee wrote:
Tue Mar 12, 2019 6:29 am
Can you explain the point - point tangency? In my opinion it don't exist.
chrisb wrote:
Tue Mar 12, 2019 9:50 am
It is from a geometric point of view not a special tangency but two constraints:
Thanks that was what i meant.

abdullah wrote:
Tue Mar 12, 2019 1:26 pm
You have to take into account that sketcher constraint is different from solver constraint.
Sorry i don't know the exact solver implementation i'm just a user.

abdullah wrote:
Tue Mar 12, 2019 1:26 pm
Line to line tangency is actually implemented as solver point on line constraints (int Sketch::addTangentConstraint(int geoId1, int geoId2) in Sketch.cpp):

Code: Select all

``````    if (Geoms[geoId2].type == Line) {
if (Geoms[geoId1].type == Line) {
GCS::Line &l1 = Lines[Geoms[geoId1].index];
GCS::Point &l2p1 = Points[Geoms[geoId2].startPointId];
GCS::Point &l2p2 = Points[Geoms[geoId2].endPointId];
int tag = ++ConstraintsCounter;
return ConstraintsCounter;
}
else
std::swap(geoId1, geoId2);
}
``````
You may see a tangency in the sketcher, but under the hood is that above
In that case the same could be done with coincident(first choice)/ point on line(second choice). If two lines are selected that the same behaviour can implemented. Prom solver perspective it don't matter. For user perspective it is better. i think it is closer to first feeling. And all users what are used to current state are free to use that.
abdullah
Posts: 3583
Joined: Sun May 04, 2014 3:16 pm

Re: [Sketcher] Convert coincidence+perpendicular to endpoint perpendicularity ?

openBrain wrote:
Mon Mar 11, 2019 1:42 pm
As I definitely prefer doing a not-perfect proposal than just waiting doing nothing, I'll take some time tonight to draw some icons. But prepare yourself for the worst as I'm definitely more an engineer than an artist.
Nobody is perfect
openBrain wrote:
Mon Mar 11, 2019 7:26 pm
Feel free to comment, good or bad.
There might be some "technical criteria" on icons (I remember that we have some palette to respect), but I get the idea. We can mark this in the bug tracker for a visit during v.19 development.
Jee-Bee wrote:
Mon Mar 11, 2019 7:42 pm
I would vote more for position.
I will consider the icons and position when I work on the solution.
chrisb wrote:
Tue Mar 12, 2019 12:39 am
A problem is, that showing the right symbol in 3D is one thing, but selecting is another. In 3D view I think that two icons suffice: the well known icon for line-line-tangency and second line second or third icon if a point is involved. But it would be a significant handling change if I had to select the appropriate icon to apply e.g. a point-point tangency and what would the other icons do on that selection, throw an error message?
As OpenBrain says, the icons are for the 3D view, not for the buttons.
Jee-Bee wrote:
Tue Mar 12, 2019 6:29 am
but when trimming the lines it remove the tangend what i didn't expect.
What i basically want to show that in both cases the lines are tangend but that in one case the two end point are coincident what in the left example isn't the case.
I think this is a bug with the trimming tool. Please file a bug report.
Jee-Bee wrote:
Tue Mar 12, 2019 2:38 pm
In that case the same could be done with coincident(first choice)/ point on line(second choice). If two lines are selected that the same behaviour can implemented. Prom solver perspective it don't matter. For user perspective it is better. i think it is closer to first feeling. And all users what are used to current state are free to use that.
Ok. Correct me if I am wrong. You are proposing that:
1) the "coincident constraint button" is made to do what the tangency button does today when two line segments are selected as input.
2) the "point on object toolbar button" is made to do what the tangency button does today when two line segments are selected as input.

this, without changing the behaviour of the tangency button for backwards compatibility.

Given the fact that those two options refer to operations that must use a point, its use for a curve to curve operation, seems counter-intuitive to me.

You may argue that using a tangency button for point-to-curve or endpoint-to-endpoint is equally counter-intuitive. I think it is less counter-intuitive, because the concept of tangency at a point/between lines exists in geometry and Leibniz comes to the rescue on a second or third thoughts. However, I would go with your argument that it is still somewhat counter-intuitive. In any case, we do have today this behaviour in FreeCAD (tangency to mean colinear), so it stops being a matter of counter-intuitiveness to be one of backwards compatibility.

I will not break backwards compatibility (which is in line with what you say).

I am inclined not to introduce further counter-intuitiveness in order to fix something that is already counter-intuitive in its current form.
Jee-Bee
Posts: 2145
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: [Sketcher] Convert coincidence+perpendicular to endpoint perpendicularity ?

abdullah wrote:
Wed Mar 13, 2019 1:13 pm

Ok. Correct me if I am wrong. You are proposing that:
1) the "coincident constraint button" is made to do what the tangency button does today when two line segments are selected as input.
2) the "point on object toolbar button" is made to do what the tangency button does today when two line segments are selected as input.
My proposal is to add a second method with the same result as the current tangancy. specially if a special icon is introduced for colinear.
abdullah wrote:
Wed Mar 13, 2019 1:13 pm
I think this is a bug with the trimming tool. Please file a bug report.
hmm i should request a mantis account still have not one
Jee-Bee
Posts: 2145
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: [Sketcher] Convert coincidence+perpendicular to endpoint perpendicularity ?

abdullah wrote:
Wed Mar 13, 2019 1:13 pm
I think this is a bug with the trimming tool. Please file a bug report.
issue #3910
openBrain
Posts: 4872
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Sketcher] Convert coincidence+perpendicular to endpoint perpendicularity ?

abdullah wrote:
Wed Mar 13, 2019 1:13 pm
Ping
Hi abdullah, could that be the good time to insert the 2 points of this topic (constraint substitution & differentiated constraint icons) into the 0.19 dev cycle ?
I can take care of creating feature tickets.