Jump to content
  • Advertisement
Sign in to follow this  
luckyyyyyy

*.stl to triangular data structure, *.ply or *.obj - *.stl issue...

This topic is 2481 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Actually, I want to convert *.stl file format into *.ply or *.obj.
The reason is that, stl file doesn't contain the triangles information. its just contains vertices. (normals is not an issue here..). But I want the triangular information like *.ply or *.obj has.

triangular means..*ply or *obj file format

vertex 0 0 0
vertex 0 1 0
vertex 1 1 0
vertex 1 0 0
face 1 2 3
face 1 2 4

above code has two triangles and 4 vertices. right? but *stl file doesn't contain any kind of face information.

I don't have any issue to read *stl or write *stl ... I can even render the 3D stl model.

My issue is I just want to convert this *.stl file format into *.ply or *obj.
I spent too much time on net but didn't find any kind of code or idea relevant to this. Kindly give me some idea that how can I convert it. How can i extract face information from stl ?

thanks.

Share this post


Link to post
Share on other sites
Advertisement

I don't have any issue to read *stl or write *stl ... I can even render the 3D stl model.

[...]

How can i extract face information from stl ?
So you can read, write, and render an stl model, but can't extract the faces. That makes no sense. I don't know exactly what you want, but MeshlLab seems to do .stl conversions:

http://meshlab.sourceforge.net/

and Wikipedia describes .stl:

http://en.wikipedia....8file_format%29

Share this post


Link to post
Share on other sites
Its really simple... I want to load the *.stl vertices and faces into my *.obj or *.ply data structures.

Following is the data structure that can be used with *.obj or *.ply. But we can not use this data structure for *.stl. For *.stl we do not know the indices information. I want to extract that information. for example triangle (indic1, indic2, indic3). So this the issue to use the same data structure for *.stl.

struct GLpoint
{
float x, y, z;
};
GLpoint *Vertices;

struct GLface
{
unsigned int v1, v2, v3;
};
GLface *indinces;


Thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!