Closed bc closed 5 years ago
Sorry about this - it's due to some flakiness in the stitching algorithm. The problem is that for every point along each side or each tear, the stitching algorithm creates a point in the opposing tear unconditionally. This has the unfortunate side-effect that it can create very short edges.
retistruct.reconstruct(rad)
debugger()
# Choose frame 2
range(r$L)
[1] 1.421085e-14 5.998541e+01
flatplot(r)
points(r$P[r$Cu[which.min(r$L),],])
You should be able to see the two points on either side of the edge are indistinguishable.
This huge range then causes problems for the code that stretches out the mesh points as evenly as it can before the final energy minimisation.
I think the solution is to modify the stitching algorithm so that new points are only created when there are no points within a tolerance (say 1% of tear distance) of the corresponding fractional distance on the opposing tear. This change needs a bit of thought, as the stitching algorithm is probably the most fiddly bit of Retistruct code.
ah I see. There's a step in retistruct that simplifies the outline. Perhaps that step could help us avoid this issue?
It might help, but I think there is still a fundamental problem. This is an issue for others too, so I'm just putting my mind to it now.
I'm working on making the stitching algorithm only add new points when they lie outwith a given tolerance of an existing point. As with everything to do with the stitching algorithm, this is fiddly, so it's taking longer than anticipated.
This fix is in the master (i.e. development) branch that I have just refactored (see #25). I've tested your example and it seems to work. There are a number of things that aren't working in this refactored code - hopefully I will be able to clear up the mess next week.
I'm getting an odd error with reconstruction that I haven't come across. What do I need to change to my data to make it work in this context? I attached the rad object rad.rds.zip and the original files Ntae_381.zip ; here's how to load it into your environment:
Browse[1]> retistruct.reconstruct(rad, report = do_not_print, plot.3d = TRUE)
thanks!