Accelerating Evolutionary Construction Tree Extraction via Graph Partitioning
ABSTRACT
Extracting a Construction Tree from potentially noisy point clouds is an important aspect of Reverse Engineering tasks in Computer Aided Design. Solutions based on algorithmic geometry impose constraints on usable model representations (e.g. quadric surfaces only) and noise robustness. Re-formulating the problem as a combinatorial optimization problem and solving it with an Evolutionary Algorithm can mitigate some of these constraints at the cost of increased computational complexity. This paper proposes a graph-based search space partitioning scheme that is able to accelerate Evolutionary Construction Tree extraction while exploiting parallelization capabilities of modern CPUs. The evaluation indicates a speed-up up to a factor of compared to the baseline approach while resulting tree sizes increased by to .
Keywords
-d Reconstruction, Reverse Engineering, Computer Aided Design, Constructive Solid Geometry, Evolutionary Algorithms, Graph Theory
- CSG
- Constructive Solid Geometry
- CAD
- Computer Aided Design
- GA
- Genetic Algorithm
- RE
- Reverse Engineering
- BRep
- Boundary Representation
- PO
- Primitive Overlap
- AABB
- Axis-Aligned Bounding Box
- OBB
- Oriented Bounding Box
- BKA
- Bron-Kerbosch Algorithm
- RANSAC
- Random Sample Consensus
1 Introduction
Reverse Engineering (RE) – i.e., the recovery of a model’s geometric representation from potentially noisy and incomplete sensor data – is an important aspect of modern Computer Aided Design (CAD) pipelines. It allows for convenient model editing based on real-world physical objects, thus simplifying and accelerating the product design process. An expressive and intuitive model representation scheme extensively used in solid modeling is Constructive Solid Geometry (CSG). It describes complex rigid solids by a binary tree with regularized Boolean set-operations (e.g., union, intersection, subtraction) as inner nodes and primitive solids (e.g., cubes, spheres, cylinders and cones) as leaves.
[b]
Such a tree is also known as a model’s Construction Tree.
Due to the popularity of CSG in CAD, it is desirable to have tools at hand that are able to reliably recover a model’s CSG-tree from its point cloud representation stemming from sensor recordings.
CSG-tree generation might be solved by converting the input point cloud to a Boundary Representation (B-rep) and then by conversion of the B-rep to CSG with methods based on algorithmic geometry that usually require exact geometric intersection computations [SV93, BC04].
These approaches are usually restricted to a single model representation for primitives, e.g. a surface description that uses quadrics, and can be sensitive to inexact representations.
To overcome these constraints, CSG-tree generation can be formulated as a combinatorial optimization problem over the possible permutations of primitives and set-operations for a fixed maximum CSG-tree depth.
Metaheuristics, like Genetic Algorithms can then be employed for optimization [Mit98].
One of the most severe disadvantages of GA-based solutions are computation times of minutes and hours for comparably small models (less than primitives) [FP16].
This issue is addressed in this paper.
The basic idea of the described acceleration scheme is to exploit spatial relationships between primitives:
Primitives that do not overlap spatially are not considered to be operands of a CSG-operation.
This knowledge can be used to partition overlapping primitives and to compute partial per-partition results that are later on merged into a single CSG-tree.
In particular, this paper makes the following contributions:
-
•
An acceleration scheme based on spatial search space partitioning together with a robust merge mechanism.
-
•
A description and analysis of parallelization strategies for the proposed algorithms.
The paper has the following structure: Section 2 discusses related work in the field of CSG-tree extraction and surface reconstruction. It is followed by an introduction to the theoretical principles of the proposed method (Section 3). The problem to solve is detailed in Section 4. The proposed solution is described in Section 5 and evaluated in Section 6. Section 7 summarizes the results and sketches possible future work.
2 Related Work
This work is related to different domains such as surface reconstruction from discrete point clouds, Reverse Engineering of solid models and conversion from B-rep to CSG. In this section, important related work in these domains is briefly discussed.
2.1 Surface Reconstruction
The problem of reconstructing a surface from a discrete point cloud has been the subject of much attention in computer graphics. The most popular methods include fitting implicit surfaces such as [OBA+03], or Poisson surface reconstruction [KH13], among others. The recent work of Berger et al. [BTS+17] presents a wide survey of the topic. Using these methods, the reconstructed objects lack information that can be used for inspection or re-use of the object in further modeling.
2.2 Reverse Engineering and B-rep to CSG Conversion
The goal of Reverse Engineering is the creation of consistent geometric models from point cloud data [VMC97, BMV01].
They usually output B-rep models made of parametric patches.
The conversion from B-rep to CSG was first investigated
for two-dimensional, linear polygons, then
later extended by Shapiro et al. for handling curved polygons [SV91b, Sha01].
The extension to three-dimensional objects was initially solved
by Shapiro and Vossler in
[SV91a, SV93]
and later improved by
Buchele and Crawford in [BC04].
These works rely on the fact that surfaces are composed of quadric surface patches.
Another issue is the handling of inexact representations.
These methods work under the assumption that the patches form a clean partition of the
target solid. However, in practice, we are dealing with input point clouds that are potentially
noisy, contain holes, or have additional details and thus the fitted primitives may not fit perfectly.
This could impact the cellular classification on which these methods rely.
2.3 Point Cloud to CSG Construction
In [XF14], a greedy approach is used to build a CSG-representation with cuboids as primitives. This approach is limited to the reconstruction of buildings. Close to the proposed approach are methods that handle noisy and incomplete point clouds such as [SWK07] for fitting primitives and methods that try to convert them to a higher level representation such as [FP16], see also [BTS+17, Sections 7 and 8]. One of the goals of this work is to improve the running time of the Evolutionary Algorithm used in [FP16] via geometric consideration, i.e. the overlapping in space of primitives.
3 Background
3.1 Point Cloud to CSG-Tree Pipeline
The extraction of a CSG-tree from a point cloud poses a complex problem which is usually solved with a processing pipeline that comprises the following steps:
-
1.
Point cloud generation and pre-processing: Point clouds are generated by laser scanners or tactile measurement devices. Other techniques use photogrammetric algorithms to gather depth information from (un-)calibrated camera images [HZ03]. Measured point clouds usually contain significant amounts of noise and outliers. These can be trimmed from the data-set using e.g. statistical approaches [RC11].
-
2.
Point cloud segmentation and primitive fitting: The point cloud must be segmented and primitive parameters have to be fitted to the corresponding points. Approaches that fulfill both tasks for simple geometric shapes are e.g. specialized variants of the Random Sample Consensus (RANSAC) technique [SWK07].
- 3.
- 4.
3.2 Primitive Description
Primitives are basic shapes located at CSG-tree leaves. A primitive is fully described by its signed distance function . The surface of is implicitly defined by the zero-set of : . Its surface normal at point is given by the gradient . If the gradient does not exist at or is too expensive to compute, finite difference approximations can be used.
3.3 Boolean Set-Operations
The set-operations intersection, union, complement and subtraction are implemented using - and -functions [Ric73]:
-
•
Intersection:
-
•
Union:
-
•
Complement:
-
•
Subtraction:
where is the solid corresponding to the set (). In the following, the considered Boolean set-operations are intersection, union, complement and subtraction.
3.4 Evolutionary Algorithms
Evolutionary Algorithms are biology-inspired, stochastic metaheuristics for solving optimization problems [ES+03].
The optimization process starts with a randomly initialized population of individual candidates sampled from the problem’s search space (initialization).
In each iteration, candidates are ranked according to their fitness by evaluating the so-called fitness function.
The best candidates are selected to be the next generation’s parents (parent selection).
Parents are then recombined (crossover) and mutated (mutation) to create offspring.
The new population is then filled with the offspring together with selected surviving individuals (survivor selection) from the current population.
This procedure is repeated until a certain termination criteria is met (termination).
See Fig. 1 for an overview.
Evolutionary Algorithms are especially useful for solving combinatorial optimization problems [ES+03].

