External links breaking and naming bug

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!
Jens
Posts: 5
Joined: Thu Apr 14, 2016 8:40 pm

External links breaking and naming bug

Post by Jens »

Version 0.18 13648 (Git)
Ubuntu 18.04 LTS, 64 bit

I have been using Freecad for a while now but mostly for simple objects that I am 3D printing. I recently started on a bit more of an involved project and things have gone pretty much pear shaped and I do not know how to work around the issue.

I did have issues with some forking and I did a complete rebuild that had a pretty straight dependency graph and I thought I had things under control. I waited to do all my linear and multi transforms until the end and the dependency diagram obviously became much wider but everything seemed fine.

I 3d printed my model and found that some dimensions needed minor adjustments Less than 4 mm each). Note that I am talking dimensions and no structural modifications were done and no sketches added!

I have read that people advise not to use external references and only use datums but the whole idea of a parametric package is that you can change a dimensional value someplace and the modification cascades through the entire model. The way I understand things, a datum doesn't change, ever .... (please correct me if I am wrong!)... so if I change one dimension and a subsequent feature uses something that is derived from the dimension that was changed, nothing down the line changes and I have to search through the entire build tree and modify everything myself.

I have also tried to understand the concept of the 'tip' in Freecad, hoping it might avoid me forking things by mistake but so far I have not managed to lift the heavy fog that surrounds the 'tip' concept.

I am sorry, I am rambling! As I said, I designed the model, 3D printed it and now I want to change a dimension. I have a 2 mm extrusion on top of a flat surface the bottom of a box). It currently has a 1mm deep slot in it. I want to increase the depth of that slot to 4 mm which means it goes through my extrusion and carves out a bit of the underlying surface. Seems harmless enough but this is where everything goes to pot. Another, completely unrelated feature on a different surface looses it's planar attachment and a second completely unrelated feature shows an error that I am unable to determine the cause of.

From this point on, it's a big cascade of errors as I try to restore links which runs into more issues with the internal naming bug. BTW, is there any thought when this might get fixed ? I read that it's being worked on.

My procedure here is to delete the feature and then map the sketch to the correct face but of course now we are establishing new links and the naming bug explodes. We also add all this to the end of the build tree. I suppose I could move the tip first but since I still haven't grasped the concept thoroughly, I haven't been doing that.

BTW, at this point an additional sketch is corrupted and the only way to recover it is to delete all external references and by the time those are fixed, more stuff breaks.

I also get a situation when stuff breaks but the build tree shows no errors!

The take-home from this is that if you can build the model from the ground up without any changes, you are golden. Pretty much useless unless you are willing to do several complete ground-up redesigns.

My questions:

1) is there hope to have the naming bug fixed within the foreseeable future ? What is the timeline on that (guess is fine)

2) is there anything I can do in a situation like this to be able to change my model or do I need to delete all features while saving the sketches and start mapping sketches to faces starting from the beginning?

3) when a sketch becomes un-editable, is deleting all external references the only way of recovering ? Clicking on 'fix' after you have found that external references are broken has never ever resulted in the ability to edit the sketch.

4) are there any references or tutorials for 'tip' and the concept around it ?

5) am I doing anything fundamentally wrong ?

My Freecad file is 1.4 Mb so too big to attach but I will try to simplify it so that I can post it.
Ok, I deleted some bits ... to reproduce the start of the cascade failure, change the depth of 'slot in pcb holder' from 2 mm to 4 mm
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: External links breaking and naming bug

Post by chrisb »

Jens wrote: Mon Jul 23, 2018 3:10 am 1) is there hope to have the naming bug fixed within the foreseeable future ? What is the timeline on that (guess is fine)
There are improvements in the queue, realthunder provides an Appimage for tests. I would hope to have it in master for the 0.18 release which is due end of the year.
2) is there anything I can do in a situation like this to be able to change my model or do I need to delete all features while saving the sketches and start mapping sketches to faces starting from the beginning?
I think it's the latter you have to do. But you can improve things a huge lot. If you don't attach sketches to faces. See the recommendations on stable models in the documentation of PartDesign Workbench based on Normand's expierience.
3) when a sketch becomes un-editable, is deleting all external references the only way of recovering ?
usually yes.
4) are there any references or tutorials for 'tip' and the concept around it ?
https://www.freecadweb.org/wiki/PartDes ... Management
5) am I doing anything fundamentally wrong ?
See above: stop mapping sketches to faces.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Jens
Posts: 5
Joined: Thu Apr 14, 2016 8:40 pm

Re: External links breaking and naming bug

Post by Jens »

Thank you for the reply - good news about the naming issues !!!
Regarding not mapping things to faces .... am I mistaken on the concept of datums never moving ?
Let's suppose that instead of mapping a sketch to a face, I instead make a datum plane and attach the sketch to it. Now suppose the original face that I was going to sketch on recedes a bit meaning the datum plane I built is no longer touching that face. My understanding is that since one is not mapped to the other, the feature built on the datum plane never adapts to the slightly changed position of the face it was originally going to be mapped to. In other words, in order to keep things correct I would now have to manually move the datum plane to the new position in order for the stuff that is mapped to the datum plane to match up to the underlying (slightly changed) face.
Whew, that is a mouth full ... hopefully that makes sense ...

Is my understanding correct or is there a way to make whatever is sketched on the datum plane to automatically follow the changes that were done to the underlying face?
Bance
Veteran
Posts: 4256
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: External links breaking and naming bug

Post by Bance »

You can use https://www.freecadweb.org/wiki/Expressions along with a master sketch approach...

Have a look at this tutorial https://www.youtube.com/watch?v=8Bmcgn2RBGI

HTH Steve
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: External links breaking and naming bug

