Open Raphalex46 opened 4 years ago
That seems fairly doable, this picture is very useful, thank you.
After looking at the structure of fruit points and the skeleton, it's a lot harder than it looks.
There are multiple approaches for this problem, here are the ones I thought about :
Consider only the vertical axis: since plants usually go up, consider only the vertical axis to see which points of the skeleton are between 2 nodes. This solution is not robust since some plants might have organs that go sideways or something.
Check equality between skeleton and fruit points: From what I tested, skeletons and fruit points can "collide", that means that if the skeleton points are ordered in the direction of the plant, we can start coloring the skeleton when we encounter a node, and stop when we encounter the next node. This is a good and robust solution, but no luck: the skeleton points aren't ordered correctly:
In this image, skeleton sections are colored according to their index in the array they are stored in. Since the colors are jumping around a lot (like red next to blue and things like that), that means that the index number doesn't have anything to do with the position of the section on the skeleton.
Compute the equation of a line between 2 nodes, and color every skeleton point that is near this line. This is quite a robust solution, except in the case where the skeleton does weird things and isn't very straight. This is also the heaviest solution. This unfortunately isn't possible either: Each fruit is made of multiple points (not always the same number, from what I've seen, it goes from 3 to 20 points usually). In order to draw the fruits, lines are drawn between the points. However, the points don't seem to be organized :
In this image, the last line (which links the last 2 points of each fruit) is drawn in red. As you can see, for one fruit, it's near the extremity, and for the other it's near the node.
An internode is the portion of the skeleton which is between two organs -optional activation via another icon (topleft corner) -same options of color choice than other 3D elements, especially organs
BetterPlantVis