Draft rectangle texture bug?

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!
kisolre
Posts: 1359
Joined: Wed Nov 21, 2018 1:13 pm

Draft rectangle texture bug?

Postby kisolre » Mon Mar 18, 2019 8:04 pm

I tried to assign texture to Draft rectangle as discussed in this thread https://forum.freecadweb.org/viewtopic. ... 8&start=10 but in all builds that I tried it fails to display proper image:
.
TextureErr.JPG
TextureErr.JPG (123.88 KiB) Viewed 242 times
.
This is with the 0.18 RC conda windows build

Code: Select all

OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16093 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 690774c0effe4fd7b8d2b5e2fb2b8c8d145e21ce
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Bulgarian/Bulgaria (bg_BG)
Draft_Rectangle does not mention anything special about the image. Forum and tracker search does not help. Am I doing something wrong or is it really a bug?
User avatar
furti
Posts: 321
Joined: Mon Nov 27, 2017 5:27 pm

Re: Draft rectangle texture bug?

Postby furti » Mon Mar 18, 2019 8:44 pm

No you are right this is indeed a bug with the texture generation in Py 3 builds. I found this bug a few month ago when working on my lithophane workbench as I also Need to generate a texture from Pixel data. But i completely forgot to verify that it also is broken in the Draft module and to fix it :oops:

Now I created a Pull Request with a fix for the Problem.
https://github.com/FreeCAD/FreeCAD/pull/2033

The Pull Request also contains a Performance optimization I applied to my Lithophane Workbench a few days ago. Otherwise big Images (1000x1000 Pixels and above) need a pretty long time to load.
yorik wrote:
Wed Mar 13, 2019 4:34 pm
ping

But when loading the texture it is rotated 180 degree. I don't know if this is the intended behaviour. If not I also might provide a fix for this.
kisolre
Posts: 1359
Joined: Wed Nov 21, 2018 1:13 pm

Re: Draft rectangle texture bug?

Postby kisolre » Mon Mar 18, 2019 9:14 pm

It is similar with Py 2 here. It shows a single color instead of image:
.
TextureErr_Py2.JPG
TextureErr_Py2.JPG (97.98 KiB) Viewed 217 times
.

Code: Select all

OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16093 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 690774c0effe4fd7b8d2b5e2fb2b8c8d145e21ce
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Bulgarian/Bulgaria (bg_BG)
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Draft rectangle texture bug?

Postby NormandC » Tue Mar 19, 2019 4:00 am

I have the white noise issue with FC/Py3, but it's fine in FC/Py2.

furti wrote:
Mon Mar 18, 2019 8:44 pm
But when loading the texture it is rotated 180 degree. I don't know if this is the intended behaviour.
It's been a very long time since I used the Texture Image property, I was sure it didn't use to rotate the image. But I just checked in 0.17.13541 and even 0.16.6712, and it's rotated too.


OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16093 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 690774c0effe4fd7b8d2b5e2fb2b8c8d145e21ce
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/Canada (fr_CA)
Attachments
FC018_Py2_texture_working_01.png
FC018_Py2_texture_working_01.png (81.43 KiB) Viewed 197 times
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Draft rectangle texture bug?

Postby NormandC » Tue Mar 19, 2019 4:02 am

kisolre wrote:
Mon Mar 18, 2019 9:14 pm
It shows a single color instead of image:
That's because you selected it. Just deselect it, you'll see the image.
User avatar
furti
Posts: 321
Joined: Mon Nov 27, 2017 5:27 pm

Re: Draft rectangle texture bug?

Postby furti » Tue Mar 19, 2019 5:34 am

NormandC wrote:
Tue Mar 19, 2019 4:00 am
I have the white noise issue with FC/Py3
The white noise should be fixed when my pull request is merged :)

And for the rotation thing we might have to wait for yorik to answer this.
kisolre
Posts: 1359
Joined: Wed Nov 21, 2018 1:13 pm

Re: Draft rectangle texture bug?

Postby kisolre » Tue Mar 19, 2019 9:51 am

NormandC wrote:
Tue Mar 19, 2019 4:02 am
That's because you selected it. Just deselect it, you'll see the image.
Deselecting does not help:
TextureErr_Py2_2.JPG
TextureErr_Py2_2.JPG (185.86 KiB) Viewed 173 times

Code: Select all

OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16093 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 690774c0effe4fd7b8d2b5e2fb2b8c8d145e21ce
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Bulgarian/Bulgaria (bg_BG)
User avatar
furti
Posts: 321
Joined: Mon Nov 27, 2017 5:27 pm

Re: Draft rectangle texture bug?

Postby furti » Fri Mar 22, 2019 7:05 pm

The pull request was merged. So the fix for py 3 should be available with a 0.19 build when they are ready :)