Closed rschwarz closed 4 years ago
Turns out that it was failing because I passed the wrong flags to Triange (no convex hull segments).
Hi, thanks! I am just checking: it is sufficient to do
ctio.numberofsegments=size(tio.segmentlist,2)
if ctio.numberofsegments>0
ctio.segmentlist=pointer(tio.segmentlist)
if size(tio.segmentmarkerlist,1)>0
@assert size(tio.segmentmarkerlist,1)==ctio.numberofsegments
ctio.segmentmarkerlist=pointer(tio.segmentmarkerlist)
end
end
as triangle itself handles the case of missing markers (and I want to stay as close to it as possible).
If you don't want to modify your pull request I could modify this, preferably with together with another example.
Yes, that also works, and I pushed it now.
That's the change I tried initially, but the tests failed and I did not immediatly figure out how to get more output from the tests.
In the docstring for
TriangulateIO
, it says:So I thought that I could supply only
segmentlist
, withoutsegmentmarkerlist
. But this actually fails when converting toCTriangulateIO
.I've added a (failing) test, and tried to change the behavior, to match the documentation. But it's still failing and I'm not sure how, because the test output only tells me that there was an ERROR.
I guess this managing of default values would be easiest to implement in an external constructor, but the
TriangulateIO
struct is explictly mutable, so it's difficult to check the invariant (ifsegmentlist
is given,segmentmarkerlist
must also be given).