ASPL User Guide v 1.00
© 2025 Bassem W. Jamaleddine


22. 4
   GEO 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

●  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 Spheres
The 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.

    full view

    Image File

     -FG- Fig. 22.4.1   [Figure RANDOM POLYGONS OVERLAPPING ON TWO SPHERES IN 3D SPACE WITH ASPL GEO-INTERSECTIONS GEO-DIFFERENCE]
    ASPL (C) 2025 Bassem Jamaleddine

    full view

    Image File

     -FG- Fig. 22.4.2   [Figure RANDOM POLYGONS OVERLAPPING ON TWO SPHERES IN 2D SPACE WITH ASPL GEO-INTERSECTIONS GEO-DIFFERENCE]
    ASPL (C) 2025 Bassem Jamaleddine

    full view

    Image File

     -FG- Fig. 22.4.3   [Figure ASPL GEO-DIFFERENCE SHOWING THE DISJOINTNESS OF POLYGONS ON THE TWO SPHERES IN 3D SPACE]
    ASPL (C) 2025 Bassem Jamaleddine

    full view

    Image File

     -FG- Fig. 22.4.4   [Figure 2D VIEW OF CLOUDS ON 1st SPHERE - SHOWING G1 OF f& G1 G2 INTERSECT CONTRASTED AND DIFFERENCE f\ G2 G1 IN LOW DENSITY]
    ASPL (C) 2025 Bassem Jamaleddine

    full view

    Image File

     -FG- Fig. 22.4.5   [Figure 3D VIEW OF CLOUDS ON 1st SPHERE - SHOWING G1 OF f& G1 G2 INTERSECT CONTRASTED AND DIFFERENCE f\ G2 G1 IN LOW DENSITY]
    ASPL (C) 2025 Bassem Jamaleddine

    full view

    Image File

     -FG- Fig. 22.4.6   [Figure 2D VIEW OF CLOUDS ON 2nd SPHERE - SHOWING G2 OF f& G1 G2 INTERSECT CONTRASTED AND DIFFERENCE f\ G2 G1 IN LOW DENSITY]
    ASPL (C) 2025 Bassem Jamaleddine

    full view

    Image File

     -FG- Fig. 22.4.7   [Figure 3D VIEW OF CLOUDS ON 2nd SPHERE - SHOWING G2 OF f& G1 G2 INTERSECT CONTRASTED AND DIFFERENCE f\ G2 G1 IN LOW DENSITY]
    ASPL (C) 2025 Bassem Jamaleddine

    full view

    Image File

     -FG- Fig. 22.4.8   [Figure PERPENDICULAR VIEW ALONG Z-AXIS FOR THE ASPL GEO-INTERSECTION FOR RANDOM POLYGONS ON TWO SPHERES IN 3D SPACE]
    ASPL (C) 2025 Bassem Jamaleddine

    full view

    Image File

     -FG- Fig. 22.4.9   [Figure ASPL GEO-INTERSECTION SHOWING THE OVERLAPPING POLYGONS ON THE TWO SPHERES IN 3D SPACE]
    ASPL (C) 2025 Bassem Jamaleddine

    full view

    Image File

     -FG- Fig. 22.4.10   [Figure ASPL GEO-INTERSECTION SHOWING THE OVERLAPPING POLYGONS ON THE TWO SPHERES IN 2D SPACE]
    ASPL (C) 2025 Bassem Jamaleddine

    This example is shown in the following terminal.

    viewme

     -TC- Display. 22.4.1   [RANDOM POLYGONS ON TWO SPHERES]
    Terminal showing RANDOM POLYGONS ON TWO SPHERES