[ Inaccuracy Fixed ] Draft_PathArray: Align Mode Original does not match V0.18

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

[ Inaccuracy Fixed ] Draft_PathArray: Align Mode Original does not match V0.18

Post by Roy_043 »

After some more testing I now notice that the so called "Original" "Alignment Mode" in V0.20 does not match the V0.18 behavior.

Apart from the obvious rotation that can be seen by focusing on the 'protrusion' of the object, I'd like to draw attention to the alignment of the middle element in the arrays. In V0.20 it is always the same. In V0.18 it is different for the array that is closest to the camera.

In V0.20 there is also an accuracy issue related to the placement of the 1st element in the 1st array (bottom left element of the leftmost array in the image).
tangent t=Vector (-4.996003610813204e-16, 3.3306690738754696e-16, 1.0)
normal n=Vector (0.0, 0.0, 1.0)
Effectively these vectors are parallel, calculating a binormal from them does not make sense, but the code does use this vector:
binormal b=Vector (0.554700196225229, 0.8320502943378436, -0.0)

The wires were created with this code.

Code: Select all

import FreeCAD as App
import Draft

doc = App.ActiveDocument

# 'random' placement:
pl = App.Placement()
pl.Rotation.Q = (0.5252490575950084, 0.10516732714534528, 0.16578312893689348, 0.8279910717855314)
pl.Base = App.Vector(0.0, 0.0, 0.0)

points1 = [App.Vector(200.0, -100.0, -100.0),
           App.Vector(200.0, -100.0,  100.0),
           App.Vector(150.0,  100.0,  100.0),
           App.Vector(100.0,  100.0, -100.0)]

points2 = [App.Vector(450.0, -100.0, -100.0),
           App.Vector(450.0, -100.0,  100.0),
           App.Vector(400.0,  100.0,  100.0),
           App.Vector(350.0,  100.0, -100.0)]

points3 = [App.Vector(750.0, -100.0, -100.0),
           App.Vector(700.0, -100.0,  100.0),
           App.Vector(650.0,  100.0,  100.0),
           App.Vector(600.0,  100.0, -100.0)]

wire1 = Draft.makeWire(points1, placement=pl)
wire2 = Draft.makeWire(points2)
wire3 = Draft.makeWire(points3)

doc.recompute()

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.20.24986 (Git)
Build type: Release
Branch: master
Hash: ff6845e2f31988cc714027980e0100bb5521843e
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Dutch/Netherlands (nl_NL)
Attachments
Draft_PathArray-accuray-v020.png
Draft_PathArray-accuray-v020.png (69.94 KiB) Viewed 1714 times
Draft_PathArray-accuray-v018.png
Draft_PathArray-accuray-v018.png (103.39 KiB) Viewed 1714 times
Draft_PathArray-accuray-v020.FCStd
(28.74 KiB) Downloaded 43 times
Draft_PathArray-accuray-v018.FCStd
(35.33 KiB) Downloaded 42 times
Last edited by Roy_043 on Wed Sep 21, 2022 11:28 am, edited 1 time in total.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] Draft_PathArray: Align Mode Original does not match V0.18

Post by Roy_043 »

The inaccuracy issue was fixed with this PR:
https://github.com/FreeCAD/FreeCAD/pull/7506

Align Mode Original in V0.18 works differently because multiple segments are considered. This is no longer the case in the V0.20 code. Reverting that would not be good idea.
Post Reply