View Issue Details

IDProjectCategoryView StatusLast Update
0002729GCSBugpublic2018-06-03 07:57
ReporterChukharev Assigned Tochrisb  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformUnixOSFreeBSDOS Version10.3-STABLE
Product Version0.17 
Summary0002729: False 'redundant constrains' message
DescriptionWhile learning macro facilities of FreeCAD I found a bug. It's currently better to use 'incorrect' sizes for a sketch preliminary shape and use constrains to amend the sizes. With the correct sizes, solver sometimes fails to apply the constrains, falsely complaining about redundant constrains.
Steps To Reproduce0. Save the attached file Attempt_002.FCMacro to the folder for your macros
1. Open FreeCAD
2. Press the "create new document" button
3. Switch to the Part Design workbench
4. Press the "Create Body" link
5. Press the "Create sketch" link
6. Select "YZ_Plane (Base plane)" and press OK button
7. Start editing the saved macro:
 a) Menu Macro -> Macros...
 b) Select Attempt_002.FCMacro and press Edit
8. Run opened macro by pressing Ctrl+F6 (or corresponding button)
9. Verify that in the "Unnamed: 1" tab a fully constrained sketch is created.
10. Select all edges and delete them from the sketch
11. Switch to the tab of macro editing
12. Uncomment the line number 10 and comment out line 11 (they do almost the same)
13. Run opened macro by pressing Ctrl+F6 (or corresponding button)
14. See in Solver messages: Sketch contains redundant constrains...
Additional Information $ uname -a
FreeBSD vovaasus 10.3-STABLE FreeBSD 10.3-STABLE 0000021 r306257: Sat Sep 24 02:05:50 EEST 2016 root@vovaasus:/usr/obj/usr/src/sys/GENERIC amd64

From Help->About FreeCAD:
OS: UNIX
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.Unknown
Build type: Release
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1
TagsSolver
FreeCAD Information

Activities

Chukharev

2016-10-07 21:00

reporter  

Atempt_002.FCMacro (2,079 bytes)

jnxd

2016-10-10 15:22

developer   ~0007354

Works perfectly well here. Both lines lead to fully constrained sketches.

OS: Ubuntu 16.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8614 (Git)
Build type: None
Branch: master
Hash: a50bd5dc880f76c3ba8b7af5bd5d19799db4cbf1
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

Chukharev

2016-10-10 20:03

reporter   ~0007356

A newer version of FreeCAD arrived on FreeBSD too, but it does not change the situation for me. One line produces a fully constrained sketch, the other - over constrained.
The new version is called in FreeBSD terms FreeCAD-0.17.g20160927, and it gives the following info.

OS: UNIX
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.6700
Build type: Release
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1

I do not know how to compare the versions...

normandc

2016-10-15 19:32

manager   ~0007367

The most reliable way to compare FreeCAD versions should be the hash, which refers to the git commit. But your FreeBSD builds do not provide it (see jnxd's FreeCAD info). If the latest build is from 2016-09-27, the version number (0.17) and revision number (6700) do not make sense, because the 0.17 development branch was started *after* the 6700th revision (Git revisions are IDed as hashes, I believe that at compile time there's a script that counts the number of commits to get the revision number). Your FreeCAD info also does not provide the branch it was built from. There is a "releases/FreeCAD-0-16" branch from which your version may be built from, and a master branch which hosts 0.17 development. As it is it is AFAIK impossible to figure out.

I recommend you contact the people responsible for the FreeCAD builds on FreeBSD so they are aware of the missing info provided in their builds. Tell them that the compilation process generates a /src/Version.h file from the /src/Version.h.cmake file. For it to work compilation must be done in a Git repo. They may want to join the forum to ask further details to the FreeCAD developers.

Chukharev

2016-10-16 09:04

reporter   ~0007384

I have asked the maintainer of the FreeBSD port of FreeCAD to join this discussion.

IMNSHO the demand "compilation must be done in a Git repo" is overly restrictive.
It makes any other source distribution than a git fork practically forbidden.
Usually, version control systems allow to automate updating a version number,
directly or using a commit hook. It's hard for me to believe Git does not allow it.

The FreeBSD port contains a line "GH_TAGNAME=958686d". Also, the distfile is named
FreeCAD-FreeCAD-0.17.g20160927-958686d_GH0.tar.gz. My guess is that the tag 958686d
is related to the Git revision hash you are talking about, even though it's much shorter than
shown by the ubuntu build.
Does this info help to compare the versions?

