wo80 / Triangle

CMake project for Jonathan Shewchuk's Triangle mesh generator.
Other
63 stars 26 forks source link

Invalid .ele file when triangle_write_elements is called before triangle_write_nodes #23

Open jzarl opened 6 years ago

jzarl commented 6 years ago

The fact that triangle_write_nodes() needs to be called before triangle_write_elements() was quite surprising to me.

It would be nice if this (and other dependencies, if they exist) were documented. Maybe it would even be possible to have the functions check for this automatically and fail if called in the wrong order?

wo80 commented 6 years ago

Sure, this should be documented. The writenodes method is responsible for numbering the nodes. The original Triangle code uses the nonodewritten field of the behavior struct to check if it was called, otherwise the numbernodes method is called. I removed the field, but I guess it's the easiest way to restore this feature.

Regarding other dependencies: I've opened another IO related issue in #24

wo80 commented 6 years ago

Additionally, numbering the nodes is done by using setvertexmark. So, if this field of the vertex data structure is actually used as intended (as an integer boundary marker), there should be some way to restore the original information after numbering.