Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to extract triangles out of mesh geometry
QtWS25 Last Chance

How to extract triangles out of mesh geometry

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 399 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    m3g1dd
    wrote on last edited by m3g1dd
    #1

    I'm creating meshes with Qt3D. I check if the mesh is actually built with triangles:

    qDebug() << "mesh primitive type: " << mesh->primitiveType();
    

    which returns:

    Qt3DRender::QGeometryRenderer::PrimitiveType(Triangles)
    

    Therefore, my mesh primitive type is definitely triangle.


    Now I'm trying to access to triangles of the mesh, but I don't know how. There is the following API to get the data and its type which can be either VertexBuffer or IndexBuffer:

    mesh->geometry()->attributes().at(i)->buffer()->data();
    mesh->geometry()->attributes().at(i)->buffer()->type();
    

    But I don't know how to extract triangles one-by-one using the above APIs. Can anybody help me.


    Eventually, I'm going to export the triangles as STL file with such a format. Is there any API to export mesh as STL? I'm using Qt 5.9.4

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved