[Bug#4341] 019pre DraftWB, shape flip on Auto WP and Bottom view

A forum dedicated to the Draft, Arch and BIM workbenches development.
fc_tofu
Posts: 652
Joined: Sun Jan 05, 2020 4:56 pm

[Bug#4341] 019pre DraftWB, shape flip on Auto WP and Bottom view

Postby fc_tofu » Fri May 08, 2020 2:48 pm

Summary:
DraftWB, first added shape get flipped normal orientation when Automatic working plane and Bottom view.

Reproduce:
1. Pref >Display >Part color >"Two-sided rendering" toggle off.
2. Restart FreeCAD, and switch to DraftWB.
3. Rendering mode >Flat lines.
4. Working plane >Automatic.
5. Change to Bottom view (Menu command "Bottom" or NaviCube "Bottom").
6. Create a closed shape, rectangle for example.
7. Find normal orientation of rectangle get flipped.
fsc_2020-05-08_223239.jpg
fsc_2020-05-08_223239.jpg (118.95 KiB) Viewed 349 times
Workaround:
Befor step 5, change to other view (than Bottom) and draw a closed shape. Then goto step 5. Normal of created shape at Bottom view will get correct normal.


ps.
This issue doesnot happen on other views than Bottom.


OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20514 (Git)
Build type: Release
Branch: master
Hash: a05ffd499366ab12fa1b43f37db73f4f1e9c332d
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: Chinese/China (zh_CN)

Tracker (2020-05-14):
issue #4341
Attachments
fc019pre_draftwb_first_shape_flipped_at_bottom_view.FCStd
(3.98 KiB) Downloaded 3 times
Last edited by fc_tofu on Thu May 14, 2020 4:17 am, edited 3 times in total.
User avatar
Roy_043
Posts: 1545
Joined: Thu Dec 27, 2018 12:28 pm

Re: 019pre DraftWB, shape flipped when Auto Working Plane and Bottom view

Postby Roy_043 » Fri May 08, 2020 6:24 pm

Confirmed.

Code: Select all

OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20980 (Git)
Build type: Release
Branch: master
Hash: c2818d9159385d23b182dc7167af2d4bacbee94c
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)
adrianinsaval
Posts: 343
Joined: Thu Apr 05, 2018 5:15 pm

Re: 019pre DraftWB, shape flipped when Auto Working Plane and Bottom view

Postby adrianinsaval » Sun May 10, 2020 1:41 pm

Was it like that before bottom command was changed?
fc_tofu
Posts: 652
Joined: Sun Jan 05, 2020 4:56 pm

Re: 019pre DraftWB, shape flipped when Auto Working Plane and Bottom view

Postby fc_tofu » Sun May 10, 2020 2:23 pm

adrianinsaval wrote:
Sun May 10, 2020 1:41 pm
Was it like that before bottom command was changed?
Yes, before your pr for Bottom fix. And this bug is from FC 0.18.4/Win10x64.
BTW, build with your Bottom fix can not be downloaded for now.
You must has your personal complie with the Bottom fix. So, could you please test this issue in your compile?
adrianinsaval
Posts: 343
Joined: Thu Apr 05, 2018 5:15 pm

Re: 019pre DraftWB, shape flipped when Auto Working Plane and Bottom view

Postby adrianinsaval » Sun May 10, 2020 9:40 pm

how do I see normal orientation? I'm not sure I understand the problem.
fc_tofu
Posts: 652
Joined: Sun Jan 05, 2020 4:56 pm

Re: 019pre DraftWB, shape flipped when Auto Working Plane and Bottom view

Postby fc_tofu » Mon May 11, 2020 7:33 am

adrianinsaval wrote:
Sun May 10, 2020 9:40 pm
how do I see normal orientation?
Normally, such operation will create a "positive" normal face toward observers eyes. This bug produce a "negative" normal face toward observer's eyes.
In FreeCAD "Flat lines" rendering mode, "positive" normal face is rendered as grey color, and "negative" normal face is rendered as black color.
To see different normal face colors, the prerequisite is Pref >Display >Part Colors >Two-sided rendering, toggled off. (This is default setting in 0.19.)
"negative" normal face color is set in Pref >Display >3D View >Rendering >Backlight color. I changed it to dark-red on my machine, as appeared in my op.
You can compare same operation in different views to compare the normal orientations.

When composing shell/solid with surrounding faces/sufaces, flipped normal may cause erroneous geometry. It depends on the composing tool whether with normal correction capacity.
adrianinsaval
Posts: 343
Joined: Thu Apr 05, 2018 5:15 pm

Re: 019pre DraftWB, shape flipped when Auto Working Plane and Bottom view

Postby adrianinsaval » Tue May 12, 2020 3:32 pm

Same happens with new view bottom, it seems the working plane is not changed when you go to bottom view as it already is the XY plane, just pointing towards Z+.
vocx I have the impression you are the current Draft guru, what do you think about this?
vocx wrote:
vocx
Posts: 4615
Joined: Thu Oct 18, 2018 9:18 pm

Re: 019pre DraftWB, shape flipped when Auto Working Plane and Bottom view

Postby vocx » Tue May 12, 2020 7:20 pm

adrianinsaval wrote:
Tue May 12, 2020 3:32 pm
vocx I have the impression you are the current Draft guru, what do you think about this?
Honestly, the problem could be under piles of code in the WorkingPlane module, the DraftGui module, the gui_snapper module, etc. I can't pinpoint the problem easily. I would have to dedicate many hours to find out what calls what because I don't have a clear idea of this.

I'm busy doing other things, so I don't think I will attack this problem at the moment. I appreciate the bug report, but probably Yorik would have a better idea of what needs to be changed where.
Always add the important information to your posts if you need help.
To support the documentation effort, and code development, your donation is appreciated: paypal.
adrianinsaval
Posts: 343
Joined: Thu Apr 05, 2018 5:15 pm

Re: 019pre DraftWB, shape flipped when Auto Working Plane and Bottom view

Postby adrianinsaval » Tue May 12, 2020 8:25 pm

understandable
carlopav
Posts: 1436
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: 019pre DraftWB, shape flipped when Auto Working Plane and Bottom view

Postby carlopav » Tue May 12, 2020 8:49 pm

back to an old time proposal idea, but wouldn't it be good if the Draft Grid could be "3d", displaying also the Z axis?
follow my experiments on BIM modelling for architecture design