I've spent a couple hours trying to find out why my fairly simple design of a parametric retro joystick is getting screwed-up when recalculating dimensions, but only SOMETIMES and I'm not sure if it's something I'm doing wrong or if it's a bug.
To recreate this bug, go to the dynamic data table (just named 'dd'), and change Base Length to 250mm. Then change Base Width to 250mm. Finally, change Base Width to 100mm. The fully constrained sketch called 'Screw Posts' in the Bottom Box body gets messed-up, but I'm not sure why. If you change Base Length to 250mm, then directly change Base Width to 100mm, it seems to work. And many combinations of changing these parameters make the recalculation work fine. Here are the parameters:
Here's what the sketch of the screw posts looks like normally:
And here's what it looks like when the recalculations screw up:
It's just sometimes, for reasons I can't quite figure out, the calculations break when you change the parameters in a certain order. It seems maybe that the arcs get resolved differently sometimes and are still 'valid' according to constraints, but they're obviously messed-up. Hopefully, someone can shed some light on why. I've attached the project file.
I'm using the latest weekly, but I tried this in latest realthunder branch and it did the same thing, so it might be sketcher related.
OS: macOS 10.15
Word size of FreeCAD: 64-bit
Version: 0.20.25645 (Git)
Build type: Release
Branch: master
Hash: 37d9757399b4c2ec30318eb88d7cd7c508246345
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: C/Default (C)
Constrained Arcs Getting Screwy on Recalculations
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!
Constrained Arcs Getting Screwy on Recalculations
- Attachments
-
- Retro Joystick 2 Button_v4.FCStd
- (684.99 KiB) Downloaded 30 times
- Shalmeneser
- Veteran
- Posts: 9474
- Joined: Wed Dec 23, 2020 12:04 am
- Location: Fr
Re: Constrained Arcs Getting Screwy on Recalculations
Sketch solver can do weird things when you really change a dimension.
Try to be gentle with your modifications, doing them gradually.
Try to be gentle with your modifications, doing them gradually.
Re: Constrained Arcs Getting Screwy on Recalculations
But what do you mean by doing them gradually though? What I'm doing seems to be a pretty basic use of parametric modeling, where I'm changing width and length of the model. Granted, those width and length dimensions are used to calculate some other dimensions, to keep everything proper. But I don't think I'm doing anything really outlandish here. In fact, if you look at the sketch itself, it's very simple and only on dimension gets changed at a time. Add to this that it works in some cases, and then inexplicably the solver breaks... I'm trying to understand if it's a bug or if it has something to do with the way I'm constraining the sketch.Shalmeneser wrote: ↑Sat Sep 18, 2021 9:05 pm Sketch solver can do weird things when you really change a dimension.
Try to be gentle with your modifications, doing them gradually.
Re: Constrained Arcs Getting Screwy on Recalculations
The solver doesn't break: all constraints are still fulfilled. But there are several - different - solution to the set of constraints. "Changing gradually" means to change such values rather in multiple small steps than in a single big one.
There are some techniques to improve things, e.g. by using angle constraints or expressions.
There are some techniques to improve things, e.g. by using angle constraints or expressions.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Constrained Arcs Getting Screwy on Recalculations
In this case you could do something like this and calculate the vertical position of the big arc's center.
- Attachments
-
- RetroJoystick_cb.FCStd
- (49.53 KiB) Downloaded 30 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.