View Issue Details

IDProjectCategoryView StatusLast Update
0004436FreeCADBugpublic2021-08-27 02:51
ReporterRoy_043 Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionwon't fix 
Target Version0.20 
Summary0004436: Points_Structure command does not work properly
DescriptionAs far as I understand things the Points_Structure command should sort the points in a point cloud. The current algorithm seems flawed as only the X and Y coordinates of a point are used in the sorting process and to determine the index of the point in the new point cloud.

src\Mod\Points\Gui\Command.cpp Line 434:

                if (xx < 0.01 && yy < 0.01) {
                    xi = std::round(xi);
                    yi = std::round(yi);
                    long index = long(yi * width_l + xi);
                    sortedPoints[index] = pnt;
                }

Example:
pt1: 0,0,0
pt2: 0,0,1
pt1 and pt2 will receive the same index in the structured point cloud. Which effectively means that pt1 is overwritten by pt2.

Also the structured point cloud can have 'nan' vectors which the algorithm should only use temporarily. See the attached file.

App.ActiveDocument.Test13__Structured_.Points.Points
=>
[Vector (0.0, 0.0, 2.0), Vector (nan, nan, nan), Vector (1.0, 0.0, 2.0), Vector (nan, nan, nan), Vector (0.5, 0.5, 2.5), Vector (nan, nan, nan), Vector (0.0, 1.0, 2.0), Vector (nan, nan, nan), Vector (1.0, 1.0, 2.0)]
Steps To ReproduceSee description.
Additional InformationForum topic:
https://forum.freecadweb.org/viewtopic.php?f=3&t=49668
Tags#pending-forum
FreeCAD InformationOS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22262 (Git)
Build type: Release
Branch: master
Hash: f56825c79f11b75648a7a0dcc8a9f52bb4574e61
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)

Activities

Roy_043

2020-09-15 08:06

reporter  

Roy_043

2020-09-15 08:10

reporter   ~0014755

Something has gone wrong with the formatting of the description. Sorry for that.

Roy_043

2021-01-30 14:22

reporter   ~0015227

Conclusion (see forum discussion): 'As designed'.
This ticket can be closed.

chennes

2021-08-27 02:51

administrator   ~0015873

Closing as requested.

Issue History

Date Modified Username Field Change
2020-09-15 08:06 Roy_043 New Issue
2020-09-15 08:06 Roy_043 File Added: Test_Points_Structure.FCStd
2020-09-15 08:10 Roy_043 Note Added: 0014755
2020-12-08 21:33 Kunda1 Tag Attached: #pending-forum
2020-12-08 21:34 Kunda1 Description Updated
2020-12-08 21:34 Kunda1 Description Updated
2020-12-08 21:35 Kunda1 Target Version => 0.19
2021-01-30 14:22 Roy_043 Note Added: 0015227
2021-02-06 06:49 abdullah Target Version => 0.20
2021-08-27 02:51 chennes Status new => closed
2021-08-27 02:51 chennes Resolution open => won't fix
2021-08-27 02:51 chennes Note Added: 0015873