normandc

2016-10-16 15:11

manager   ~0007386

Yes it helps (I think). In theory it should be this commit: https://github.com/FreeCAD/FreeCAD/commit/958686d

The commit dates from 19 days ago which corresponds to the date in the distfile name. So the "6700" revision number is definitely wrong.

Two methods to find out the revision number are shown in this forum topic: http://forum.freecadweb.org/viewtopic.php?f=10&t=5308

The revision number for 958686d is 8539. It is from the master branch.

But this is a bug tracker, not a discussion forum. Further discussion should be done in the FreeCAD forum.

pgiffuni

2016-10-16 16:04

reporter   ~0007387

The problem with git is that hashes are not consecutive and are not an indicative of exactly which version you are using, so for the package I include the date the snapshot was taken from.

the port Makefile defines:

GH_TAGNAME= 958686d

So we are talking of a snapshot from here:
https://github.com/FreeCAD/FreeCAD/commit/958686d7b9e94caf0c0558cffc7bbf4f03ce8f21

Is there an option to produce more debug information (perhaps avoiding the RELEASE option?).

Chukharev

2016-10-17 16:02

reporter   ~0007389

I've made a patch for the FreeBSD port of FreeCAD to build the same version from Git as was shown for Ubuntu by jnxd. It bails to
-DISTVERSION= 0.17.g20160927
+DISTVERSION= 0.17.g20161008
and
-GH_TAGNAME= 958686d
+GH_TAGNAME= a50bd5d
(for those who use FreeBSD).

Unfortunately, the bug is reproduced with the new version too.

Any further suggestions? I mean, how to debug it now?

Chukharev

2016-10-18 20:18

reporter   ~0007393

Last edited: 2016-10-19 06:50

The bug is reproduced also with the FreeCAD built from the newest possible sources with last commit made today 8h ago, the only commit today till this moment.

Could anybody tell if the difference of Coin version can be the reason for bug not being observed on Ubuntu?
FreeBSD has the latest released Coin version 3.1.3.
Ubuntu uses a not yet released version 4.0.0a., see above Note 0007354.

Chukharev

2016-10-19 06:53

reporter   ~0007395

Last edited: 2016-10-19 06:55

Bug is reproducible on Win10. (I needed to comment out "import Show.TempoVis".)

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6706 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: f86a4e411ff7848dea98d7242f43b7774bee8fa0
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

Chukharev

2016-10-19 10:37

reporter   ~0007396

I've cloned Git and compiled within the repo. Bug is still reproducible. Now, I'd like somebody to reconfirm that the bug can not be reproduced on Ubuntu. Note that Coin version 4.0.0a does not fix the bug on Win10...

OS: UNIX
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8716 (Git)
Build type: Release
Branch: master
Hash: ec0f8082b2a284f86ab44e016bc5991c38667a6a
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1

Chukharev

2016-11-26 22:28

reporter   ~0007491

Reproducible also with:

OS: UNIX
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9023 (Git)
Build type: Release
Branch: master
Hash: de8bfaafc3d6a4360e6a5871d56ddaf28aca699e
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1

Kunda1

2017-01-13 00:05

administrator   ~0007696

Forum thread: http://forum.freecadweb.org/viewtopic.php?f=10&t=19825

Kunda1

2017-02-02 14:33

administrator   ~0008173

@Chukharev According to the forum and testers this seems to be a workflow issue rather than software. Please see https://forum.freecadweb.org/viewtopic.php?f=10&t=19825#p153066

Chukharev

2017-02-03 22:46

reporter   ~0008199

My opinion is that a bug is a bug. And it should be fixed. Particularly when at least two strategies of fixing it are suggested.
1. Try to slightly randomly displace points and rerun the solver. This is shown to help in my report. Admittedly, this is not a very reliable way to a solution...
2. Completely forbid the combination and/or do an automatic substitution of a close equivalent. This has been suggested in the forum.
The third strategy might be to detect the situation and just tell the user a better way to achieve the result.

Kunda1

2017-02-04 01:09

administrator   ~0008201

@Chukharev please respond in the forum thread to continue the conversation. Thanks

abdullah

2018-04-27 10:00

manager   ~0011205

In the meantime the tangency+coincident automatic conversion to endpoint tangency was implemented and merged into master. This should then be fixed in the sense that that combination can not be generated (by the user, can still be done from Python, but that is a power user looking for trouble).

