[bug] Expression does not recalculate

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
kisolre
Veteran
Posts: 4051
Joined: Wed Nov 21, 2018 1:13 pm

[bug] Expression does not recalculate

Post by kisolre »

Here is another one. In the attached file trying to change the size of Box1x1 by changing corresponding DD parameter (from 15mm to 20mm) results in something strange. The Position.Z expression does not result in valid value but keeps the latest one from opening the file.
.
ExpressionDoesNotRecalculate.gif
ExpressionDoesNotRecalculate.gif (47.61 KiB) Viewed 463 times
.

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.28915 (Git)
Build type: Release
Branch: master
Hash: 7d6243d6961f5c7616b2bcbc844f9abc47eeff9b
Python 3.8.6+, Qt 5.15.2, Coin 4.0.1, OCC 7.5.3
Locale: Bulgarian/Bulgaria (bg_BG)
Installed mods: 
  * 3DfindIT 1.2.0
  * A2plus 0.4.56
  * AirPlaneDesign 0.4.0
  * AnimationFreeCAD 1.0.0
  * ArchTextures
  * Assembly3 0.11.3
  * Assembly4 0.11.12
  * BIM 2021.12.0
  * BOLTSFC
  * CfdOF 1.15.1
  * CubeMenu
  * CurvedShapes 1.0.3
  * Curves 0.3.0
  * CycloidGearBox
  * Defeaturing
  * Design456
  * DesignSPHysics 0.6.1-2201-31-01
  * dodo
  * DynamicData 2.46.0
  * ExplodedAssembly
  * fasteners 0.3.41
  * FCGear 1.0.0
  * FCPDWorkbench 0.2.0
  * FEM_FrontISTR 0.1.0
  * frame
  * freecad.xray 2022.4.17
  * FreeCAD_mcm_addon
  * Help 1.0.0-alpha
  * InvGears 0.1.2
  * kicadStepUpMod 10.12.0
  * lattice2 1.0.0
  * Launcher
  * MakerWorkbench
  * Manipulator 1.4.3
  * Mechatronic
  * MeshRemodel 1.8919.0
  * MnesarcoUtils 0.1.0
  * Nikra-DAP
  * nurbs
  * OpticsWorkbench 1.0.8
  * ose-piping
  * parts_library
  * PlacementTools
  * Plot 2022.4.17
  * Pyramids-and-Polyhedrons
  * Reinforcement
  * Render 2022.1.0
  * Rocket 2.4.1
  * SearchBar 1.0.1
  * SelectorToolbar
  * sheetmetal 0.2.49
  * Ship 2022.4.11
  * Silk
  * SlopedPlanesMacro
  * StemfieWB
  * symbols_library
  * ThreadProfile 1.81.0
  * toSketch
  * Woodworking 1.0.0
  * workfeature
  * workfeature-macro
Attachments
PaperClipBox.FCStd
(134.67 KiB) Downloaded 13 times
User avatar
thomas-neemann
Veteran
Posts: 6285
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE

Re: [bug] Expression does not recalculate

Post by thomas-neemann »

kisolre wrote: Fri May 20, 2022 6:17 pm ...
If I delete this,
Bildschirmfoto_2022-05-20_20-29-33.png
Bildschirmfoto_2022-05-20_20-29-33.png (3.66 KiB) Viewed 451 times
it works for me


OS: Ubuntu 20.04.1 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.28909 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 2084652)
Hash: 20846523c9d8219ec0fe33c499a64e700d2266b6
Python 3.9.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: German/Germany (de_DE)
ich biete freecad online-support an, als mini-job
VHS Freecad Webseminare Herbst 2022
https://www.vhs-lingen.de/programm/beru ... 011#inhalt
https://www.vhs-lingen.de/programm/beru ... 012#inhalt
kisolre
Veteran
Posts: 4051
Joined: Wed Nov 21, 2018 1:13 pm

Re: [bug] Expression does not recalculate

Post by kisolre »

thomas-neemann wrote: Fri May 20, 2022 6:31 pm If I delete this,
It should not matter since it is after the body position and moving the body to proper place should relocate everything to proper places and the fillet will work then.
kisolre
Veteran
Posts: 4051
Joined: Wed Nov 21, 2018 1:13 pm

Re: [bug] Expression does not recalculate

Post by kisolre »

@realthunder, sorry to bother you, but since you mostly worked on expressions recently could you take a look into this?
adrianinsaval
Veteran
Posts: 2680
Joined: Thu Apr 05, 2018 5:15 pm

Re: [bug] Expression does not recalculate

Post by adrianinsaval »

Your "faulty" expression is at the body, bodies have a dependency on all it's children, if one if it's children fails to recompute the body will not be recomputed, I think this is expected behavior, perhaps not desirable though since the rest of the placement values can be manually updated
openBrain
Veteran
Posts: 7882
Joined: Fri Nov 09, 2018 5:38 pm

Re: [bug] Expression does not recalculate

Post by openBrain »

kisolre wrote: Sat May 21, 2022 6:59 am It should not matter since it is after the body position and moving the body to proper place should relocate everything to proper places and the fillet will work then.
:? The fillet is faulty at file opening, even before trying to move the body. ;)
kisolre
Veteran
Posts: 4051
Joined: Wed Nov 21, 2018 1:13 pm

Re: [bug] Expression does not recalculate

Post by kisolre »

So then the Shape of the body should not depend in any way of the placement of the body? Here with the fillet there is a TNP (which is strange since the basic shape of the object should not change with the changed placement). And I cant think of a scenario to brake a body in compatible way.
I tried to change the height in 0.4mm increments (15mm->20mm) it worked.
If the placement was properly recalculated and all steps up to the fillet then the fillet could be fixed. But now there is no valid geometry from which to select. I made a temporary fix to allow the fillet to succeed, placement to properly recalculate and then again fix the fillet...
If this is unfixable in the current state perharps a mention in the docs (like I suspect there is one for the sketch flipping) should be made...

Now when I know what the problem is I can work around it if that happens again somewhere... But that is not the proper way IMHO.
adrianinsaval
Veteran
Posts: 2680
Joined: Thu Apr 05, 2018 5:15 pm

Re: [bug] Expression does not recalculate

Post by adrianinsaval »

how is the fillet affected by the placement?
kisolre
Veteran
Posts: 4051
Joined: Wed Nov 21, 2018 1:13 pm

Re: [bug] Expression does not recalculate

Post by kisolre »

adrianinsaval wrote: Mon May 23, 2022 5:34 pm how is the fillet affected by the placement?
If the body is moved down only the top part of the front wall is cut (place for the lid). But if the body is not moved e slot is formed there instead and so the number of edges changes and so do their names.
Post Reply