Bug: Driving constraints on external geometry and crash

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!
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Bug: Driving constraints on external geometry and crash

Post by chrisb »

When adding a dimension constraint on external geometry they used to be automatically driven (blue). This doesn't work anymore and there are two serious issues with this. I had already observed the crash before, but seem to have missed to create a ticket.

So here we go:

1) Wrong driving constraints
- Edit Sketch001 in the attached file -> you see a normal (red) constraint measuring the external line
(- if you want to add such a constraint, do it by selecting the endpoints)
SnipScreenshot-ae0898.png
SnipScreenshot-ae0898.png (5.34 KiB) Viewed 581 times
- this is not correct, but things get bad, as it is possible to change that constraint:
SnipScreenshot-fa77d1.png
SnipScreenshot-fa77d1.png (4.31 KiB) Viewed 581 times
2) Crash
- Edit Sketch001 in the attached file
- select the external line
- add a horizontal distance constraint
- this is independent from selecting driven or driving constraints

Please test, especially with other OS.

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.21.0.32532 (Git)
Build type: Release
Branch: master
Hash: 20e44eba50e1365b9e7bb9c5c244afe96a627a28
Python 3.10.10, Qt 5.15.8, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: C/Default (C)
Installed mods: 
  * FC_SU
  * DynamicData 2.46.0
  * freecad.gears 1.0.0
  * FeedsAndSpeeds 0.5.0
  * dxf-library
  * fcgear 1.0.0
  * fasteners 0.4.54
  * sheetmetal 0.2.62
  * ExplodedAssembly
  * Curves 0.6.8
Attachments
drivenExternalBug.FCStd
(4.22 KiB) Downloaded 12 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug: Driving constraints on external geometry and crash

Post by chrisb »

I just saw that I get a "Redundant Constraints" solver message when adding more geometry.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Shalmeneser
Veteran
Posts: 9474
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Bug: Driving constraints on external geometry and crash

Post by Shalmeneser »

In 31625
I can modify your red dimension to any value.
But can only create blue dimensions.
No crash

Code: Select all

OS: Linux Mint 20.3 (MATE/mate)
Word size of FreeCAD: 64-bit
Version: 0.21.0.31625 (Git) AppImage
Build type: Release
Branch: master
Hash: 72df7997700062b6a02f2f208e6291f64073fb88
Python 3.10.8, Qt 5.15.6, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: French/France (fr_FR)
Installed mods: 
  * Manipulator 1.4.9
  * fasteners
  * sheetmetal 0.2.57
  * DynamicData 2.46.0
  * fasteners.bak
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Bug: Driving constraints on external geometry and crash

Post by Syres »

Tested on Linux with both the same revision as yours (AppImage) and the most updated master self-compiled and it behaved as expected, set to Reference and no crash. I even had a check of the code and it hasn't changed since 0.20 that I can see.

Just for reference, here's the Python Console output:

Code: Select all

# Gui.runCommand('Sketcher_ConstrainDistanceX',0)
# Gui.Selection.addSelection('Unnamed','Sketch','ExternalEdge1',9.33013,10,0)
App.getDocument('drivenExternalBug').getObject('Sketch001').addConstraint(Sketcher.Constraint('DistanceX',-3,1,-3,2,43.974701))
App.getDocument('drivenExternalBug').getObject('Sketch').setDriving(0,False)

Code: Select all

OS: Linux Mint 20.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.21.0.32532 (Git) AppImage
Build type: Release
Branch: master
Hash: 20e44eba50e1365b9e7bb9c5c244afe96a627a28
Python 3.10.10, Qt 5.15.8, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * Silk 1.0.0
  * A2plus 0.4.60k
  * CurvedShapes 1.0.4
  * MakerWorkbench 1.0.1
  * freecad.gears 1.0.0
  * Curves 0.6.8
  * PieMenu 1.2.4
  * toSketch 1.0.1
  * Plot 2022.4.17
  * AirPlaneDesign 0.4.0
  * fasteners 0.4.54
  * sheetmetal 0.2.63