Post by chrisb »

Jens wrote: Mon Jul 23, 2018 4:24 am Regarding not mapping things to faces .... am I mistaken on the concept of datums never moving ?
The trick is to reference Sketches.
Can you upload your model to a public fileserver (please without any registrations for downloaders).
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Jens
Posts: 5
Joined: Thu Apr 14, 2016 8:40 pm

Re: External links breaking and naming bug

Post by Jens »

The trick is to reference Sketches.
Can you upload your model to a public fileserver (please without any registrations for downloaders).

I attempted to attach it (in my original post) and received an error.

... ah, adjusted the 'no script' rules and this looks better ... let's see if it comes through

Please tell me more about this trick .....
Attachments
test6-modified.fcstd
(855.25 KiB) Downloaded 39 times
User avatar
HarryGeier
Veteran
Posts: 1231
Joined: Mon Jul 10, 2017 12:36 pm
Location: Hof Germany

Re: External links breaking and naming bug

Post by HarryGeier »

jens,

there is no real "trick" . What he means is, as i showed in the mentioned video. You can and SHOULD reference to elements from a previous SKETCH ( must be visible obviously ) inside the body ( or via shapebinder from other bodies ) and NOT reference to edges or faces from the FEATURE it created... as long as this is feasible. Sometimes you still may need to reference to an element that is created by a feature, for instance an intersection .

So.. from my experience i would :

1: refer to a table or to a master sketch via named constraints.
2: refer to the same via external geometry ( probably needing a shapebinder across body boundaries)
3: refer to datum geometry which is derived from master sketch entites
4: refer to datum geometry which is derived from feature edges
5: refer to feature edges as last resort

( maybe there is even something inbetween i forgot to mention ...i think named objects is also possible somehow)

Unfortunately the best way..#1 , is the least known and most complicated.. until you watch my videos about that ...

There is an english and a german video on my channel where is show these "tricks" easy to understand...
Kaum macht man´s richtig , gehts´s
My Video Tutorials on Youtube: https://www.youtube.com/channel/UCoe3B ... p8Q/videos
My FreeCAD Stuff on Hidrive: https://my.hidrive.com/share/qr3l1yddy6#$/
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: External links breaking and naming bug

Post by chrisb »

Jens wrote: Mon Jul 23, 2018 6:27 am Please tell me more about this trick .....
I will lead you through remapping rabbet_around_edge001, but before doing so, you should repair your sketches (I checked only the first two):
- powerbar_case: symmetry and equalities imply vertical and equality constraint at the right, remove them.
- rabbet_around_edge001: The symmetries imply the horizontal / vertical constraint. Delete the latter.
  • Remap the sketch to the XY plane (flat face). It is now in the wrong plane.
  • Offset it to the top of the box. In the property tab set the z value of the attachment offset to an expression. You cannot set it in the dialog, no expressions allowed there. The expression is Pad.Length
  • Edit the sketch and make everything invisible except the very first sketch "powerbar case".
  • Remove the measures
  • Create an external reference to one of the horizontal lines of the sketch
  • Apply a vertical distance of 2mm and a point-on-line constraint to fix the horizontal distance.
Your Sketch is now fully constrained and has the same layout as before, but it depends only on things that don't break as long as you don't add edges to the sketch.

Continue like this with the other sketches, things are easier, if they don't need an offset.

I upload the file with the two modified sketches.
Attachments
test6-modified_cb.fcstd
(658.47 KiB) Downloaded 49 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: External links breaking and naming bug

Post by GeneFC »

Jens wrote: Mon Jul 23, 2018 3:10 am As I said, I designed the model, 3D printed it and now I want to change a dimension. I have a 2 mm extrusion on top of a flat surface the bottom of a box). It currently has a 1mm deep slot in it. I want to increase the depth of that slot to 4 mm which means it goes through my extrusion and carves out a bit of the underlying surface. Seems harmless enough but this is where everything goes to pot.
The quick and easy fix in this case is to Edit > Duplicate the slot sketch, *without* dependencies. The duplicated sketch will show up at the end of the model tree. Then reapply the pocket operation to the depth you want.

This is a kludge, non-parametric, immoral, fattening, and everything else evil, but it works. :lol:

Workarounds are a way of life for many complex operations.

If you expect more changes, or if you want a timeless universal model, then the careful application of the principles stated above is the only way to go.

Gene
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: External links breaking and naming bug

Post by NormandC »

GeneFC wrote: Mon Jul 23, 2018 2:57 pm If you expect more changes, or if you want a timeless universal model, then the careful application of the principles stated above is the only way to go.
Exactly. But even with rigorous modelling methods, one thing that cannot be made more robust is fillets and chamfers; that's why it is best to apply them last in a model (of course there are cases where it's not possible). At least, PartDesign Fillets and Chamfers can be edited in v0.17/v0.18, and new edges can be selected; up to v0.16 this wasn't the case, they had to be deleted and recreated again.

And I would like to point out that all parametric CAD programs are affected by lost or broken links (when mapping sketches to faces, linking external geometry to the solid). At least, the mid-range commercial ones costing in the 5 figures (I use such software at work). Admittedly, FreeCAD is more severely affected by this, and it can be trickier to fix a model.

Off topic, but I noticed that you are using a rather old development version.
Jens wrote: Mon Jul 23, 2018 3:10 am Version 0.18 13648 (Git)
Ubuntu 18.04 LTS, 64 bit
It looks like you have not updated your system in months. The latest revision number is currently 14111. I hope you actually only locked updates to your freecad-daily package. It is highly recommended to keep your Ubuntu system updated with security patches.
Last edited by NormandC on Mon Jul 23, 2018 5:40 pm, edited 2 times in total.
Post Reply