View Issue Details

IDProjectCategoryView StatusLast Update
0001874SketcherBugpublic2014-12-23 14:50
Reportercleahcim Assigned Towmayer  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformPCOSWindowsOS Version8
Product Version0.14 
Summary0001874: Scripted constraints not evaluated correctly.
DescriptionScripted constraints are not properly solved for until the user physically adds a Part geometry to the sketch through the gui.
Steps To Reproduce* Open a new document in freecad
* copy and paste into the console the example code from: https://github.com/FreeCAD/FreeCAD_sf_m ... Example.py
* notice that the two lines do not have horizontal constraints applied.
* Edit sketch and add a point or other geometry to the sketch.
* notice the constraints are applied.
Additional InformationOnce a user has added a geometry to the sketch all scripted constraints are evaluated correctly.

OS: Windows
Word size: 64-bit
Version: 0.14.3700 (Git)
Branch: releases/FreeCAD-0-14
Hash: 32f5aae0a64333ec8d5d160dbc46e690510c8fe1
Python version: 2.7.6
Qt version: 4.8.5
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.6.0
TagsNo tags attached.
FreeCAD Information

Activities

wmayer

2014-12-23 12:49

administrator   ~0005435

The link above is broken: it's https://github.com/FreeCAD/FreeCAD_sf_master/blob/master/src/Mod/Sketcher/SketcherExample.py

wmayer

2014-12-23 13:50

administrator   ~0005436

The problem is the way how geometry is added to the sketch. Although, doing it this way is pythonic but it doesn't update internal data structures and that's why the constraints cannot be applied.

For now the method addGeometry should be used, instead.

# add geometry to the sketch
f.addGeometry([Line(Vector(0,0,0),Vector(2,20,0)),Line(Vector(0,0,0),Vector(20,2,0))])

Related Changesets

FreeCAD: master 3fa8a1ed

2014-12-23 15:32:03

wmayer

Details Diff
+ fixes 0001874: Scripted constraints not evaluated correctly Affected Issues
0001874
mod - src/Mod/Part/App/Part2DObject.cpp Diff File
mod - src/Mod/Part/App/Part2DObject.h Diff File
mod - src/Mod/Part/App/PropertyGeometryList.cpp Diff File
mod - src/Mod/Part/App/PropertyGeometryList.h Diff File
mod - src/Mod/Part/App/PropertyTopoShape.h Diff File
mod - src/Mod/Sketcher/App/SketchObject.cpp Diff File
mod - src/Mod/Sketcher/App/SketchObject.h Diff File

Issue History

Date Modified Username Field Change
2014-12-23 03:37 cleahcim New Issue
2014-12-23 12:49 wmayer Note Added: 0005435
2014-12-23 12:49 wmayer Status new => confirmed
2014-12-23 13:50 wmayer Note Added: 0005436
2014-12-23 14:50 wmayer Changeset attached => FreeCAD Master master 3fa8a1ed
2014-12-23 14:50 wmayer Assigned To => wmayer
2014-12-23 14:50 wmayer Status confirmed => closed
2014-12-23 14:50 wmayer Resolution open => fixed