Triangle icon indicating copy to clipboard operation
Triangle copied to clipboard

Invalid .ele file when triangle_write_elements is called before triangle_write_nodes

Open jzarl opened this issue 7 years ago • 2 comments

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?

jzarl avatar Jan 09 '18 21:01 jzarl

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 avatar Jan 10 '18 11:01 wo80

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.

wo80 avatar Jan 10 '18 11:01 wo80