I think this should be marked as "fixed" in the sense that it has been effectively "worked around".

chrisb

2018-04-27 21:04

developer   ~0011211

Fixed the MMacro by replacing Part.Line with Part.LineSegment.

With this modification both versions are okk in Abdullahs improved sketcher branch. Can be closed as soon as this is in Master
AttemptFixed.FCMacro (2,100 bytes)   
# -*- coding: utf-8 -*-

# Macro Begin: /home/chu/.FreeCAD/Macro/Atempt_001.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++
import FreeCAD
import PartDesign
import Sketcher
import Show.TempoVis
import math

#App.ActiveDocument.Sketch.addGeometry(Part.ArcOfCircle(Part.Circle(App.Vector(0, 8, 0), App.Vector(0, 0, 1), 1.5), 0, math.pi), False) # e 0, p 1..3
App.ActiveDocument.Sketch.addGeometry(Part.ArcOfCircle(Part.Circle(App.Vector(0, 8, 0), App.Vector(0, 0, 1), 1.5), math.pi/4, math.pi*3/4), False) # e 0, p 1..3
App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(-1, 9, 0), App.Vector(-1, 0, 0)), False) # e 1, p 1..2
App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(-1, 0, 0),App.Vector(1, 0, 0)),False) # e 2, p 1..2
App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(1, 0, 0),App.Vector(1, 9, 0)),False) # e 3, p 1..2
App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident', 0, 2, 1, 1)) # c 1
App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident', 1, 2, 2, 1)) # c 2
App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident', 2, 2, 3, 1)) # c 3
App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident', 3, 2, 0, 1)) # c 4
App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Vertical', 1)) # c 5
App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Horizontal', 2)) # c 
App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Vertical', 3)) # c 7
App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Tangent', 0, 1)) # c 8
App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Tangent', 3, 0)) # c 9
App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceY', -1, 1, 0, 3, 8.0)) # c 10
App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Symmetric',1,2,2,2,-1,1)) # c 11
App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceX', 2, 1, 2, 2, 2.0)) # c 12
App.ActiveDocument.recompute()

# Macro End: /home/chu/.FreeCAD/Macro/Atempt_001.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++
AttemptFixed.FCMacro (2,100 bytes)   

chrisb

2018-06-03 07:57

developer   ~0011344

https://github.com/FreeCAD/FreeCAD/pull/1429

Issue History

Date Modified Username Field Change
2016-10-07 21:00 Chukharev New Issue
2016-10-07 21:00 Chukharev File Added: Atempt_002.FCMacro
2016-10-10 15:22 jnxd Note Added: 0007354
2016-10-10 20:03 Chukharev Note Added: 0007356
2016-10-15 19:32 normandc Note Added: 0007367
2016-10-16 09:04 Chukharev Note Added: 0007384
2016-10-16 15:11 normandc Note Added: 0007386
2016-10-16 16:04 pgiffuni Note Added: 0007387
2016-10-17 16:02 Chukharev Note Added: 0007389
2016-10-18 20:18 Chukharev Note Added: 0007393
2016-10-19 06:50 Chukharev Note Edited: 0007393
2016-10-19 06:53 Chukharev Note Added: 0007395
2016-10-19 06:55 Chukharev Note Edited: 0007395
2016-10-19 10:37 Chukharev Note Added: 0007396
2016-11-26 22:28 Chukharev Note Added: 0007491
2017-01-13 00:05 Kunda1 Note Added: 0007696
2017-02-02 14:33 Kunda1 Note Added: 0008173
2017-02-02 14:33 Kunda1 Status new => feedback
2017-02-03 22:46 Chukharev Note Added: 0008199
2017-02-03 22:46 Chukharev Status feedback => new
2017-02-04 01:09 Kunda1 Note Added: 0008201
2017-02-04 01:09 Kunda1 Status new => feedback
2017-05-10 12:04 Kunda1 Tag Attached: Solver
2017-12-13 15:20 Kunda1 Project Sketcher => GCS
2018-04-27 10:00 abdullah Note Added: 0011205
2018-04-27 21:04 chrisb File Added: AttemptFixed.FCMacro
2018-04-27 21:04 chrisb Note Added: 0011211
2018-06-03 07:57 chrisb Assigned To => chrisb
2018-06-03 07:57 chrisb Status feedback => closed
2018-06-03 07:57 chrisb Resolution open => fixed
2018-06-03 07:57 chrisb Note Added: 0011344