[Bug#4382] Error position in Array when "Link Array" checked off

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!
fc_tofu
Posts: 654
Joined: Sun Jan 05, 2020 4:56 pm

[Bug#4382] Error position in Array when "Link Array" checked off

Postby fc_tofu » Wed Jun 10, 2020 1:49 pm

Summary
DraftWB, Array operator, when "Link Array" option checked off, error appear on viewport.

Reproduce
1. Startup FreeCAD, switch to DraftWB
2. Draw a circle
3. invoke "Array" operator
4. Task panel of "Array", check off "Link Array", OK
5. Observe on viewport, strange points appear and placement of array instance is wrong.
fsc_2020-06-10_213330b.jpg
fsc_2020-06-10_213330b.jpg (40.01 KiB) Viewed 557 times
fsc_2020-06-10_213340b.jpg
fsc_2020-06-10_213340b.jpg (44.06 KiB) Viewed 557 times
fsc_2020-06-10_213441b.jpg
fsc_2020-06-10_213441b.jpg (38.72 KiB) Viewed 557 times
Strange points seems center of circles, the only vertex of circle. So, the issue means vertices and edges are separated after non-link Array.

In case of "Link array" checked on, the result looks right in viewport. Then after Downgrade, same result (as Reproduce step 5) happens.

Recompute, restart FC, restart PC, reset "user.cfg" donn't help in both cases.

Code: Select all

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21329 (Git)
Build type: Release
Branch: master
Hash: 2330eef823b32ac412d839031cc174353a76b013
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:
issue #4382

ps.
Summary on 2020-06-28.
Conditions of this bug:
1. OCCT 7.4 (not 7.3)
2. Link array = False (not True)
3. Make face = False (not True)
4. FreeCAD 0.19 (not 0.18)
Attachments
non_linkarray.FCStd
(5.53 KiB) Downloaded 11 times
Last edited by fc_tofu on Sun Jun 28, 2020 3:26 pm, edited 6 times in total.
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: DraftWB, error in Array when "Link Array" checked off

Postby vocx » Wed Jun 10, 2020 4:24 pm

fc_tofu wrote:
Wed Jun 10, 2020 1:49 pm
DraftWB, Array operator, when "Link Array" option checked off, error appear on viewport.
No error here.

Code: Select all

OS: Ubuntu 18.04.4 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21562 (Git)
Build type: Release
Branch: master
Hash: 11a2b948ea55b19efe7515f730035027a7822e06
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

Code: Select all

_obj_ = Draft.make_ortho_array(App.ActiveDocument.Circle, v_x=FreeCAD.Vector(100.0, 0.0, 0.0), v_y=FreeCAD.Vector(0.0, 100.0, 0.0), v_z=FreeCAD.Vector(0.0, 0.0, 100.0), n_x=3, n_y=1, n_z=1, use_link=False)
_obj_.Fuse = False
Draft.autogroup(_obj_)
App.ActiveDocument.recompute()
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
TheMarkster
Posts: 2049
Joined: Thu Apr 05, 2018 1:53 am

Re: DraftWB, error in Array when "Link Array" checked off

Postby TheMarkster » Wed Jun 10, 2020 4:36 pm

Seems to work as expected here.

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21329 (Git)
Build type: Release
Branch: master
Hash: 2330eef823b32ac412d839031cc174353a76b013
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
My FreeCAD video series on youtube: https://www.youtube.com/c/mwganson
fc_tofu
Posts: 654
Joined: Sun Jan 05, 2020 4:56 pm

Re: DraftWB, error in Array when "Link Array" checked off

Postby fc_tofu » Wed Jun 10, 2020 4:58 pm

TheMarkster wrote:
Wed Jun 10, 2020 4:36 pm
Seems to work as expected here.
I'm using Conda build, what about you. (From hash number, it seems you are using conda build also.)
Thank you and @vox.
fc_tofu
Posts: 654
Joined: Sun Jan 05, 2020 4:56 pm

Re: DraftWB, error in Array when "Link Array" checked off

Postby fc_tofu » Wed Jun 10, 2020 5:05 pm

vocx wrote:
Wed Jun 10, 2020 4:24 pm

Code: Select all

_obj_ = Draft.make_ortho_array(App.ActiveDocument.Circle, v_x=FreeCAD.Vector(100.0, 0.0, 0.0), v_y=FreeCAD.Vector(0.0, 100.0, 0.0), v_z=FreeCAD.Vector(0.0, 0.0, 100.0), n_x=3, n_y=1, n_z=1, use_link=False)
_obj_.Fuse = False
Draft.autogroup(_obj_)
App.ActiveDocument.recompute()
I tested this code. Same error happens.
TheMarkster
Posts: 2049
Joined: Thu Apr 05, 2018 1:53 am

Re: DraftWB, error in Array when "Link Array" checked off

Postby TheMarkster » Wed Jun 10, 2020 5:26 pm

It is a conda build. If I create circle and run the code I get no errors.
Snip macro screenshot-f8f566.png
Snip macro screenshot-f8f566.png (151.36 KiB) Viewed 503 times
My FreeCAD video series on youtube: https://www.youtube.com/c/mwganson
Syres
Posts: 819
Joined: Thu Aug 09, 2018 11:14 am

Re: DraftWB, error in Array when "Link Array" checked off

Postby Syres » Thu Jun 11, 2020 8:27 am

fc_tofu wrote:
Wed Jun 10, 2020 5:05 pm
I tested this code. Same error happens.
What I've not seen mentioned is that if you make the Circle (or any other 2D object) to Make Face=True then the array is corrected, I hope this helps narrow down the bug. So far I've not found any issues with applying an array to a 3D model, thankfully and also the AppImage equivalent to this Windows Conda build does not produce the bug which was a little surprising.


OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21514 (Git)
Build type: Release
Branch: master
Hash: 89ddab33f692a9bd739171689f9ab0eb58d64b35
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United Kingdom (en_GB)
fc_tofu
Posts: 654
Joined: Sun Jan 05, 2020 4:56 pm

Re: DraftWB, error in Array when "Link Array" checked off

Postby fc_tofu » Thu Jun 11, 2020 9:01 am

Syres wrote:
Thu Jun 11, 2020 8:27 am

What I've not seen mentioned is that if you make the Circle (or any other 2D object) to Make Face=True then the array is corrected, I hope this helps narrow down the bug. So far I've not found any issues with applying an array to a 3D model, thankfully and also the AppImage equivalent to this Windows Conda build does not produce the bug which was a little surprising.
fsc_2020-06-11_165304.jpg
fsc_2020-06-11_165304.jpg (73.87 KiB) Viewed 456 times
Thank you for point out a key factor.

1. If "make face" is toggled on when drawing circle, the problem won't happen after Array operation.

2. When "make face" option of circel is toggled off, the problem happen back again.

The same result happen to other 2D Draft objects, such as rectangle.
This issue doesnot happen to 3D objects, such as Part primitive cube.
Attachments
array_2d_face.FCStd
(5.58 KiB) Downloaded 8 times
Last edited by fc_tofu on Thu Jun 11, 2020 11:51 am, edited 1 time in total.
fc_tofu
Posts: 654
Joined: Sun Jan 05, 2020 4:56 pm

Re: DraftWB, error in Array when "Link Array" checked off

Postby fc_tofu » Thu Jun 11, 2020 11:50 am

TheMarkster wrote:
Wed Jun 10, 2020 5:26 pm
It is a conda build.
Please redo your test with "Make Face" =false.
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: DraftWB, error in Array when "Link Array" checked off

Postby vocx » Thu Jun 11, 2020 1:20 pm

No error with or without MakeFace true.

Code: Select all

pl=FreeCAD.Placement()
pl.Rotation.Q=(0.0, 0.0, 1.5308084989341915e-17, 1.0)
pl.Base=FreeCAD.Vector(-141.9844199134889, -48.87504491348892, 0.0)
circle = Draft.makeCircle(radius=19.33585978294259, placement=pl, face=False, support=None)
Draft.autogroup(circle)
FreeCAD.ActiveDocument.recompute()

_obj_ = Draft.make_ortho_array(App.ActiveDocument.Circle, v_x=FreeCAD.Vector(100.0, 0.0, 0.0), v_y=FreeCAD.Vector(0.0, 100.0, 0.0), v_z=FreeCAD.Vector(0.0, 0.0, 100.0), n_x=3, n_y=1, n_z=1, use_link=False)
_obj_.Fuse = False
Draft.autogroup(_obj_)
App.ActiveDocument.recompute()
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.