4

I would like to generate output to display the numeric data of the Half-Edge Structure that is based from an input of polygonal mesh data (in numeric data form).

The concept to read the polygonal model basically is like this:

For the INPUT, the file is in OFF format and include datas like
(a) First part: the number of vertex, number of face, and number of edge.
(b) Second part: line of each vertex,
(c) Last part: line of each polygonial face.

Example: (based from above)
First part:
4 4 6

Second part:
-1.7 0.0 1.0
1.7 0.0 1.0
0.0 0.0 -2.0
0.0 3.0 0.0

Last part:
3 0 1 2
3 0 3 2
3 3 2 1
3 0 2 3

And, the program must be able to generate following data:

(a) Vertices:
1. vertex index (Total number of vertex input)
2. each x-coordinate, y-coordinate, z-coordinate, and half edge
(b) Half-Edges:
1. half edge index (Total number of half edge to be generated from a.2. above)
2. starting vertex, face, next half edge, and adjacent half edge.
(c) Faces:
1. face index (Total number of face as shown on b.2. starting from 0)
2. half edge.

The concept is like that, no need to display visual graphic but need to use algorithm and generate simple Half-Edge Structure data, then read the OUTPUT file by using Notepad, etc.

Navi Koe Wok
  • 41
  • 1
  • 3
  • Wjat exatcly is the question here? – ccozad Jun 20 '11 at 20:30
  • 1
    Very similar to a previous post - This is a very good answer: http://stackoverflow.com/a/15366479/862531 – mitstudent Jan 10 '14 at 20:51
  • 1
    Possible duplicate of [Initializing Half-edge data structure from vertices](https://stackoverflow.com/questions/15365471/initializing-half-edge-data-structure-from-vertices) – ideasman42 Oct 23 '17 at 03:18

1 Answers1

0

This question consists of two parts:

  1. Reading mesh in OFF file format, which includes reading vertex coordinates
-1.7 0.0 1.0
1.7 0.0 1.0
0.0 0.0 -2.0
0.0 3.0 0.0

and triples of vertex indices per each triangle

3 0 1 2
3 0 3 2
3 3 2 1
3 0 2 3
  1. Half-edge data structure construction from these vertex triples. It is the topic of the question Initializing Half-edge data structure from vertices, where you can find both the explanation and links to exemplar implementations.
Fedor
  • 17,146
  • 13
  • 40
  • 131