tudelft3d / AdTree

Accurate, detailed, and automatic modelling of laser-scanned trees

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Output list of cylinder fits with cylinder dimensions and connectivity

achmurzy opened this issue · comments

Hello, I am interested in analyzing the fine-scale structure of tree branches with your application. However, there is no way to extract individual cylinders from the output model. All of the cylinders are fused together as a giant mesh. Is there a way to break apart the mesh, or add a flag to export all the cylinders in a row-based format like .csv? Thanks in advance, the outputs of your application are impressive and I'm interested in analyzing trees using it

It looks like I would want to save the output of

bool Skeleton::compute_branch_radius()

rather than moving on to smooth the cylinders into a mesh in

bool Skeleton::smooth_skeleton()

Do you think this would be easy to do? Thanks for listening

Screenshot 2021-05-25 at 23 22 35

It is here (see the above figure). You can obtain either the initial skeleton or the smoothed skeleton, all represented as a graph. Implement your export function there to replace the current one.

Ok, so only the graph-based formats are available right now and I'll have to parse the Graph into a list of cylinders instead of writing it to a .ply mesh. Are you aware if Boost or Easy3D might have an easy way to output a Graph in a row-based file format like .csv? Thank you

In the exported skeleton file (the PLY format), the edges of the graph already store the indices of the two endpoints for all cylinders. The radii information is not recorded since the skeleton is intended to store the topology only and therefore a graph representation.

If you also want to store the radii of all cylinders, the easiest way is to add a per edge attribute to each cylinder. Please refer to the PLY format specification for more details.

Though PLY format is recommended, you can do whatever you like to fulfill your purpose, e.g., save in each line two 3D point coordinates and an extra radius value. This is not a standard format and we will not include it in AdTree.

I will work on this and initiate a pull request if it is working and useful. Thank you again

The issue has been solved so I am going to close it.
Good luck!