Save all entities in command-line mode?

Feel free to ask any question here
Post Reply
jselikof
Posts: 2
Joined: Sun Jul 06, 2025 3:18 am

Save all entities in command-line mode?

Post by jselikof »

Three solutions proposed by ChatGPT, none work!

CloudCompare -SILENT \
-O cloud1.las \
-O cloud2.las \
-O mesh1.obj \
-MERGE_CLOUDS \
-SAVE_CLOUDS FILE "combined_scene.bin"
🔹 What this does
✅ Loads two point clouds and a mesh.
✅ Merges all point clouds into one (optional — remove -MERGE_CLOUDS if you want separate point clouds).
✅ Saves all entities currently loaded — including point clouds and meshes — into a single CloudCompare .bin file named combined_scene.bin.

CloudCompare -SILENT -AUTO_SAVE OFF \
-O cloud1.las \
-O mesh1.obj \
-SAVE FILE "combined_scene.bin"

🔹 What this does:

Loads the point cloud and the mesh into the DB tree.
Tells CloudCompare not to autosave partial results (-AUTO_SAVE OFF).
Explicitly saves all currently loaded entities to the .bin file.

CloudCompare -SILENT \
-O cloud1.las \
-O mesh1.obj \
-o combined_scene.bin

🔹 How it works:
The -O options load your clouds and meshes.
The lowercase -o combined_scene.bin sets the output .bin file for all currently loaded entities.
CloudCompare automatically writes all entities (point clouds + meshes) to the specified .bin.

Link to the chat if interested: https://chatgpt.com/share/6869ea2b-6a24 ... f48f2cf12a
daniel
Site Admin
Posts: 8158
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Save all entities in command-line mode?

Post by daniel »

Ah ah, ChatGPT is not that smart apparently ;)

If you want to mix clouds and meshes, I don't think it's possible. At least not with the command line mode. Anyway only the BIN format would work in this case.

But if you want to save the clouds and the vertices of the mesh for instance, you could use -EXTRACT_VERTICES first, and then -ALL_AT_ONCE to save all the clouds in a single file (but once again, not all formats support that, maybe BIN and E57).
Daniel, CloudCompare admin
jselikof
Posts: 2
Joined: Sun Jul 06, 2025 3:18 am

Re: Save all entities in command-line mode?

Post by jselikof »

Thanks for the reply!

In this case .bin would be great. Basically, there are 1 to 10 point clouds, and any number of small wireframe meshes representing camera orientation where photos were taken. Unfortunately the meshes are too sparse to use their vertices. There could be e.g. 20 of these, so it's too cumbersome to apply transformations to these in the UI, command-line mode seemed perfect in this case.

Since a .bin with the point clouds and meshes can be saved in the UI, there's no fundamental reason why this couldn't also be enabled in the command-line, is there?

Best regards,

Jim
daniel
Site Admin
Posts: 8158
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Save all entities in command-line mode?

Post by daniel »

There was no reason, just no use case so far! We can add this idea to the TODO list (which is sadly already very long).
Daniel, CloudCompare admin
Post Reply