Bug #5649: Changing dimension 40.001 to a value <= 40 (& > 30) = expected behavior. More than 40 = bug

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
Kunda1
Veteran
Posts: 13443
Joined: Thu Jan 05, 2017 9:03 pm

Bug #5649: Changing dimension 40.001 to a value <= 40 (& > 30) = expected behavior. More than 40 = bug

Post by Kunda1 »

issue #2497: Changing dimension 40.001 to a value <= 40 (and > 30) gets the expected behavior. More than 40 gets the the buggy one
Model is attached to ticket.
Description
possible bug: FreeCAD>>Part Design>> Draft tool

Steps To Reproduce
Sketch001: Changing dimension 40.001 to a value less or equal to 40 (and greater than 30) gets the expected behavior. More than 40 gets the buggy one.

Additional Information
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6689 (Git)
Build type: Release
Branch: master
Hash: 3003f1638949a018596a16e9e8eea7f237e1d94d
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Last edited by Kunda1 on Fri Feb 25, 2022 11:15 pm, edited 1 time in total.
Reason: used github issue number
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
user1234
Veteran
Posts: 2732
Joined: Mon Jul 11, 2016 5:08 pm

Re: Bug #2497: Changing dimension 40.001 to a value <= 40 (& > 30) = expected behavior. More than 40 = bug

Post by user1234 »

Still there on OCCT7.2.0:

Code: Select all

OS: Debian GNU/Linux 9.1 (stretch)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11957 (Git)
Build type: DebWithRelInfo
Branch: master
Hash: 61c7ac7fddb35084a567e0311806292efea8dc70
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
On attachments a rebuild with acutal develoment version.
Attachments
2497.fcstd
(206.91 KiB) Downloaded 95 times
user1234
Veteran
Posts: 2732
Joined: Mon Jul 11, 2016 5:08 pm

Re: Bug #2497: Changing dimension 40.001 to a value <= 40 (& > 30) = expected behavior. More than 40 = bug

Post by user1234 »

Hello!

chennes wrote: ping
Still an issue in OCCT7.5.3. But except your message here https://tracker.freecadweb.org/view.php?id=2497#c15927, i get good results to 40.0 and bad results >40.0 (and 40.001 FreeACAD hangs, 40.01 shape is invalid).

Greetings
user1234
openBrain
Veteran
Posts: 9019
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Bug #2497: Changing dimension 40.001 to a value <= 40 (& > 30) = expected behavior. More than 40 = bug

Post by openBrain »

I also have bug for values > 40 only.
---
OS: Ubuntu 21.04 (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.25695
Build type: Release
Branch: master
Hash: 582c26ea8b5f9d85957a6cb1bf798839fa2ce94c
Python version: 3.9.5
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.2
Locale: French/France (fr_FR)
User avatar
jnxd
Posts: 928
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Bug #2497: Changing dimension 40.001 to a value <= 40 (& > 30) = expected behavior. More than 40 = bug

Post by jnxd »

user1234 wrote: Thu Sep 16, 2021 8:25 pm Hello!

chennes wrote: ping
Still an issue in OCCT7.5.3. But except your message here https://tracker.freecadweb.org/view.php?id=2497#c15927, i get good results to 40.0 and bad results >40.0 (and 40.001 FreeACAD hangs, 40.01 shape is invalid).

Greetings
user1234
I believe this is kind of a "Heisenbug" again. I tried changing the values a few times, even rebuilding the model from scratch. The results seem different everytime.

[EDIT] I don't know how long we need to keep changing values before the "Heisenbug" reappears, but as I keep rerunning this thing to debug, it seems the bug only happens when the center of the circle in "Sketch001" is within the ring i.e. inner_diam < center to origin < outer_diam.
Last edited by jnxd on Thu Sep 23, 2021 4:43 am, edited 1 time in total.
My latest (or last) project: B-spline Construction Project.
user1234
Veteran
Posts: 2732
Joined: Mon Jul 11, 2016 5:08 pm

Re: Bug #2497: Changing dimension 40.001 to a value <= 40 (& > 30) = expected behavior. More than 40 = bug

Post by user1234 »

jnxd wrote: Mon Sep 20, 2021 1:25 pm"Heisenbug"
Yeah Science!

Greetings
user1234
User avatar
jnxd
Posts: 928
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Bug #2497: Changing dimension 40.001 to a value <= 40 (& > 30) = expected behavior. More than 40 = bug

Post by jnxd »

So the bug seems to be upstream in OCCT.

I compiled a debug version of OCCT 7.5.0 and the bug seems to be in finding the intersection between the new face made after the draft and the inner face of body, which gives the curve for one of the new edges [EDIT: Added file for explanation]. The new draft face is conical, whose surface is a "double cone" formed by extending the cone beyond it's tip. The inner cylindrical surface intersects this double cone at multiple places (mostly forming two disconnected curves except where the cyclinder intersects the tip itself), and the portion that we want is often not found.

I put a break at .../occt/src/Draft/Draft_Modification_1.cxx:921, where the intersection happens. You may need to track down the exact iteration where the problem happens. Multiple "lines" (the intersection curves) are returned after i2s::Perform(...) and even when the draft works correctly (inner diameter >=40 right now), none of these "lines" are what we need. There is some "gluing" that happens after this which fixes the lines, but only in some cases. For now it is with inner diameter >= (distance between cone's axis and origin), but perhaps earlier the sign was inverted.
Attachments
2497-problem-intersection.FCStd
(63.78 KiB) Downloaded 58 times
My latest (or last) project: B-spline Construction Project.
User avatar
chennes
Veteran
Posts: 3678
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Bug #2497: Changing dimension 40.001 to a value <= 40 (& > 30) = expected behavior. More than 40 = bug

Post by chennes »

OK, reporting things upstream is easier if we can construct a sequence of DRAW Test Harness commands (perhaps starting from a precomposed BRep file that we include in the report) to cause the error. How simple can we make this?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
jnxd
Posts: 928
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Bug #2497: Changing dimension 40.001 to a value <= 40 (& > 30) = expected behavior. More than 40 = bug

Post by jnxd »

chennes wrote: Mon Oct 11, 2021 2:00 am OK, reporting things upstream is easier if we can construct a sequence of DRAW Test Harness commands (perhaps starting from a precomposed BRep file that we include in the report) to cause the error. How simple can we make this?
Was something I was trying to do myself. Couldn't get to making the pad with a hole in the first place. Here's the WIP if anyone wants to try.

[UPDATE] Gave up on trying to make a face with a hole before making the prism and just used boolean on two cylinders. Attached file reproduces the bug.
Attachments
problemDraft.tcl.gz
(620 Bytes) Downloaded 49 times
My latest (or last) project: B-spline Construction Project.
User avatar
adrianinsaval
Veteran
Posts: 5414
Joined: Thu Apr 05, 2018 5:15 pm

Re: Bug #2497: Changing dimension 40.001 to a value <= 40 (& > 30) = expected behavior. More than 40 = bug

Post by adrianinsaval »

chennes wrote: Mon Oct 11, 2021 2:00 am ping
is the posted file correct for a bug report upstream?
Post Reply