Need help learning correct workflow to prevent dependency hell - changing one thing breaks everything

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
MisterPi
Posts: 3
Joined: Thu Mar 25, 2021 4:24 am
Location: United States

Need help learning correct workflow to prevent dependency hell - changing one thing breaks everything

Post by MisterPi »

I am a Sketchup refugee with only a little experience in F360, Onshape etc... I don't care that FC is different, I want to learn how to use it properly. If there is a tutorial or something which will help me with workflow, please point me to it. I will be eternally grateful.

So: I have noticed that fairly simple models that I create, following to me what seems like a straightforward logical workflow, end up in a terrible mess of dependencies so that I cannot go back up the tree and change something without breaking everything that I drew after.
Note: I use PartDesign almost exclusively. I like it and it makes sense (or will soon I hope).

1) Here is the "completed" model in which I discovered an error after 3D printing it.
dependency01.png
dependency01.png (758.21 KiB) Viewed 848 times
2) I came to the conclusion that I was in dependency hell when I selected the last feature I added (latch easement chamfer) and right-clicked and added all dependent elements to the selection - everything. Question 1: Is that correct?
dependency02.png
dependency02.png (668.74 KiB) Viewed 848 times
3) The element I want to change is the side chamfers (blue arrow). I want to delete them but I get the error message that doing so will break the latch easement chamfer (red arrow). If I do, it does and I undo like a madman.
dependency03.png
dependency03.png (819.64 KiB) Viewed 848 times
4) The sides and back are a padded sketch, the original on the right, modified on the left.
dependency04-05.png
dependency04-05.png (100.14 KiB) Viewed 848 times
5) If I try and modify as on the left, it so I can pad it again, like below, I get the errors below.


Errors I get:

Code: Select all

19:35:11  Sketch Sketch011 has malformed constraints!
19:35:11  Recompute failed! Please check report view.
19:35:11  Delete: Selection not restricted to one sketch and its subelements
Interestingly, I copied the errors out of the report view and there isn't any additional information that would lead me to a resolution.

The big issue for me is that there must be some workflow that I occasionally get correct - by accident - but in this case not.

Is there a learning resource to help with correct workflow and how to build a model such that changing something doesn't break everything? Pointers welcome.

Thanks.

--Jeff
The file:
COM Holder V2A.FCStd
(296.71 KiB) Downloaded 11 times

Code: Select all

OS: macOS Mojave (10.14)
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git)
Build type: Release
Branch: (HEAD detached at 0.20)
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.9.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: C/Default (C)
Installed mods: 
  * fasteners 0.4.23
  * Assembly4 0.12.4
chrisb
Veteran
Posts: 54195
Joined: Tue Mar 17, 2015 9:14 am

Re: Need help learning correct workflow to prevent dependency hell - changing one thing breaks everything

Post by chrisb »

Hi and welcome to the forum!

Let me first say, that this is a great first post with images, FreeCAD file, FreeCAD infos.

Concerning your points:
1) I almost always discover errors after printing :) .
2) What is the problem? What do you want to achieve? Concerning dependencies the Dependency Graph may be of interest.
3)-5) You got trapped by the topological naming problem. You made it all worse by referencing generated geometry, e.g. by attaching sketches to faces.

Chamfers remain a problem as they are always using generated edges. That's why I recommend to use them as early as possible in the modeling process. I am well aware that others advocate what you did, and what resembles the manufacturing process e.g. in milling: to ad them last.
You could at least for the side chamfers avoid all troubles by replacing them with a pocket.

Let me know if you are interested in some more comments concerning your sketching.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
MisterPi
Posts: 3
Joined: Thu Mar 25, 2021 4:24 am
Location: United States

Re: Need help learning correct workflow to prevent dependency hell - changing one thing breaks everything

Post by MisterPi »

Thanks for the compliments. I have been lurking for a long while and learned a few things. Plus, one of my jobs is technical support documentation and I learned that more is always better than less. Plus, I too hate it when someone has a problem with which I can probably help and I can pry no more than "thing broke" out of them. A lot of my job is dealing with that too.

I would love some pointers on sketching and a link to a Best Practices tutorial. I have read in other posts that attaching a sketch to a plane surface (like a pad) can quickly run afoul of the TNC evil spirit.

What is the problem? I discovered a dimensioning error after printing because I based this design off an old (and incorrect) Sketchup model. I wanted to modify the sides to look like this:
dependency06.png
dependency06.png (114.08 KiB) Viewed 702 times
as a first step in achieving this:
dependency07.png
dependency07.png (132.11 KiB) Viewed 702 times
I ended up putting a pocket to remove the corner and then added chamfers because I love chamfers.

In a properly constructed model I should have been able to do that by by changing the lengths of the long sides which are referenced to the underlying pad (a bad idea I understand). When I tried that, everything broke and I had to backtrack.
dependency08.png
dependency08.png (46.39 KiB) Viewed 702 times
As I said, any pointers would be most welcome.

Thanks!
freedman
Veteran
Posts: 3465
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Need help learning correct workflow to prevent dependency hell - changing one thing breaks everything

Post by freedman »

I cut off the slopes with a pocket and set Refine to True to remove the lines. I beveled the ends with another pocket. Both of the sketches are bases off of standard planes.
Attachments
COM Holder V3A.FCStd
(466.08 KiB) Downloaded 8 times
com.png
com.png (127.03 KiB) Viewed 659 times
chrisb
Veteran
Posts: 54195
Joined: Tue Mar 17, 2015 9:14 am

Re: Need help learning correct workflow to prevent dependency hell - changing one thing breaks everything

Post by chrisb »

MisterPi wrote: Thu Dec 08, 2022 12:32 am I would love some pointers on sketching and a link to a Best Practices tutorial.
I like of course to recommend the document linked in my signature, but it is more about the basics than best practices.

If you want a sketch to revela its intrinsic geometric structure, it is usually a good idea to minimize the number of dimensional constraints.

Let's take as example the sketch from your image above:
SnipScreenshot-bae888.png
SnipScreenshot-bae888.png (20.36 KiB) Viewed 593 times
This sketch tells me, that you have three walls and they have currently all the same thickness. Because I can change any of them individually it can also mean that just in this case they happen to be identical, but under different circumstances different thickness could well be possible.

If you look at this sketch ...
SnipScreenshot-aef352.png
SnipScreenshot-aef352.png (18.31 KiB) Viewed 593 times
...it is absolutely clear, that the walls should be equal.

Things are even more significant in sketch DIN screw holes:
SnipScreenshot-bb5eae.png
SnipScreenshot-bb5eae.png (45.35 KiB) Viewed 593 times
You have 27 constraints, 12 being datums. If I understand it well, you get away with far less datum constraints, but here is something else to consider:
You should think very carefully about where you place your object. If it is symmetric, use symmetry around the origin!
I have to leave now, you can rework your model on your own or wait until tonight.

To be continued.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54195
Joined: Tue Mar 17, 2015 9:14 am

Re: Need help learning correct workflow to prevent dependency hell - changing one thing breaks everything

Post by chrisb »

Here we go, starting with the first sketch.
Before refactoring ...
SnipScreenshot-5e8e5e.png
SnipScreenshot-5e8e5e.png (32.58 KiB) Viewed 535 times
... we have 29 constraints, 10 of them being dimensions. After rework there is only slight improvement with 23 constraints and 8 dimensions.
SnipScreenshot-0ad613.png
SnipScreenshot-0ad613.png (31.65 KiB) Viewed 535 times
Now comes one of my favorite tricks, because I want to attach the sketches preferably to the main planes: I invert the pad and let it go down.
SidesAndBack can now be attached directly to XY plane. I have removed unnecessary external references.

And here comes the next trick: sketches for pockets don't need to be placed on a feature, which they are supposed to cut. XZ plane is a much more stable choice here.

This is how "DIN screw holes" looks after rework. There are only 24 constraints with only 13 datums. If I was too strict by saying that 25*2*12.5, then another datum could be introduced:
SnipScreenshot-906ba9.png
SnipScreenshot-906ba9.png (41.34 KiB) Viewed 535 times
Rear clearance should be reworked as well and should be attached to XY plane. That has the advantage that no depth of the pocket has to be taken into account (through all).

SideChamfer is replaced by a pocket. I used an expression here, which might be overkill.

I don't have the font file available, so here is the file for you to finish. You can decide if you want to use the more stable variant with another pocket or if you want to use the chamfer tool
Attachments
COMHolder_cb.FCStd
(300.93 KiB) Downloaded 9 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Shalmeneser
Veteran
Posts: 9558
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Need help learning correct workflow to prevent dependency hell - changing one thing breaks everything

Post by Shalmeneser »

:idea:
Attachments
Capture du 2022-12-08 19-23-39.png
Capture du 2022-12-08 19-23-39.png (38.43 KiB) Viewed 514 times
COM Holder V3A._SHALM.FCStd
(203.66 KiB) Downloaded 10 times
User avatar
MisterPi
Posts: 3
Joined: Thu Mar 25, 2021 4:24 am
Location: United States

Re: Need help learning correct workflow to prevent dependency hell - changing one thing breaks everything

Post by MisterPi »

Wow. Thanks! What a lesson. Clearly there are more ways to skin the modeling cat.

You see, this is exactly what I am looking for: a step-by-step explanation of how not to screw up. I've looked at both of the contributed models and they are both full of ideas on how to do want I want to do -- not just this model but all future models.
All three of you who contributed models or ideas: I thank you.

One big takeaway is to use symmetry whenever possible. Another is make use of construction lines. Perhaps the most important is not to sketch on top of a padded surface - doing so and sneezing will break everything.

@chrisb I downloaded your Sketcher guide and will have a long look at it. As with all complicate fields of human endeavour, it is very easy to learn incorrect ways of doing something that you will need to un-learn at a later date. In my case, I am unlearning Sketchup, a program that is wonderful until you need to modify something. Your model won't break, but you will need to re-draw many parts of it because there are no objects except the model.

I appreciate the time you all took to look at this for me.

Cheers,

--Jeff
Post Reply