Constraints' Limits/Ranges and Preferred values?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
jaggz
Posts: 6
Joined: Sat Jun 13, 2015 8:43 am

Constraints' Limits/Ranges and Preferred values?

Postby jaggz » Thu Jun 13, 2019 10:36 pm

Is there a way to set, for example:
1. A minimum and maximum dimension for a constraint? For instance, I want to model a lever system which uses a linear actuator -- I'm trying to figure out the lengths and pivot points for the rods that make up the system, and would like to restrict the actuator's length to a range of values.
2. A preferred value for a constraint, "I'd like the range between x and y, but closer to x is preferred."

I posted a video of some fiddling with the mechanism here:
https://www.youtube.com/watch?v=2a1cLqYYLVY
chrisb
Posts: 15780
Joined: Tue Mar 17, 2015 9:14 am

Re: Constraints' Limits/Ranges and Preferred values?

Postby chrisb » Thu Jun 13, 2019 11:55 pm

This is not possible yet, but it had been discussed before in the forum. It could help preventing Sketches from jumping on changing certain dimensions.
Roy_043
Posts: 172
Joined: Thu Dec 27, 2018 12:28 pm

Re: Constraints' Limits/Ranges and Preferred values?

Postby Roy_043 » Fri Jun 14, 2019 7:56 am

Not sure if this is helpful, but using the min and max functions in expressions you can create a fixed range for a dimensional constraint.
In the attached file the RefDist constraint controls the KeptInRange constraint.
But the length of KeptInRange will always be 100mm<=L<=200mm.
Attachments
KeptInRange.FCStd
(7.48 KiB) Downloaded 5 times
chrisb
Posts: 15780
Joined: Tue Mar 17, 2015 9:14 am

Re: Constraints' Limits/Ranges and Preferred values?

Postby chrisb » Fri Jun 14, 2019 8:40 pm

jaggz wrote:
Fri Jun 14, 2019 7:56 pm
Roy, I'm using a fresh git build, but when I edit your sketch the constrained edges cannot be adjusted in length, or they shrink to 0 length.
Did you compile yourself? What OS?

Here it works as expected.
- If the length of the lower line is between 100 and 200 the upper line gets he same length.
- If the length of the lower line is below 100 then the upper line getsa length of 100.
- If the length of the lower line above 200 the upper line gets a length of 200.

OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16933 (Git)
Build type: Release
Branch: master
Hash: 4494d384a6b7e183dd4ae12baadfcf6972039c45
Python version: 3.7.3
Qt version: 5.9.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Germany (en_DE)