Mesh importer: Vertice count on Get Mesh Component

mvesga's picture

Hi all. I'm importing a mesh from a .dae collada file type generated from an .obj in Meshlab. As you can see on the attached image, from the 3D modelling software and in Meshlab too I'm getting a vertex count of 34, but whenever I'm importing into Quartz Composer I'm getting a vertex count of 123 members. Does anybody have a clue why is this happening? How could a I just get the 34 members that I need from the Mesh importer? Thanks!

PreviewAttachmentSize
Screen Shot 2015-12-10 at 17.10.38 (2).png
Screen Shot 2015-12-10 at 17.10.38 (2).png489.5 KB

khenkel's picture
Re: Mesh importer: Vertice count on Get Mesh Component

123 is the actual vertex count - that model has 41 faces with hard edges. That means each triangle has to have 3 distinct vertices because the normals will be different for each vertex. The other software is probably showing the common vertex count, meaning that it counts vertices that share a position but not normal as a single vertex.

mvesga's picture
Re: Mesh importer: Vertice count on Get Mesh Component

Thanks for your reply Khenkel. In my case it wouldn't matter if I would get the common vertex count, I just need to locate those 34 common points and get their corresponding X,Y,Z coordinates. By any chance do you know how the Structure is organised once it's imported into Quartz Composer? I was thinking just to truncate the structure to the first consecutive 34 members or should I sort the structure to extract every third member? Many thanks for your help!

khenkel's picture
Re: Mesh importer: Vertice count on Get Mesh Component

The positions could potentially be in any order, it's the triangles that would follow a pattern. However triangle order is not guaranteed, and they can point to any position index.

What are you trying to accomplish with these positions? Is there a way you could do the same thing without requiring that the positions be unique?

Achim Breidenbach's picture
Re: Mesh importer: Vertice count on Get Mesh Component

Maybe its ok for you to export the 34 vertices to an XML file and read them in separately by an XML importer patch?

gtoledo3's picture
Re: Mesh importer: Vertice count on Get Mesh Component

Maybe khenkel or smokris can answer this definitively, but I have a thought...

...doesn't the simplify function on Kineme3D plugin reduce the info so that shared vertices will just show up as one member in the structure?

It also seems as though you all added a patch which allows one to get the vertex positions from the k3D model importer, correct? (I haven't really used it yet.)

If all that is correct, it can probably be done better with K3D than anything else.

I would recommend for the OP to take a test spin on the demo to make sure that would work though.

Also, it has been awhile since I've used Meshlab, but there may be a built in destructive filter that joins common vertices, and a variety of other simplification filters for that matter. You just do the process, export, check the result...

mvesga's picture
Re: Mesh importer: Vertice count on Get Mesh Component

khenkel wrote:
The positions could potentially be in any order, it's the triangles that would follow a pattern. However triangle order is not guaranteed, and they can point to any position index.

What are you trying to accomplish with these positions? Is there a way you could do the same thing without requiring that the positions be unique?

Hi Khenkel, I just want to pass a continuous string of values through each of this points in order to generate individual Polygon elements that I can queue, iterate and control from each one of this points, so the vertice structure count was giving me a head ache. I know I can label the vertices in a specific order from the 3D modelling software (Rhino in this case) but this information doesn't seem to be contained in the exported structure whenever I convert it to DAE from Meshlab and I can't export directly from Rhino to this format...

mvesga's picture
Re: Mesh importer: Vertice count on Get Mesh Component

Achim Breidenbach wrote:
Maybe its ok for you to export the 34 vertices to an XML file and read them in separately by an XML importer patch?

Achim that's something I haven't tried but it seems like a pain to extract the string of floats from the Meshlab generated XML and them organise them into a structure. I thought the Mesh Importer was doing the job outside of the box :/ I event tried just to export the points as an obj. then import them into Meshlab, and then export the DAE but if I don't include some faces, I can't get anything onto Quartz...

mvesga's picture
Re: Mesh importer: Vertice count on Get Mesh Component

gtoledo3 wrote:
Maybe khenkel or smokris can answer this definitively, but I have a thought...

...doesn't the simplify function on Kineme3D plugin reduce the info so that shared vertices will just show up as one member in the structure?

It also seems as though you all added a patch which allows one to get the vertex positions from the k3D model importer, correct? (I haven't really used it yet.)

If all that is correct, it can probably be done better with K3D than anything else.

I would recommend for the OP to take a test spin on the demo to make sure that would work though.

Also, it has been awhile since I've used Meshlab, but there may be a built in destructive filter that joins common vertices, and a variety of other simplification filters for that matter. You just do the process, export, check the result...

George, thanks for coming back to this discussion topic. I don't have the Kineme 3D plugin... would it still be worth buying it considering that they stopped it's development and continued into Vuo? And I'm not sure about it's compatibility with the latest Xcode version in El Capitan... But the Meshlab approach might be worth a try!

I'll come back to you guys (hopefully with an answer) after I've tried these approaches. Thank you all again for your comments!

dust's picture
Re: Mesh importer: Vertice count on Get Mesh Component

if you make a simple box and export as DAE then open the DAE in TXT and read the info you will learn a bit about the format. sometimes its handy to do this to change the location of your texture file to something relative to your project. also you will see that you have an array of positions and also indices. these positions are not necessarily in QC dimensions. the indices give you the index order of your triangles. unfortunately the get indices patch in QC doesn't report the correct order. your best bet is to use an XML reader patch and traverse until you can access the indices then you can explode the string as a structure and have the index order you need that corresponds with what vertex position you need to access. its not easy but its totally possible to import a DAE model from a XML importer patch. check out this patch and see how degenerate triangles are created and rendered as mesh. http://kineme.net/composition/yone/CubeParticle there is a post i made towards the bottom that uses the XML reader to import a DAE model that is used to generate particles. maybe start with something like simple polygon plane ?