Wie bekomme ich ColorGrohup & Farbinformationen aus .3mf -Dateien?

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Wie bekomme ich ColorGrohup & Farbinformationen aus .3mf -Dateien?

by Anonymous » 09 Apr 2025, 02:55

bool SceneObjectsManager::readFrom3mf(const char * filename, QList& triangles){
try {

Lib3MF::PWrapper wrapper = Lib3MF::CWrapper::loadLibrary();
Lib3MF::PModel model = wrapper->CreateModel();
Lib3MF::PReader reader = model->QueryReader("3mf");
//reader->ReadFromFile(filename);
reader->ReadFromFile(QString::fromLocal8Bit(filename).toStdString());

Lib3MF::PMeshObjectIterator meshIter = model->GetMeshObjects();
while (meshIter->MoveNext()) {
Lib3MF::PMeshObject mesh = meshIter->GetCurrentMeshObject();

Lib3MF_uint64 vertexCount = mesh->GetVertexCount();
std::vectorvertices(vertexCount);
mesh->GetVertices(vertices);

Lib3MF_uint64 triangleCount = mesh->GetTriangleCount();
std::vectorindices(triangleCount);
mesh->GetTriangleIndices(indices);

for (const auto& index : indices)
{
GeomTriangle triangle;
for (int i = 0; i < 3; i++)
{
Lib3MF::sPosition vertex = vertices[index.m_Indices];
triangle._vertex = QVector3D(vertex.m_Coordinates[0],
vertex.m_Coordinates[1],
vertex.m_Coordinates[2]);
}
triangles.append(triangle);
}

}
return true;
}
catch (Lib3MF::ELib3MFException& e) {
qDebug()

Top