Skip to main content
. 2020 Dec 15;20(24):7181. doi: 10.3390/s20247181
Algorithm 1. Spatial Topological Relation Analysis Algorithm.
Input: 3D point cloud of each object
Output: The spatial topological relations between the objects
Initialize: Create convex hull and AABB of each object from point cloud
begin
for each object A do
for each object B do
for each point ai  in object A do
if ai is not in BoxB
then AB°=, AB= and AB=¬ continue
 Compute the relative position of p by formula (4)
      Check AB°, AB and AB for loop termination
end
end
end
for each object A do
for each object B do
if AB°=¬ and A°B=¬ then RAB=cross
else if A°B=
if AB= then RAB=within
else RAB=partial within
else if AB°=
if AB= then RAB=contain
else RAB=partial contain
else if AB°=, AB=¬, A°B= and AB=¬
      then RAB=touch
else RAB=disjoint
end
end
end