Sketcher - Keeping shape features when applying a constraint
Forum rules
and Helpful information
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!
Also, be nice to others! Read the FreeCAD code of conduct!
Sketcher - Keeping shape features when applying a constraint
I do not know if it's my usage error or a limitation of FreeCAD.
Here's a tiny example.
I built a basic shape (meant to be extruded to a slotted bar). After applying the width constraint the shape is deformed to kind of a staircase.
Tried with FreeCAD 0.14 git.
-- Itai
Here's a tiny example.
I built a basic shape (meant to be extruded to a slotted bar). After applying the width constraint the shape is deformed to kind of a staircase.
Tried with FreeCAD 0.14 git.
-- Itai
Re: Sketcher - Keeping shape features when applying a constraint
Hi
Move the width constraint
Move the width constraint
sorry for my outrageous English, but I have a bad excuse
Re: Sketcher - Keeping shape features when applying a constraint
Probably the solver acting up, I get the same result on FreeCAD 0.13.1828 on Windows 7.nahshon wrote:I do not know if it's my usage error or a limitation of FreeCAD.
If you drag the right corner of your rectangle nearer to the intended dimension before applying it, then the slot does not switch direction when you input 30mm.
Re: Sketcher - Keeping shape features when applying a constraint
this in an acknowledged issue there is a bug report about sketches with multiple solutions. Not so easy to solve. Changing the datum value in small steps from its original value is a workaround.
Re: Sketcher - Keeping shape features when applying a constraint
IMO the self-diagnosis function of the sketcher is wrong. If you open the sketch it says that it has 1 degree of freedom. But look at all the parallel constraints, they are all totally unnecessary because if you already say that two lines must be vertical then a parallelism between them is automatically achieved. The self-diagnosis tool, however, subtracts these three unneeded constraints from the actual degrees of freedom and thus you cannot set the really required constraints any more.
So, delete the three parallel constraints and you are fine. You have to set three further length constraints 1x30mm and 2x10mm.
So, delete the three parallel constraints and you are fine. You have to set three further length constraints 1x30mm and 2x10mm.
Re: Sketcher - Keeping shape features when applying a constraint
@wmayer, no the self-diagnostics of the sketcher are slow but quite reliable, there are no parallel constraints, they are equal length constraints.
Re: Sketcher - Keeping shape features when applying a constraint
The order in which you apply Constraints matters. First you need to apply the Equality Constraint to the top and bottom lines, then apply a Length Constraint to one of these lines, otherwise the stairstep shape is a valid solution to your sketch given the applied Constraints.
This solves your problem but when I add a length constraint to the top horizontal line (or the bottom horizontal line) FreeCAD says the sketch is fully constrained. I think this is behavior is wrong because:
1. Given only the original constraints a stairstep sketch (where the bottom horizontal line is longer than the top line) IS a valid solution (until we tell FreeCAD that the top and bottom lines are equal length by applying the Equality Constraint).
2. Similarly given only the original constraints a kind of upside-down stairstep sketch (where the top horizontal line is longer than the bottom line) is also a valid solution, again until we apply the Equality Constraint to the top and bottom lines.
3. Given only the original constraints another valid solution exists where instead of a notch on the right of the sketch there would be a square ridge protruding there. The three vertical lines on the right are still equal lengths by Equality Constraints 17 and 18, and the two horizontal lines on the right are still the same length by Equality Constraint 19.
Comments?
This solves your problem but when I add a length constraint to the top horizontal line (or the bottom horizontal line) FreeCAD says the sketch is fully constrained. I think this is behavior is wrong because:
1. Given only the original constraints a stairstep sketch (where the bottom horizontal line is longer than the top line) IS a valid solution (until we tell FreeCAD that the top and bottom lines are equal length by applying the Equality Constraint).
2. Similarly given only the original constraints a kind of upside-down stairstep sketch (where the top horizontal line is longer than the bottom line) is also a valid solution, again until we apply the Equality Constraint to the top and bottom lines.
3. Given only the original constraints another valid solution exists where instead of a notch on the right of the sketch there would be a square ridge protruding there. The three vertical lines on the right are still equal lengths by Equality Constraints 17 and 18, and the two horizontal lines on the right are still the same length by Equality Constraint 19.
Comments?
Last edited by bejant on Sat Aug 31, 2013 4:59 pm, edited 1 time in total.
Re: Sketcher - Keeping shape features when applying a constraint
I would not say it's a limitation because it's usually fixable with changing the constraint value or to set constraints a bit differently. Undo is your friend here to go back one step and try to rethink the situation. I experience this every now and then when doing sketches but never was in situation i couldn't fix it with few mouse clicks:
viewtopic.php?f=3&t=4300
If it's a bug? Developers would probably need to rethink how to get more predictable results in this situations but probably easier said then done.
viewtopic.php?f=3&t=4300
If it's a bug? Developers would probably need to rethink how to get more predictable results in this situations but probably easier said then done.
Re: Sketcher - Keeping shape features when applying a constraint
Thanks for all the answers!
I am looking at a wider problem - what's required in order to be able to achieve tru-parametric design.
As a case study I have made this little box (design with FreeCAD to production on a CNC router):
I would like to be able to assign external values to constraints (Width, Length, Hight, Material thickness etc...). Sketches should get resolved when an external value is changed.
Apparently the sketch resolver is not quite ready for that.
-- Itai
I am looking at a wider problem - what's required in order to be able to achieve tru-parametric design.
As a case study I have made this little box (design with FreeCAD to production on a CNC router):
I would like to be able to assign external values to constraints (Width, Length, Hight, Material thickness etc...). Sketches should get resolved when an external value is changed.
Apparently the sketch resolver is not quite ready for that.
-- Itai
Re: Sketcher - Keeping shape features when applying a constraint
If that would not be achievable i would agree but as i said sometimes you just have to rethink how to place constraints or to test how constraint behave when changing value and what "resets it" to the correct position/design. I usually increase/decrease value of troublesome constraint substantially to see what is happening on the screen and how to get to the right result.Apparently the sketch resolver is not quite ready for that.
I am not sure if this is possible ATM to control individual constraint inside sketcher from external reference. I was thinking about this when spreadsheet landed and i saw potential for exactly this use case scenarios. For now you will probably have to create individual sketch and control everything from the sketch itself. This would probably work OK for your example.I would like to be able to assign external values to constraints (Width, Length, Hight, Material thickness etc...).