Problem with constraints based sketcher
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!
-
- Posts: 15
- Joined: Sun Aug 23, 2020 12:50 pm
Problem with constraints based sketcher
It seems sketcher can't tell left from right (and top to bottom etc).
Attached is file where changing the spreadsheet value of square_width from 10 to 50 lets say leads to a completely different drawing.
The constraints can be redone to avoid this as a work around.
e.g. instead of making the outer border 1mm from inner border, it could be made 6mm from center for example.
But this failure of constraints needs addressing at some stage (probably).
Attached is file where changing the spreadsheet value of square_width from 10 to 50 lets say leads to a completely different drawing.
The constraints can be redone to avoid this as a work around.
e.g. instead of making the outer border 1mm from inner border, it could be made 6mm from center for example.
But this failure of constraints needs addressing at some stage (probably).
- Attachments
-
- test_constraints.FCStd
- (6.11 KiB) Downloaded 27 times
Re: Problem with constraints based sketcher
Please post what version of FreeCAD you're using. See About.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Problem with constraints based sketcher
Your first post, welcome to FreeCAD.
Always include your FreeCAD version data in the manner explained in the forum rules link above, and test in the development version.
I have not yet looked at your file, but I think this might be another example of a known limitation, if so, your file may be useful for testing any related improvements in the future.
I moved this topic to this forum. Please read and follow the bug submission guide lines above.
Always include your FreeCAD version data in the manner explained in the forum rules link above, and test in the development version.
I have not yet looked at your file, but I think this might be another example of a known limitation, if so, your file may be useful for testing any related improvements in the future.
- papyblaise
- Veteran
- Posts: 8002
- Joined: Thu Jun 13, 2019 4:28 pm
- Location: France
Re: Problem with constraints based sketcher
it is a rare case where the direction of the constraint is not controlled, it is positive by default, and the negative is not valid
This does not seem to be possible to correct, except maybe in Australia where you walk with your feet to the ceiling
The only solution is to constraint from the axis OX or OY
This does not seem to be possible to correct, except maybe in Australia where you walk with your feet to the ceiling
The only solution is to constraint from the axis OX or OY
Re: Problem with constraints based sketcher
Although this is not the solution you wanted or expected, it is still technically a valid soliution. This issue shows up using the DogLeg and the BFGS solvers but not the LevenbergMarquardt solver.
Abdullah might be interested in this file for solver testing. I have sent him a message to find out.
Also to make a more robust sketch you could just use two horizontal distance constraints, one on an edge of each square, then you have defined the inner square so add the same expression that you did to read its value from the spreadsheet, but for the outer square just use an expression that reads the inner square value then adds twice the border distance value, the Expression would be "Spreadsheet.border_distance * 2 + Spreadsheet.square_width"
OS: Ubuntu 18.04.5 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: 1cad17c5f59883cf8f07855cecab350d93a25c30
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Australia (en_AU)
Abdullah might be interested in this file for solver testing. I have sent him a message to find out.
Yes, there are several other ways you could constrain this and in this specific example you could have created this sketch more efficiently as well. For example since in this case both squares are centred on origin, you could have just applied the symmetry constraint between diagonally opposed corners and origin, that way this would also work with rectangles and you would have only needed on symmetry constraint on the outer square. You also don't need any of the construction lines if you simply used another symmetry constraint on diagonally opposed corners of the smaller square as well. Distance constraint can be applied between two points on the end of lines without a construction line.Hypercube3D wrote: ↑Sun Aug 23, 2020 12:59 pm The constraints can be redone to avoid this as a work around.
e.g. instead of making the outer border 1mm from inner border, it could be made 6mm from center for example.
Also to make a more robust sketch you could just use two horizontal distance constraints, one on an edge of each square, then you have defined the inner square so add the same expression that you did to read its value from the spreadsheet, but for the outer square just use an expression that reads the inner square value then adds twice the border distance value, the Expression would be "Spreadsheet.border_distance * 2 + Spreadsheet.square_width"
OS: Ubuntu 18.04.5 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: 1cad17c5f59883cf8f07855cecab350d93a25c30
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Australia (en_AU)
Re: Problem with constraints based sketcher
Just using that to define the lager square edge length solved the original issue even with using the DogLeg solver. However this is a more efficient way to model the same thing.
Re: Problem with constraints based sketcher
abdullah wrote: pinged by pinger macro
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Problem with constraints based sketcher
Ok. Let's make a bug category (tag = "flipping" or "jumping" or "solver can tell right from left") in the bugtracker. This way it will be possible in the future to investigate and test improvements.jmaustpc wrote: ↑Sun Aug 23, 2020 4:01 pm Although this is not the solution you wanted or expected, it is still technically a valid soliution. This issue shows up using the DogLeg and the BFGS solvers but not the LevenbergMarquardt solver.
Abdullah might be interested in this file for solver testing. I have sent him a message to find out.
Re: Problem with constraints based sketcher
I wouldn't create a new category, but we may add links to one of the existing tickets, e.g. issue #4279. They are all closed though, because flipping is not considered to be a bug.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
-
- Posts: 196
- Joined: Tue Jul 28, 2020 7:31 am
Re: Problem with constraints based sketcher
Have the same problem as mentioned in the head-post.
Faced this problem on Win/Lin 0.19_0pre from 2020.05 till now: after changing a value in spreadsheet, (or rarely in dd-object) - face a flip-direction in sketches and a2Plus assembles. Sometimes faced a complete break of a sketch if based on shape binder and/or external geometry..
The last time - faced today on
OS: Ubuntu 18.04.4 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release (#daily-ppa)
Branch: unknown
Hash: 0cf8279f00017ed2913e0c17beda77c733f98350
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Faced this problem on Win/Lin 0.19_0pre from 2020.05 till now: after changing a value in spreadsheet, (or rarely in dd-object) - face a flip-direction in sketches and a2Plus assembles. Sometimes faced a complete break of a sketch if based on shape binder and/or external geometry..
The last time - faced today on
OS: Ubuntu 18.04.4 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release (#daily-ppa)
Branch: unknown
Hash: 0cf8279f00017ed2913e0c17beda77c733f98350
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)