4 Problem Statement
The problem of accelerating GA-based CSG-tree extraction from point clouds is considered as the open research question addressed by this paper.
The focus is on CSG-tree generation and optimization (step and of the pipeline detailed in Section 3.1).
As input, a point-set of potentially noisy -d measurements of a connected geometric model is considered. We also assume that the point-set is already segmented with fitted primitives, using techniques depicted in step and of the pipeline described in Section 3.1.
The desired output is a CSG-tree that represents the scanned real-world model as accurately as possible.
A measure for accuracy is given by the distance between the CSG-tree induced surface and the points of the input point cloud.
CSG-tree extraction approaches based on a GA [FP16] can handle
inaccuracies but come with the disadvantage of potentially high computation times.
5 Concept
The basic idea for accelerating CSG-tree extraction is to partition the search space into independent groups of spatially overlapping primitives.
This exploits the fact that primitives that do not overlap are not considered to be operands of a CSG-operation.
CSG-tree extraction is then conducted on a per-partition level.
Finally, resulting trees are combined in a subsequent merge step without loss of result quality and correctness.
An overview of the full CSG-tree extraction pipeline is depicted in Fig. 2.
Each of the steps is described in detail in the following sub-sections, following the order of execution.
5.1 Primitive Overlap Graph Generation
For expressing spatial relationships between primitives, the Primitive Overlap (PO)-graph is introduced.
It represents spatial overlap between primitives using an undirected graph , where is the set of primitives as vertices and is the edge-set that contains -tuples of overlapping primitives , where with .
The PO-graph is generated based on the location, orientation and geometric shape of the primitives, see Fig. 2(b).
Complex shapes can be approximated with simpler bounding volumes like Oriented Bounding Boxes or the convex hull of the corresponding point-set [PH77].
For better scalability, the computational complexity can be reduced from (overlap check between each primitive and each other primitive) to using hierarchical space partitioning schemes like e.g. Octrees [Mea82].
5.2 Search Space Partitioning
With known primitives and their spatial relations given by the PO-graph, the goal is now to find independent search space partitions.
A partition is a set of primitives in which each primitive has an overlap with each other primitive.
In this context, independence means that per-partition solutions are not influenced by the solutions of other partitions.
See Fig. 3 for explanatory examples.
The problem of finding all independent search space partitions is equivalent to the problem of finding all maximum complete subgraphs (maximum cliques) in .
For finding the set of maximum cliques in , the Bron-Kerbosch Algorithm (BKA)[BK73] is employed due to its behavior on random graphs:
It was experimentally shown in [BK73] that the computational complexity of BKA is almost independent of graph size for random graphs.
In a worst case scenario (using Moon-Moser Graphs [MM65]), computational complexity is proportional to , where is the size of the graph.
Note that, if there is only a single partition for a particular PO-graph, the search space partitioning method degenerates to standard GA-based CSG-tree extraction.


5.3 Per-Partition CSG-Tree Extraction
With known partitions, CSG-tree extraction is conducted for each partition separately in a divide-and-conquer manner. A variant of the GA described in [FP16] is used with the objective function
(1) |
where is the tree candidate, is the point-set corresponding to the partition’s primitives and is the number of nodes in tree weighted by a factor .
is the signed distance between point and the surface defined by tree weighted by a factor .
is the angle between the point normal and the normalized gradient at position weighted by a factor .
and are user-controlled parameters.
The first term in Equation 1 (under the sum) estimates how close the surface induced by matches the point cloud, while the second term penalizes trees with a large number of nodes.
The given objective function has to be maximized for .
Initially, the population is filled with randomly generated trees with a height .
For the maximum tree height, the approximation
(2) |
is used, where is the number of primitives in the partition.
It is based on the average height of binary trees for a given number of internal nodes [FO82] and achieved good results in all experiments carried out.
Each GA iteration contains the following steps:
-
1.
The population of the previous iteration is ranked according to Equation 1.
-
2.
The current population is initialized with the best candidates from .
-
3.
As long as has not reached maximum population size , two candidates are selected from via Tournament Selection parameterized with (the size of the set of randomly chosen population members from which the best member is selected) [MG95]. During crossover, the two selected candidates exchange randomly selected subtrees with a probability of . Then, with a probability of , each resulting tree is mutated. Either a randomly chosen subtree is replaced with a new randomly generated subtree with a probability of . Or, with a probability of , the whole tree is replaced with a new randomly generated tree.
-
4.
The termination condition is met if the score of the best CSG-tree candidate of an iteration does not improve over iterations.
The most computationally expensive step in GA-based CSG-tree recovery is the evaluation of Equation 1 for each element of a candidate-set. Since evaluations can be conducted for each candidate independently, parallel processing schemes can be applied efficiently. In addition, the solution space partitioning allows for a per-partition parallelization strategy. Both options were implemented for multi-core processors. Their evaluation is discussed in Section 6.
5.4 Merge of Per-Partition Trees
Merging all trees corresponding to partitions into a single tree is not trivial. A simple union of all tree root nodes may lead to incorrect results if primitives that are part of multiple cliques are not splitted. Split operations on arbitrary primitive shapes tend to be complex and should be avoided. See Fig. 4 for examples. The proposed merge strategy does not need splits but instead tries to merge trees with a subtree in common. Result correctness is given since no additional operations are introduced and operation order is preserved. The strategy consists of the following steps:
-
1.
All trees are inserted in a list without any specific order. Extracted trees might contain artefacts affecting their mergeability (e.g., intersections with the same primitive for both operands). For each tree in , artefacts are removed by traversing the tree and replacing found patterns iteratively with their simplifications (e.g., replacing with ). The process ends if no more artefacts can be removed.
-
2.
Two trees and are removed from the head of , and their largest common subtree is computed (with a computational complexity of ). The subtree’s leaf-set must be a subset of the leaf-sets of both, and . The largest common subtree found might exist more than once in both trees. Thus, the root nodes of each appearance of the subtree in and are stored in the lists and (see Fig. 5(a)).
If is empty, is appended to and a new tree candidate is removed from the head of . In this case, the largest common subtree search is repeated with the new . -
3.
For each node in and , we check if it is a valid merge candidate by traversing the corresponding tree ( or ) from root node to leaves following Algorithm 1. If the node can be reached this way, it is considered a valid merge candidate. The node is then replaced by the root of the other tree resulting in a merged tree . If more than one valid candidate exists, the candidate corresponding to the larger tree is replaced by the root of the smaller tree. If both trees are of the same size, the candidate of is chosen (see Fig. 5(b)).
If there is no valid merge candidate, the procedure is repeated with the next smaller common subtree in and . If no other common subtree exists, is replaced by a new tree candidate from the head of . Then, the largest common subtree search and its subsequent steps are repeated with the new . -
4.
The merged tree is prepended to .
-
5.
The merge process continues until there is only a single node left in . Since the model to reconstruct is connected, a pair of mergeable trees exists in each iteration. Thus, the merge process always terminates.