Code: Select all

OS: Linux Mint 20.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.21.0.32636 (Git)
Build type: Release
Branch: master
Hash: 9666aac669fc4d84985554bc7c3c61e3cdc2c7ab
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, Vtk 7.1.1, OCC 7.7.1
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * Silk 1.0.0
  * A2plus 0.4.60k
  * CurvedShapes 1.0.4
  * MakerWorkbench 1.0.1
  * freecad.gears 1.0.0
  * Curves 0.6.8
  * PieMenu 1.2.4
  * toSketch 1.0.1
  * Plot 2022.4.17
  * AirPlaneDesign 0.4.0
  * fasteners 0.4.54
  * sheetmetal 0.2.63
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug: Driving constraints on external geometry and crash

Post by chrisb »

Syres wrote: Thu Mar 30, 2023 11:09 am I even had a check of the code and it hasn't changed since 0.20 that I can see.
It happens here in 0.20 too; even a bit worse: When I try to create a new driven (blue) dimension on the endpoints, it crashes as well.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Bug: Driving constraints on external geometry and crash

Post by Syres »

chrisb wrote: Thu Mar 30, 2023 1:30 pm It happens here in 0.20 too; even a bit worse: When I try to create a new driven (blue) dimension on the endpoints, it crashes as well.
Windows Conda build is error free. To be honest from a dev point of view it's good that it behaves the same in 0.20 on your system while that doesn't help you in the slightest. I think you need some more Mac users' feedback to get a firm line on where the issue is.

Code: Select all

OS: Windows 7 Version 6.1 (Build 7601: SP 1)
Word size of FreeCAD: 64-bit
Version: 0.21.0.32532 (Git)
Build type: Release
Branch: master
Hash: 20e44eba50e1365b9e7bb9c5c244afe96a627a28
Python 3.8.16, Qt 5.15.8, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * A2plus 0.4.60f
  * Alternate_OpenSCAD 1.0.0
  * Assembly3 0.11.4
  * Assembly4 0.12.6
  * CfdOF 1.20.4
  * Curves 0.6.6
  * fasteners 0.4.54
  * fcgear 1.0.0
  * freecad.xray 2022.4.17
  * FreeCAD_Turning_Addon 0.1.0
  * Help 1.0.3
  * Manipulator 1.5.0
  * PitchedRoof
  * Plot 2022.4.17
  * Render 2023.2.2
  * sheetmetal 0.2.63
  * sheetmetal.backup1680103209.8141618 0.2.62 (Disabled)
  * Silk 1.0.0
  * timber
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug: Driving constraints on external geometry and crash

Post by chrisb »

Syres wrote: Thu Mar 30, 2023 1:54 pm Windows Conda build is error free. To be honest from a dev point of view it's good that it behaves the same in 0.20 on your system while that doesn't help you in the slightest. I think you need some more Mac users' feedback to get a firm line on where the issue is.
@chennes, care to check?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
chennes
Veteran
Posts: 3877
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Bug: Driving constraints on external geometry and crash

Post by chennes »

If I edit the constraint in your file it allows me to set the distance, and doesn't crash (though of course this makes no sense). If I delete your constraint and try to add my own, it is made driven automatically, and cannot be changed to driving, as expected.

Code: Select all

OS: macOS 13.2
Word size of FreeCAD: 64-bit
Version: 0.21.0.31821 (Git)
Build type: Release
Branch: refactorDataSource
Hash: e52f7aac17685e7543200afd46079c1997743a08
Python 3.10.9, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.5, OCC 7.6.3
Locale: English/United States (en_US)
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Bug: Driving constraints on external geometry and crash

Post by openBrain »

There was a topic from @looo about sketcher crash specific to MacOS. Will try to find it.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Bug: Driving constraints on external geometry and crash

Post by adrianinsaval »

can you reproduce on clean config too?
Post Reply