Answers for "Importing edges and vertices only"
http://answers.unity.com/questions/879089/importing-edges-and-vertices-only.html
The latest answers for the question "Importing edges and vertices only"Answer by Cherno
http://answers.unity.com/answers/879374/view.html
Take a look at the mesh class: It has an array of vertices which are just Vertex3s, so basically the positions of the vertices are stores therein. Then you have an array of triangles which are actually references (indices) to the vertices a triangle consists of, stored as three ints.
You can just copy that functionality for your own needs: The vertices are the same of course because you need the coordinates of them. Triangles don't exist here but the edges do (even if theyx are just represented by a Gizmo line or whatever). The edges can be stored the same way triangles do, but with two int references instead of three. So you structure might look like this:
Vector3[] vertices = new Vector3[] {
new Vector3(0,0,0),//position of the first vertex
new Vector3(1,3,2)//position of the second vertex
new Vector3(5,6,2)//...
new Vector3(3,2,0)
};
int[] edges = new int[] {
0,1,//vertex indices for the first edge
1,2,//vertex indices for the second edge
2,3//vertex indices for the third edge
}
It doesn't matter in what order the edges are stores as long as every two indices that go together to form one edge from two vertices are kept together.
Edit: I may have misunderstood your question after reading it again. Edges can't be exported to my knowledge, and since there are no triangles to build a mesh from, you won't have any references of which vertices are connected to form triangles or edges. How would the program know it, anyway? the only way I can think of is to just determine it by going from left to right and using that as a way to put the vertex indices in order to determine edges.Sun, 18 Jan 2015 15:38:09 GMTCherno