Skip to content

Commit 03c103a

Browse files
committed
adjusted rayextract trees to fix a bug where bows of V splitting trees were missing. Also made rayextract_trees_large.sh remove previous sub folders before it fills them
1 parent 876cb89 commit 03c103a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

raylib/extraction/raytrees.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ Trees::Trees(Cloud &cloud, const Mesh &mesh, const TreesParams &params, bool ver
244244
if (clusters.size() > 1 || (points_removed && clusters.size() > 0)) // a bifurcation (or an alteration)
245245
{
246246
extract_from_ends = true; // don't trust the found nodes as it is now two separate tree nodes
247-
// if parent is the root then don't add offshoots as we've already dealt with this better in the iteration block above
248-
bool add_offshoots = par != -1 && sections_[par].parent != -1;
247+
bool add_offshoots = false; // par != -1 && sections_[par].parent != -1; // when this is true it can lead to whole branches missing.
249248
// if points have been removed then this only resets the current section's points
250249
// otherwise it creates new branch sections_ for each cluster and adds to the end of the sections_ list
251250
bifurcate(clusters, thickness, children, false, add_offshoots);

scripts/rayextract_trees_large.sh

100644100755
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# ./rayextract_trees_large cloudname 50
44
set -x
55
raysplit $1.ply grid $2,$2,0 5 # 5 m overlap to avoid edge artefacts. This should be the width of the widest tree.
6+
rm -rf gridfiles_cloud
7+
rm -rf gridfiles_mesh
8+
rm -rf gridfiles_trees
9+
rm -rf gridfiles_segmented
610
mkdir gridfiles_cloud
711
mkdir gridfiles_mesh
812
mkdir gridfiles_trees

0 commit comments

Comments
 (0)