Jump to content

  • Log In with Google      Sign In   
  • Create Account


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 luckyyyyyy   Members   -  Reputation: 144

Like
0Likes
Like

Posted 27 February 2012 - 10:15 AM

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.

Sponsor:

#2 Jesse7   Members   -  Reputation: 154

Like
0Likes
Like

Posted 27 February 2012 - 01:39 PM

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
Good judgment comes from experience; experience comes from bad judgment.

#3 luckyyyyyy   Members   -  Reputation: 144

Like
0Likes
Like

Posted 28 February 2012 - 02:14 AM

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.

#4 luckyyyyyy   Members   -  Reputation: 144

Like
0Likes
Like

Posted 29 February 2012 - 06:16 AM

Solved.. I have done it. Now i can import stl and can export ply or obj.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS