PathArray object orientation on Spline

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!
Post Reply
SmArt
Posts: 2
Joined: Fri Apr 03, 2020 3:08 pm

PathArray object orientation on Spline

Post by SmArt »

Hello,
I am new to FreeCAD and I'm trying to understand some of it.

I don't understand how the objects are oriented on one of the paths in the attached file. When following the explanation on
https://wiki.freecadweb.org/Draft%20PathArray

I would say the objects on the B-spline "Bspline_YZ" are not oriented correctly. Can you please explain that or confirm it as bug?

My second question: is there a modifier that would shrink the gaps between objects so that the objects do not exceed the defining path (i.e. fit all objects to this path without the last one going past the path?

Thank you in advance

Best Regards

SmArt

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
Attachments
test_pathArray 2.png
test_pathArray 2.png (47.52 KiB) Viewed 429 times
test_pathArray 2.FCStd
(29.74 KiB) Downloaded 11 times
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: PathArray object orientation on Spline

Post by vocx »

SmArt wrote: Fri Apr 03, 2020 3:38 pm ...
I would say the objects on the B-spline "Bspline_YZ" are not oriented correctly. Can you please explain that or confirm it as bug?
...
And why would you say that?
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.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: PathArray object orientation on Spline

Post by wandererfan »

SmArt wrote: Fri Apr 03, 2020 3:38 pm I don't understand how the objects are oriented on one of the paths in the attached file. When following the explanation on
https://wiki.freecadweb.org/Draft%20PathArray

I would say the objects on the B-spline "Bspline_YZ" are not oriented correctly. Can you please explain that or confirm it as bug?
looks ok from here. What should be different? The origins of your items are on the path and the pointy end is along the tangent of the curve.
My second question: is there a modifier that would shrink the gaps between objects so that the objects do not exceed the defining path (i.e. fit all objects to this path without the last one going past the path?
IIRC, one object goes on the start of the path, another goes on the end of the path and then the space in between is filled with n-2 copies. So you're going to have at least one of the end objects sticking past the path.
SmArt
Posts: 2
Joined: Fri Apr 03, 2020 3:08 pm

Re: PathArray object orientation on Spline

Post by SmArt »

Hello, thanks for the replies.

I would say they are not oriented correctly because the "Spline_XZ" rolls upwards, therefore the N vector points upwards and the N vector should be normal to the side of the triangle. All the other paths have the triangles oriented so that the triangle side is towards the center of rotation. I would say the triangle should be laying flat on the "Spline_XZ".

The pointy end is aligned correctly, the other not-so-pointy-end should be facing right I would say.

Thanks
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: PathArray object orientation on Spline

Post by wandererfan »

SmArt wrote: Fri Apr 03, 2020 8:25 pm I would say the triangle should be laying flat on the "Spline_XZ".
Sorry for the delay in responding. It should look like this?
BSplineFlatToCenterWorkaround.png
BSplineFlatToCenterWorkaround.png (11.41 KiB) Viewed 334 times
A workaround is attached. Fiddling the attachment of the spline sketch rotates the base shape conveniently.

IMO, the error is in DraftGeomUtils.py, #1182 getNorma(). In the case of a BSplineCurve, this routine does not calculate a normal but defaults to Z. I'll see what I can do about submitting a fix.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: PathArray object orientation on Spline

Post by wandererfan »

should be fixed after git commit ba7b32e6bc.
Post Reply