asmaloney / MeshIO

CloudCompare plugin for loading COLLADA, glTF, and IFC-SPF 3D models
BSD 3-Clause "New" or "Revised" License
32 stars 1 forks source link
3d-mesh cloudcompare cloudcompare-plugin collada file-format gltf ifc

CloudCompare Plugin License

MeshIO

This is a plugin for CloudCompare for reading 3D model files (meshes). It uses the Open Asset Import Library (Assimp).

Currently MeshIO supports reading the following formats:

Requirements

MeshIO has two requirements that are currently different from CloudCompare itself:

  1. CMake >= 3.22
  2. C++17 compiler

Building

Unfortunately, because of the way CloudCompare is set up, you have to build all of CloudCompare before you can build a plugin for it. So the first thing to do is to get the CloudCompare source and build CloudCompare.

Once you have it building properly:

Note: If you are building for CloudCompare 2.11.x, use the tagged version of MeshIO at cloudcompare-2.11.x

Adding Another Format

As long as it is a format supported by Assimp, getting the basics implemented is fairly straightforward (a bunch of copy-paste).

For example, to add a new format "Foo":

This should result in the basic geometry and materials being loaded.

Next Steps

You may need to massage the data a bit to make it suitable for working with in CloudCompare. For example the IFC importer cleans up some naming, and you might need to clean up object hierarchies. This can be done by overriding mioAbstractLoader::_postProcess().

Once you have it working, please consider contributing it using a pull request.

Caveat

This plugin is using another library to read these file formats. There will be problems with some files (e.g. IFC-SPF is not 100% implemented). It also means that some mesh names might be lost when importing some formats.

Because this plugin is basically translating the Assimp data into something CloudCompare understands, it can be tricky to figure out where the problem lies since it could involve any or all of the three components.

If you find files that do not work as expected, please add an issue here and attach the smallest example you have that isn't working. I will try to assess where the problem lies and either report it to the Assimp project or CloudCompare project as necessary.

Icon

The icon is by qubodup (Public Domain).

License

This project is licensed under the BSD 3-Clause license - see LICENSE file for details.

Individual source files contain the following tag instead of the full license text:

SPDX-License-Identifier: BSD-3-Clause

This enables machine processing of license information based on SPDX License Identifiers.