ASPL Programming ver 1.00
© 2024 Bassem W. Jamaleddine


11-10

   RANDOM POLYGONS ON TWO SPHERES

[RANDOM POLYGONS ON TWO SPHERES]

WORKSPACE POLY2CLOUDS DESCRIPTION:

This workspace shows how to use ASPL operators to do contextual set operations on geometric data. Worspaces that have a name suffixed with GEO causes ASPL to switch it 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. We will 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. We will call f& on G1 and G2 to get their intersects, and assign the result to G12. We will call f\ on G1 and G2 to get their difference, and assign the result to G1_2. We will 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 we will dump the GADg of the variables so that we can plot them with drawgad command. 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.

①  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.

       Figure G12_170-both-all-img3D.png
full view

Image File

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

       Figure G12_170-both-all-img2D.png
full view

Image File

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

       Figure G12-both-disjointness-img3D.png
full view

Image File

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

       Figure G12-G1only-img2D.png
full view

Image File

 -F- Fig. 11.10.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) 2024 Bassem Jamaleddine

       Figure G12-G1only-img3D.png
full view

Image File

 -F- Fig. 11.10.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) 2024 Bassem Jamaleddine

       Figure G12-G2only-img2D.png
full view

Image File

 -F- Fig. 11.10.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) 2024 Bassem Jamaleddine

       Figure G12-G2only-img3D.png
full view

Image File

 -F- Fig. 11.10.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) 2024 Bassem Jamaleddine

       Figure G12-both-intersect-perpendicularZ-img3D.png
full view

Image File

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

       Figure G12-both-intersect-img3D.png
full view

Image File

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

       Figure G12-both-intersect-img2D.png
full view

Image File

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

This example is shown in the following terminal.

       terminal for example: RANDOM POLYGONS ON TWO SPHERES
viewme

 -E- Display. 11.10.1   [RANDOM POLYGONS ON TWO SPHERES][RANDOM POLYGONS ON TWO SPHERES]
Terminal showing RANDOM POLYGONS ON TWO SPHERES