The merge process has an asymptotic computational complexity of since in the worst case has to be traversed for each merge.
6 Evaluation
The proposed partitioning scheme has been evaluated on a laptop with quad core CPU and GB of RAM on four different models. For models M, M and M, point clouds were generated by sampling a pre-defined CSG-model that served as ground-truth. Gaussian noise was added to the points to simulate measurement errors. Model M is based on real measurements, and primitive fitting was done with RANSAC [SWK07]. See Fig. 10 for the intermediate steps results for model M, and Fig. 11 for point clouds and renderings for models M, M and M. Table 1 depicts model details.
M0 | M1 | |
# Primitives | 17 | 4 |
# Points (low) | 11.3k | 9.3k |
# Points (high) | 156.4k | 158.4k |
# Partitions | (0,8,4,0,1,1) | (0,0,2) |
M2 | M3 | |
# Primitives | 29 | 18 |
# Points (low) | 10.9k | - |
# Points (high) | 155.4k | 55.8k |
# Partitions | (0,0,0,12) | (0,7,4,1) |
The baseline is the GA approach proposed in [FP16] and described in Section 5.3. The parameter-set used for both, baseline and partitioning scheme, is listed in Table 2. The following combinations were evaluated:
-
•
Baseline: Single-threaded (BST), multi-threaded GA (BMTGA).
- •
Parameter Name | Value |
---|---|
Population size | 150 |
# Best parents | 2 |
Crossover probability | 0.3 |
Mutation probability | 0.3 |
Subtree replacement probability | 0.5 |
Tournament selection parameter | 2 |
Tree size weight | |
Distance weight | |
Angle weight | |
# Iterations w/o quality increase | 10 |
Maximum tree height | see Eq. 2 |
6.1 Computation Times
Timings for baseline and search space partitioning variants were measured for all models with high- and low-detail sampling (except for model M for which only a single point cloud exists).
Measurements vary significantly for the same benchmark setting due to the stochastic behavior of GA-based methods.
In order to deal with this variance, each experiment was repeated times.
In the following, timing results for all methods in combination with high-detail sampling are discussed.
See Fig. 6 and 7 for an overview of the results.
For model M, SMTGA is the fastest method.
It outperforms the baseline by a factor of (single-threaded, BST) and (multi-threaded, BMTGA) on average.
For model M, search space partitioning performs worse than baseline:
The fastest baseline method (BMTGA) is on average times faster than the best-performing search space partitioning variant (SMTGA).
This can be explained by the relatively small number of primitives () and partitions () in model M, which reduces the need for partitioning.
For model M, single-threaded partitioning is times faster than single-threaded baseline and multi-threaded partitioning variants are between and times faster than multi-threaded baseline.
The considerable difference is due to the relatively high number of partitions () and their equally distributed size (all contain primitives).
For model M, SMTGA is again the fastest method.
Compared to multi-threaded baseline it is times faster on average.
Search space partitioning with GA parallelization (SMTGA) is in general faster than their per-partition counterparts (SMTP, SMTPGA) for all models.
This is due to the granularity and regularity of the parallelization:
For SMTGA, the task of ranking a population can be splitted into parts, with each part having similar execution times.
For per-partition variants, granularity is determined by the (potentially lower) number of partitions, and per-partition execution times may vary significantly depending on partition sizes.
Results for per-partition variants do not show timings for the different pipeline steps since in all experiments, per-partition CSG-tree extraction is by far the most dominant factor.
Timings for PO-graph generation, search space partitioning and tree merge make less than of the total runtime.
6.2 Tree Sizes and Depths
Fig. 9 contains average depths and sizes of resulting trees for baseline and partitioning variants.
For the latter, tree depths have increased by (model M) to (model M) compared to the input tree, while for baseline approaches, an increase of (model M) to (model M) is visible.
Tree sizes show similar behavior:
Partitioning variants produce (model M) to (model M) larger trees, while baseline approaches increase tree size by only (model M) to (model M).
Comparing tree sizes between partitioning and baseline approaches directly reveals that the former results in (model M) to (model M) larger trees.
This adverse behavior shown by partitioning variants is due to the final merge step:
In each iteration, the two trees that are close to each other in the tree list and have a common subtree of at least size are merged instead of the two trees with the largest common subtree of all tree pairs in the merge list.
Since the focus of this work is on performance, this is acceptable.
In addition, the tree optimization strategy described in Section 5.4 (step ) was also applied to baseline results for better comparability, which has positive impact on resulting tree depths and sizes.
6.3 Scalability with Respect to Point Cloud Size
Fig. 8 depicts measurement results for the ratio
(3) |
which quantifies the dependency between point cloud size and corresponding computation times. It indicates that, for larger models (model M and M), the fastest partitioning approach scales up to times better than the best performing baseline approach with respect to point cloud size.




