ASPL User Guide v 1.00
© 2025 Bassem W. Jamaleddine
22. 4GEO Random Polygons on Two Spheres
Find the intersecting polygons on three 3D spheres
ELEMENTS-GROUPING-CLASS: GEOSPHERES
Sample workspace: POLY2CLOUDS
GG-function: ggRPO3Sov()
geometric set intersection
f& G1 G2 where G1 G2 are set variables
geometric set difference
f\ G1 G2
GEO Random Polygons on Two Spheres
The element-grouping-class GEOSPHERES contains the metadata describing the coordinates of polygons to be drawn on 3D spheres. The sample workspace POLY2CLOUDS has the grouping class GEOSPHERES. ASPL will treat the set operations f& and f\ as geometric set operations on the set variables of POLY2CLOUDS.
GEO Random Polygons on Two SpheresThe sample workspace POLY2CLOUDS shows how to use ASPL operators to do contextual set operations on geometric data. This workspace's element grouping class is GEOSPHERES, therefore ASPL switches the set operators f& and f\ to do contextual set intersection and set difference according to contextual routines, here they are the GEOmetric routines.
This workspace shows the power of ASPL set operators when performing operations on geometric data set. In this example we will call the GG function ggRPO2Sov() to create 170 polygons, namely triangles, on two spheres. The result is assigned to G12_170, and the labeling of the first sphere is G1, and of the second sphere is G2.
GEO Random Polygons on Two Spheres
On the UNIX prompt start ASPL by loading the sample workspace POLY2CLOUDS:
# aspl -wsname POLY2CLOUDS -groupingclass GEOSPHERES
The following are the steps
create the groups of random polygons by calling ggRPO2Sov() and assign it to set variable G12_170 split the resulting set variable G12_170 into two set variables G1 and G2: G1 contains the first sphere polygons, and G2 contains the second sphere polygons. call f& on G1 and G2 to get their intersects, and assign the result to G12. call f\ on G1 and G2 to get their difference, and assign the result to G1_2. call f\ on G2 and G1 to get their difference, and assign the result to G2_1. the merge operation shown below is not required with latest version of ASPL. The merge of a variable into itself will just add a GADg to the variable, but if it is not needed then spare the memory.
finally dump the GADg of the variables so that we can plot them using the script drawgeogad.
Read the ASPL book on how to create GEO workspaces.
In this tutorial the 'aspl>' refers to the ASPL prompt, and the '#' refers to the shell prompt.
At the ASPL prompt issue the following commands:
① aspl>
timeout 60
(set timeout to 60 seconds)
② aspl>
G12_170 = ggRPO2Sov(N,170,glb1,G1,glb2,G2,nmfl,G12_170)
(generate random polygons on two spheres)
③ aspl>
split G12_170 into G1 G2
(split the variable G1 and G2 for each sphere)
④ aspl>
G12 = f& G1 G2
(intersect both spheres)
⑤ aspl>
G1_2 = f\ G1 G2
(difference of polygons between G1 and G2)
⑥ aspl>
G2_1 = f\ G2 G1
(difference of polygons between G2 and G1)
⑦ aspl>
merge G12 into G12; merge G1_2 into G1_2; merge G2_1 into G2_1
(needed only with beta version)
⑧ aspl>
dumpgad G12_170; dumpgad G12; dumpgad G1_2; dumpgad G2_1
(dump GEO gads of these variables)
The following figures are generated to show ASPL on doing set intersection and difference on geometric data sets.
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
This example is shown in the following terminal.