2D polygon facet if long XY

If you are allergic to bug trackers, you can post here any remarks, issues and potential bugs you encounter
Post Reply
DA523
Posts: 166
Joined: Mon May 25, 2020 4:02 pm

2D polygon facet if long XY

Post by DA523 »

I use Fit >> 2D polygon facet on only XY UTM pointscloud to find the perimeter of 1 million points (from mesh >> sampled points)
In some cases, facet algorithm fails to perfectly find perimeter, and changing the max edge does not help.
However if during opening UTM pointscloud , the global shift is enabled, facet algorithm succeeds
I propose to modify the facet algorithm to silently use global shift during execution.
I use the latest cc V2.12 beta

In this screenshot, global shift is enabled and max edge =2
..
22.png
22.png (180.57 KiB) Viewed 4488 times
..

In this screenshot, global shift is disabled and max edge =2
..
2.png
2.png (166.34 KiB) Viewed 4488 times
..
please check attached pointscloud (segmented to fit in 2 MB zip file)
..
utm coordinates2.zip
(1.78 MiB) Downloaded 514 times
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: 2D polygon facet if long XY

Post by daniel »

You mean that you sometimes open points with large coordinates without applying the Global Shift?!

Did you understood the consequences? You'll lose a lot of accuracy, and this is probably why the 'Facet' algorithm fails (as many other things). And no, it's too late to shift the points afterwards, since they can only be shifted at loading time (otherwise the accuracy is already lost once stored in memory by CC).
Daniel, CloudCompare admin
DA523
Posts: 166
Joined: Mon May 25, 2020 4:02 pm

Re: 2D polygon facet if long XY

Post by DA523 »

For UTM coordinates, I tested loss of accuracy and found that it is no more than 0.13 m in Y which is OK if, for example, your shape is longer than 100 m in Y and of course depends on your application.
However, this 0.13 m is a big loss for many applications and care must be taken.

I think the fit facet algorithm fails because another reason is not because just long XY coordinates or loss of accuracy.
I suspect
duplicated points?
too close points?
random distribution of points?

please check the attached pointscloud where fit facet algorithm fails
.
fit fail.zip
(5.84 KiB) Downloaded 376 times
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: 2D polygon facet if long XY

Post by daniel »

Ah yes, for this cloud, I believe the 'max edge length' strategy fails because the cloud density is too small compared to the 'max edge length' that would be required to properly follow the contour. The algorithms loses itself in the weeds...
Daniel, CloudCompare admin
DA523
Posts: 166
Joined: Mon May 25, 2020 4:02 pm

Re: 2D polygon facet if long XY

Post by DA523 »

So in the meantime, I found that the best solution is to use (EDIT >> subsample) or (TOOLS >> OTHER >> REMOVE DUPLICATE POINTS) before applying (TOOLS >> Fit >> 2D polygon facet)
Trick: You can clone the original pointscloud before applying subsample then use result 2d polygon on original pointscloud then delete subsampled pointscloud
..
By the way, is there any plan to release a binary version of CC supporting 64bits precision of coordinates? assuming that some users have enough memory and CPU power?
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: 2D polygon facet if long XY

Post by daniel »

Ah no there won't be any such official release. But anyone can compile it of course.

The issue is that it solves the accuracy problem (at the cost of twice more memory). But the display will still be funky, points will be nearly impossible to pick, etc. Because most of the OpenGL driver don't manage 64bits coordinates either... (maybe Quadro drivers will, but I'm not even sure).
Daniel, CloudCompare admin
Post Reply