Bug #3484: Open paths are closed upon upgrade

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Bug #3484: Open paths are closed upon upgrade

Post by Kunda1 »

issue #3484: Open paths are closed upon upgrade
Please weigh in on this ticket.

Please also test related issue #3483 Simple paths cannot be upgraded
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
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: Bug #3484: Open paths are closed upon upgrade

Post by bejant »

How to reproduce as taken from issue #3484:
1. Create an SVG file with a single path comprising three nodes (see also bug 0003483).
2. Import the file into the Draft workbench as geometry.
3. Select the path and use the upgrade tool.

Expected result:
The path is converted to a Wire (or a Block, or other object that can be displayed in the Drawing workbench) as it is.

Actual result:
The path is converted to a Wire object and closed.

This is a pic of the paths as provided by the person who reported the bug:
20180625b.png
20180625b.png (1.53 KiB) Viewed 988 times

Upon using Draft > Upgrade on the path using FreeCAD 0.17 I can confirm the behavior, and using 0.18 I get a hard crash.
Although the user posted an expected result, I don't know if that is what should be expected after using Draft > Upgrade on it, and after Import it does display in the 3D view:
20180625a.png
20180625a.png (17.86 KiB) Viewed 988 times

To avoid confusion I deleted the last 3 paths and the numerals from the original file, here is only the first curve:
path.svg
(1.93 KiB) Downloaded 82 times

OS: Ubuntu 16.04.4 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.17.13522 (Git)
Build type: None
Branch: releases/FreeCAD-0-17
Hash: 3bb5ff4e70c0c526f2d9dd69b1004155b2f527f2
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)


OS: Ubuntu 16.04.4 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.18.13971 (Git)
Build type: None
Branch: master
Hash: 8e4dd8ca8496595d4718dc24c872f7ed668b2521
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
User avatar
Gift
Posts: 769
Joined: Tue Aug 18, 2015 10:08 am
Location: Germany, Sauerland

Re: Bug #3484: Open paths are closed upon upgrade

Post by Gift »

https://github.com/FreeCAD/FreeCAD/blob ... t.py#L3671

Code: Select all

        # special case, we have only one open wire. We close it, unless it has only 1 edge!"
        elif (len(openwires) == 1) and (not faces) and (not loneedges):
            result = closeWire(objects[0])
if result: msg(translate("draft", "Found 1 open wire: closing it")+"\n")
The result is a feature and not a bug. Need we a parameter to disable this feature?
Attachments
path_bug.gif
path_bug.gif (47.18 KiB) Viewed 926 times
Post Reply