Moving and rotating a point cloud in e57 format

Feel free to ask any question here
muhku
Posts: 4
Joined: Fri May 24, 2019 6:35 am

Moving and rotating a point cloud in e57 format

Post by muhku »

Hello,

I'm a new user of Cloudcompare and am not very experienced with point clouds. I have been trying to reposition a point cloud which I received to fit a BIM coordinate for the purpose of importing it into a design software called Archicad. The point cloud is in .e57 format, because that's what Archicad eats natively.

I have been trying to fiddle with the "global shift" and "apply translation" settings, but no matter what I do, or which boxes I check, it seems that I can never actually reposition or rotate the point cloud. Even if I very simply try to set the point cloud near 0,0,0 in cloudcompare, then export the result into a new .e57 file, then open THAT file in cloudcompare, it always gives me the "too big coordinates" dialog and the cloud is always WAY off 0,0,0.

The reason I want to do this in Cloudcompare is that when exporting a point cloud to Archicad, my only options are to either place & rotate the point cloud by hand or place it in the model origin, in which case the point cloud is several hundred kilometers off the model and this causes serious problems in modeling software. I would like to do the latter because it is an "exact" method. Therefore I need the actual .e57 file to be in the same origin initially when doing the import.

I know the exact coordinates where I want to move the point cloud and then rotate it by a certain amount of degrees to get it aligned with our BIM origin, but I just can't get it done. Could someone give me a simple step-by-step guide to how this should be done in Cloudcompare?

ps.
I found an old thread where someone had a similar problem but with scaling, tried to follow those instructions and failed, so I was wondering if there was a bug preventing me from doing this correctly...
http://www.danielgm.net/cc/forum/viewtopic.php?t=2793
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Moving and rotating a point cloud in e57 format

Post by daniel »

With the latest version of CC you have two options to redefine the global coordinate system:
1) load the cloud and accept the default global shift. Then edit the "Global Shift" information ("Edit > Edit Global Shift & Scale") and set all the components to 0

2) with the latest version, you have an new checkbox to "preserve the global shift on save" (bottom left). Simply uncheck it (it's equivalent to manually resetting the Global Shift components).

Once loaded, you can even recenter the cloud more precisely with the manual transformation tool (https://www.cloudcompare.org/doc/wiki/i ... ation_Tool) or the "Apply transformation" tool (https://www.cloudcompare.org/doc/wiki/i ... sformation).
Daniel, CloudCompare admin
muhku
Posts: 4
Joined: Fri May 24, 2019 6:35 am

Re: Moving and rotating a point cloud in e57 format

Post by muhku »

Hi!

Thanks a ton for the reply.

Now that I know what I should be doing, I think I got the hang of it and managed to put a cloud into 0,0,0 for import! Still trying to find out the right x,y,z inputs to get it in the right spot, but I think I'll manage. However I think I know why I struggled - this only seems to work if you do it manually as you explained in part 1).

Part 2) does not work. If I just uncheck the "preserve the global shift on save" box in the opening dialog, then the transformation doesn't seem to work as you explained, or I still didn't understand how it's supposed to work. :) Also the point cloud seems to get corrupted somehow as I only see a handful of the points if I open the point cloud in this way... not sure what is going on.

One more question: The points that are defined in the "global shift" prompts in the blue boxes (point in the original coordinate system (on disk) & point in local coordinate system), on the left hand and right hand side: which points exactly do these refer to?
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Moving and rotating a point cloud in e57 format

Post by daniel »

That's generally the first point encountered in the file.

And for "option 2", after having unchecked the checkbox, have you clicked on "OK"?
Daniel, CloudCompare admin
muhku
Posts: 4
Joined: Fri May 24, 2019 6:35 am

Re: Moving and rotating a point cloud in e57 format

Post by muhku »

Well, the choices in option 2 are "yes", "yes to all" or "no"

I have tried both "yes" and "yes to all" but i don't know what's the difference. When opening the point cloud in this way I only see a handful of the points and they display in parallel vertical dotted lines roughly 5mm apart (lines stay parallel when rotating the cloud). When opening the e57 file with the checkbox checked, the point cloud displays normally.

Just to clarify: if I uncheck "preserve global shift on save", does it mean that if I then save the point cloud, the origin in the saved file should match the "point in local coordinate system" and NOT the "point in original coordinate system (on disk)" as specified in the dialog? Therefore when opening the saved file there should be no dialog saying the coordinates are too big.


I now know the exact amount of meters I have to move the origin in X and Y axis, but unfortunately I'm still having a hard time figuring out where exactly I should input those coordinates in Cloudcompare.

I also have to rotate the cloud a bit around the origin. I trust the "rotation angle, degrees" part in the "apply transformation" dialog rotates the entire cloud with the rotation centre based in the cloud origin?
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Moving and rotating a point cloud in e57 format

Post by daniel »

"yes" means "apply this Global Shift for the currently loaded file".
"yes to all" means "apply this Global Shift for the currently loaded file and the next ones".

If you uncheck the "preserve global shift on save" (which is only taken into account if you click on "yes" or "yes to all"), then the global shift vector is applied at loading time (making the coordinates smaller, and indeed making the first point match the coordinates on the right part of the dialog). Then this shift is forgotten by CC, which means that when you''ll export the cloud again, CC won't know about any previous shift, and will leave the coordinates as is.

I would personally apply - and forgot - a good and coarse Global shift at the beginning, just to make sure the coordinates are not too big and no loss of accuracy will happen. Then I would change the coordinate system (rotation / translation) in CloudCompare as it's easier.
Daniel, CloudCompare admin
muhku
Posts: 4
Joined: Fri May 24, 2019 6:35 am

Re: Moving and rotating a point cloud in e57 format

Post by muhku »

Hi, and thanks for the reply again!
daniel wrote: Sun Jun 02, 2019 2:45 pm I would personally apply - and forgot - a good and coarse Global shift at the beginning, just to make sure the coordinates are not too big and no loss of accuracy will happen. Then I would change the coordinate system (rotation / translation) in CloudCompare as it's easier.
Ok, I will try this! But if you do this, then won't the loss of accuracy happen when exporting the file again? (Since you moved the cloud far away from the CC origin)? Or am I missing something?
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Moving and rotating a point cloud in e57 format

Post by daniel »

No because the rotations will be applied to already shifted (i.e. smaller) coordinates.
Daniel, CloudCompare admin
raitisx
Posts: 6
Joined: Sun Feb 19, 2023 9:54 pm

Re: Moving and rotating a point cloud in e57 format

Post by raitisx »

Hello Daniel,

Hope it is fine to continue thread, problem is also about e57 geometry.

Long story short - I have around a thousand e57 scans of city in 2 versions - registered at scale 1.0 around particular point resulting in accurate, but spatially wrong data; 2nd set are shifted to correct coordinates. Now I want to scale internal structure, so they all fit nicely together. After couple of days of trial and error with Cli and GUI I have come to conclusion, that this is not so easy, or something was missed.
I tried to:
global shift to known pivot point XY, then scale without checkboxes. (clouds registered at 1.0)
global shift each scan center XY (point of origin) to 0,0 and then scale. (shifted clouds)

Visually in CC everything is accurate, but when exported to e57 and loaded in other software, they are all rotated. LAS is fine.
Also when loaded back to CC, they are rotated.
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Moving and rotating a point cloud in e57 format

Post by daniel »

Which version are you using? I have the impression we have fixed something related very recently (in a recent release of the 2.13.alpha version)
Daniel, CloudCompare admin
Post Reply