7 Conclusion
In this work, a technique for accelerating an Evolutionary Algorithm for extracting
a CSG-tree from a point cloud was proposed. It is based on a partitioning of the search space obtained
from computing the maximum cliques of a graph of overlapping primitives, and on merging CSG-trees
extracted for each partition.
The experimental evaluation indicated a significant speed-up over the baseline approach (the Evolutionary Algorithm) for different modes of parallelization.
One possible direction for future work is
the implementation of the GA for massively parallel computing hardware, combined with the proposed partitioning approach.
A decreased tree size in the partitioning approach could also be achieved by improving the merge process.
Finally, since the partitioning (and merge) approach described in this work is independent of the technique used for the CSG-tree construction, the same approach could potentially be used with the CSG-tree conversion approaches in [SV91a, BC04].












REFERENCES
- [BC04] Suzanne F Buchele and Richard H Crawford. Three-dimensional halfspace constructive solid geometry tree construction from implicit boundary representations. Computer-Aided Design, 36(11):1063–1073, 2004.
- [BK73] Coen Bron and Joep Kerbosch. Algorithm 457: finding all cliques of an undirected graph. Communications of the ACM, 16(9):575–577, 1973.
- [BMV01] Pál Benkő, Ralph R Martin, and Tamás Várady. Algorithms for reverse engineering boundary representation models. Computer-Aided Design, 33(11):839–851, 2001.
- [BTS+17] Matthew Berger, Andrea Tagliasacchi, Lee M Seversky, Pierre Alliez, Gael Guennebaud, Joshua A Levine, Andrei Sharf, and Claudio T Silva. A survey of surface reconstruction from point clouds. Computer Graphics Forum, 36(1):301–329, 2017.
- [ES+03] Agoston E Eiben, James E Smith, et al. Introduction to evolutionary computing, volume 53. Springer, 2003.
- [FO82] Philippe Flajolet and Andrew M. Odlyzko. The average height of binary trees and other simple trees. J. Comput. Syst. Sci., 25:171–213, 1982.
- [FP16] Pierre-Alain Fayolle and Alexander Pasko. An evolutionary approach to the extraction of object construction trees from 3d point clouds. Computer-Aided Design, 74:1–17, 2016.
- [HZ03] Richard Hartley and Andrew Zisserman. Multiple view geometry in computer vision. Cambridge university press, 2003.
- [KH13] Michael Kazhdan and Hugues Hoppe. Screened poisson surface reconstruction. ACM Trans. Graph., 32(3):29:1–29:13, July 2013.
- [Mea82] Donald Meagher. Geometric modeling using octree encoding. Computer Graphics and Image Processing, 19(2):129 – 147, 1982.
- [MG95] Brad L Miller and David E Goldberg. Genetic algorithms, tournament selection, and the effects of noise. Complex Systems, 9:193–212, 1995.
- [Mit98] Melanie Mitchell. An introduction to genetic algorithms. MIT press, 1998.
- [MM65] John W Moon and Leo Moser. On cliques in graphs. Israel Journal of Mathematics, 3(1):23–28, Mar 1965.
- [OBA+03] Yutaka Ohtake, Alexander Belyaev, Marc Alexa, Greg Turk, and Hans-Peter Seidel. Multi-level partition of unity implicits. ACM Trans. Graph., 22(3):463–470, 2003.
- [PH77] Franco P. Preparata and Se June Hong. Convex hulls of finite sets of points in two and three dimensions. Communications of the ACM, 20(2):87–93, 1977.
- [RC11] Radu Bogdan Rusu and Steve Cousins. 3d is here: Point cloud library (pcl). In Robotics and automation (ICRA), 2011 IEEE International Conference on, pages 1–4. IEEE, 2011.
- [Ric73] A. Ricci. A constructive geometry for computer graphics. The Computer Journal, 16(2):157–160, 1973.
- [Sha01] Vadim Shapiro. A convex deficiency tree algorithm for curved polygons. International Journal of Computational Geometry & Applications, 11(02):215–238, 2001.
- [SV91a] Vadim Shapiro and Donald L Vossler. Construction and optimization of csg representations. Computer-Aided Design, 23(1):4–20, 1991.
- [SV91b] Vadim Shapiro and Donald L Vossler. Efficient csg representations of two-dimensional solids. Journal of Mechanical Design, 113(3):292–305, 1991.
- [SV93] Vadim Shapiro and Donald L Vossler. Separation for boundary to csg conversion. ACM Transactions on Graphics (TOG), 12(1):35–55, 1993.
- [SWK07] Ruwen Schnabel, Roland Wahl, and Reinhard Klein. Efficient ransac for point-cloud shape detection. Computer graphics forum, 26(2):214–226, 2007.
- [VMC97] Tamás Várady, Ralph R Martin, and Jordan Cox. Reverse engineering of geometric models-an introduction. Computer-Aided Design, 29(4):255–268, 1997.
- [XF14] Jianxiong Xiao and Yasutaka Furukawa. Reconstructing the world’s museums. International Journal of Computer Vision, 110(3):243–258, Dec 2014.