Feature Request: Extend equality restriction in the sketcher.

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!
User avatar
jruiz
Posts: 220
Joined: Tue Oct 28, 2014 1:07 pm
Contact:

Re: Feature Request: Extend equality restriction in the sketcher.

Postby jruiz » Mon Apr 20, 2020 1:40 pm

DeepSOIC wrote:
Mon Apr 20, 2020 1:28 pm
jruiz wrote:
Mon Apr 20, 2020 1:21 pm
So another feature request was born:

Feature request: Appending restriction.
At this point, i'd promote the request to expression-powered constraint...
...cool! that would include general cases..
DeepSOIC wrote:
Mon Apr 20, 2020 1:28 pm
Adding more of these expression-like constraints is not looking productive to me.
well, maybe the previously discussed kind of restrictions could help with some "simple" cases...
as horizontal/vertical distance constraints do instead of the most general distance restriction...
I have uploaded some FreeCAD video tutorials to www.youtube.com/yosoyvenezolano
chrisb
Posts: 25211
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature Request: Extend equality restriction in the sketcher.

Postby chrisb » Mon Apr 20, 2020 2:55 pm

jruiz wrote:
Mon Apr 20, 2020 1:21 pm
What length do you get when you change the value of totalLength constraint from 200 mm to 20 mm? (I get 5 mm here)
Did you recompute the sketch?
I get the same 5mm as expected, and yes I recomputed, and I get this:
Snip macro screenshot-f44e9e.png
Snip macro screenshot-f44e9e.png (6.75 KiB) Viewed 97 times
User avatar
jruiz
Posts: 220
Joined: Tue Oct 28, 2014 1:07 pm
Contact:

Re: Feature Request: Extend equality restriction in the sketcher.

Postby jruiz » Mon Apr 20, 2020 3:16 pm

chrisb wrote:
Mon Apr 20, 2020 2:55 pm
I get the same 5mm as expected, and yes I recomputed, and I get this:
now i'm wondering if i sent the correct version of the file ...
What's the name of the file you are using for getting the above results?
...But I don't see in your image that that three of the four horizontal small lines (including aQuarterOfTotalLength) are restricted to have the same length...
...try the file attached in this message please...
Attachments
proportionalityTest.FCStd
(6.37 KiB) Downloaded 3 times
I have uploaded some FreeCAD video tutorials to www.youtube.com/yosoyvenezolano
chrisb
Posts: 25211
Joined: Tue Mar 17, 2015 9:14 am

Re: Feature Request: Extend equality restriction in the sketcher.

Postby chrisb » Mon Apr 20, 2020 6:10 pm

I used the file from this post:
jruiz wrote:
Sat Apr 18, 2020 3:46 pm
Now consider the file proportionalTest.FCStd:
But it isn't really interesting if it flips or not. It is interesting if it can flip, i.e. if it has a unique solution or not. Only then we can be absolutely sure that it does not flip. In your example giving any length can lead to ambiguities if not enough of the segments are fixed, i.e. you have to apply a length constraint, albeit a proportional one to all but one segment.
User avatar
jruiz
Posts: 220
Joined: Tue Oct 28, 2014 1:07 pm
Contact:

Re: Feature Request: Extend equality restriction in the sketcher.

Postby jruiz » Mon Apr 20, 2020 11:49 pm

chrisb wrote:
Mon Apr 20, 2020 6:10 pm
But it isn't really interesting if it flips or not. It is interesting if it can flip, i.e. if it has a unique solution or not. Only then we can be absolutely sure that it does not flip. In your example giving any length can lead to ambiguities if not enough of the segments are fixed, i.e. you have to apply a length constraint, albeit a proportional one to all but one segment.
Well, I think that one way of preventing flipping sketches is by keeping the inequality relations between the parameters that could be involved in a possible flipping.
For example, If initially in a sketch the dimensions of a set of parameters P_i, (i=1..n) satisfies the inequalities P_i < P_{i + 1}, (i = 1..N-1), after the variation of any parameter the inequality relations must be the same.
I think that the proposed restrictions can help in keeping these inequalities unaltered.
I have uploaded some FreeCAD video tutorials to www.youtube.com/yosoyvenezolano