Sketch Loses Shape After Spreadsheet Dim Change

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!
Post Reply
User avatar
ivxcvi
Posts: 18
Joined: Wed Oct 16, 2019 12:31 am

Sketch Loses Shape After Spreadsheet Dim Change

Post by ivxcvi »

Hello,

Currently I'm working on rebuilding this design in FreeCAD.

I've attached the file below. My issue is that when I change dimensions in the spreadsheet, the tabs seemingly randomly become inverted. I've tried different constraints in those locations, but nothing seems to work completely consistently.

I'm wondering if it's a mathematical problem with ratios, or simply my lack of proper constraint awareness.

Thanks so much for any input, it's greatly appreciated.

-----------------------------------------
Storage_Dresser_Horiz.FCStd
Part dims are quite small in order to 3D print before cutting stock.
(20.13 KiB) Downloaded 25 times
chrisb
Veteran
Posts: 54310
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketch Loses Shape After Spreadsheet Dim Change

Post by chrisb »

The flipping cannot always be avoided, but I have some hints in my Sketcher tutorial how to avoid it. These hints are based on the fact that lines are not handled with their directions while angles are.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Willem
Veteran
Posts: 1854
Joined: Fri Aug 12, 2016 3:27 pm
Location: Lisse, The Netherlands

Re: Sketch Loses Shape After Spreadsheet Dim Change

Post by Willem »

My advice to prevent flipping is to change the dimensioning .
In this design I see a dimension "Width" of 38.1 mm and a "Thickness" of 3.175 mm.
Inroduce a Dimension Width-2 and let the spreadsheet calculate 38.1 - 3.175.
Now the Width-2 is a hard dimension and flipping of the 3.175 mm is not possible
Attachments
Storage_Dresser_Willem.FCStd
(21.33 KiB) Downloaded 23 times
mario52
Veteran
Posts: 4701
Joined: Wed May 16, 2012 2:13 pm

Re: Sketch Loses Shape After Spreadsheet Dim Change

Post by mario52 »

Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
ivxcvi
Posts: 18
Joined: Wed Oct 16, 2019 12:31 am

Re: Sketch Loses Shape After Spreadsheet Dim Change

Post by ivxcvi »

Hello,

Thanks for dropping that link, Mario. That's an interesting solution, but I don't think it quite fits my specific application at this time. I appreciate you sharing it, though!

I've incorporated both chrisb's & Willem's suggestions into the new sketch. It seems to be working the way I expect now. I'm pretty sure the angle constraints are what made the difference, but the jury is still out on that.

Please feel free to play around with sizes & let me know if there are any other issues. I'm going to tackle the back & side sketches next.

--------------------------------------
Storage_Dresser_Horiz.FCStd
(20.58 KiB) Downloaded 29 times
User avatar
ivxcvi
Posts: 18
Joined: Wed Oct 16, 2019 12:31 am

Re: Sketch Loses Shape After Spreadsheet Dim Change

Post by ivxcvi »

Hello,

The back sketch is complete. I'll post all 3 after I run some tests & have a final result. Right now I'm having an issue with the design for the side. It's difficult because I want the center slots to be independently adjusted, so I don't think I can mirror it. Right now there seems to be conflicting constraints, or some other problem, because I can't move any of the lines.

Is there a better way to design this shape?

Thanks,

----------------
Storage_Dresser_Side.FCStd
(30.78 KiB) Downloaded 24 times
chrisb
Veteran
Posts: 54310
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketch Loses Shape After Spreadsheet Dim Change

Post by chrisb »

I cannot see any conflicts, and applying further constraints works well. However you used some uncommon constraints: Usually horizontal and vertical constraints are preferred to the 90° angle. Maybe it is these angular constraints which prevent free moving. (I admit that using angles can make sketches more robust against changes in previous steps.)
If you want to dimension a horizontal line, as you did with constraint73 you should prefer the horizontal distance constraint over the length constraint.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
ivxcvi
Posts: 18
Joined: Wed Oct 16, 2019 12:31 am

Re: Sketch Loses Shape After Spreadsheet Dim Change

Post by ivxcvi »

Hi chrisb,

Yes, the 90° constraints were used to keep the shape when dimensions were changed. I will take another look at changing them over & see how the sketch fares when changing sizes.

Constraint73 was set with the Length constraint because it's meant to change both horizontal & vertical lines (tab depth on top, bottom, back & slots).

If anyone has any pointers on how to improve my workflow with this design I'm happy to try them.

----------------------------------------

Spent a little more time on it. I've found that the order in which I add constraints has allowed me to overcome my problem. I removed everything but the coincident & symmetry constraints & started over. I added the equality and horizontal/vertical constraints before I added any datum constraints. I haven't observed how the sketch fares as I adjust dimensions, but it's fully constrained and square. Once I get my 3D printer going again I'll print some test pieces & then it's on to the real thing.

-----------------------------------------

I've created a git repo for all of my design files, which is available here.
Post Reply