ASPL Programming ver 1.00
© 2024 Bassem W. Jamaleddine


11-8

   RANDOM POLYGONS IN TWO 2D PLANES

[RANDOM POLYGONS IN TWO 2D PLANES]

WORKSPACE POLY2PLANES 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. 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> ks x1 y1 x2 y2 x3 y3

②  aspl> P12_90 = ggRPI2Pov(N,90,glb1,P1,glb2,P2,nmfl,P12_90)

③  aspl> split P12_90 into P1 P2

④  aspl> f& P1 P2

⑤  aspl> f\ P1 P2

⑥  aspl> f\ P2 P1

⑦  aspl> ans

⑧  aspl> pop P2_1

⑨  aspl> pop P1_2

⑩  aspl> pop P12

⑪  aspl> ans

⑫  aspl> v

⑬  aspl> dumpgad P12;dumpgad P1_2;dumpgad P2_1;aspl> dumpgad P12_90

The processing of 90 random triangles in each 2D plane result in 180 triangles total in both planes.

The following figure shows the random triangles in the two 2D planes:

       Figure P12_90-both-img.png
full view

Image File

 -F- Fig. 11.8.1   [Figure RANDOM TRIANGLES IN TWO 2D PLANES]
ASPL (C) 2024 Bassem Jamaleddine

The following figure shows the random triangles intersection processed through ASPL f& P1 P2 command:

       Figure P12-both-intersect-img.png
full view

Image File

 -F- Fig. 11.8.2   [Figure ASPL GEO-INTERSECTION FOR RANDOM TRIANGLES WITH HIGHLIGHTED OVERLAPPING TRIANGLES IN THE TWO 2D PLANES]
ASPL (C) 2024 Bassem Jamaleddine

The following figure shows the random triangles along their intersection (that is the overlapping polygons):

       Figure P12_90-both-and-intersect-img1.png
full view

Image File

 -F- Fig. 11.8.3   [Figure ASPL GEO-INTERSECTION CONTRASTED WITH SQUARE POINTS FOR THE RANDOM TRIANGLES OVERLAPPING IN THE TWO 2D PLANES]
ASPL (C) 2024 Bassem Jamaleddine

The following figure shows the random triangles along their intersection (that is the overlapping polygons):

       Figure P12_90-both-and-intersect-img2.png
full view

Image File

 -F- Fig. 11.8.4   [Figure ASPL GEO-INTERSECTION FOR RANDOM TRIANGLES WITH HIGHLIGHTED OVERLAPPING TRIANGLES IN THE TWO 2D PLANES]
ASPL (C) 2024 Bassem Jamaleddine

The following figure shows the random triangles union of their differences derived from ASPL ASPL f\ P1 P2 and f\ P2 P1 commands:

       Figure P12-both-disjointness-img1.png
full view

Image File

 -F- Fig. 11.8.5   [Figure ASPL GEO-DIFFERENCE SHOWING THE DISJOINTNESS OF THE TWO PLANES -- EXCLUDING THE INTERSECTING TRIANGLES]
ASPL (C) 2024 Bassem Jamaleddine

DRAWING THE DATA:

Generate the drawing data from the GADg for f\ P1 P2

# drawgad -gad P1_2-gad-aspl.tobj

Generate the drawing data from the GADg for f\ P2 P1

# drawgad -gad P2_1-gad-aspl.tobj

Generate the drawing data from the GADg for f& P1 P2

# drawgad -gad P12-gad-aspl.tobj

Drawing the data using the gpdata3 command:

# gpdata3 P12_90_o1.dat,1:2wlp P12_90_o1.dat,1:2wp P12_90_o2.dat,1:2wlp P12_90_o2.dat,1:2wp -title "ASPL GEO-INTERSECTION SHOWING THE OVERLAPPING TRIANGLES IN TWO 2D PLANES"

# gpdata3 P12_90_1.dat,1:2wl P12_90_o1.dat,1:2wp P12_90_2.dat,1:2wl P12_90_o2.dat,1:2wp -title "RANDOM TRIANGLES IN TWO 2D PLANES"

# gpdata3 P1_2_P1.dat,1:2wl P2_1_P2.dat,1:2wl-rgb-blue P12_90_o1.dat,1:2wl-rgb-green P12_90_o2.dat,1:2wl-rgb-yellow -title "RANDOM TRIANGLES AND THEIR INTERSECTIONS HIGHLIGHTED"

# gpdata3 P12_90_1.dat,1:2wl-rgb-red P12_90_2.dat,1:2wl-rgb-blue P12_90_o1.dat,1:2wp-ot-4-ps-1.7-rgb-red P12_90_o2.dat,1:2wp-pt-4-ps-1.7-rgb-blue -title "ASPL GEO-INTERSECTION CONTRASTED WITH SQUARE POINTS FOR THE RANDOM TRIANGLES OVERLAPPING IN THE TWO 2D PLANES"

# gpdata3 P1_2_P1.dat,1:2wl P2_1_P2.dat,1:2wl-rgb-blue P12_90_o1.dat,1:2wl-rgb-green P12_90_o2.dat,1:2wl-rgb-yellow -title "RANDOM TRIANGLES AND THEIR INTERSECTIONS HIGHLIGHTED"

# gpdata3 P1_2_P1.dat,1:2wl P2_1_P2.dat,1:2wl-rgb-blue -title "DISJOINTNESS OF THE TWO PLANES -- EXCLUDING THE INTERSECTING TRIANGLES"

# gpdata3 P1_2_P1.dat,1:2wl P2_1_P2.dat,1:2wl-rgb-blue -title "ASPL GEO-DIFFERENCE SHOWING THE DISJOINTNESS OF THE TWO PLANES -- EXCLUDING THE INTERSECTING TRIANGLES"

# gpdata3 P12_90_1.dat,1:2wl P12_90_o1.dat,1:2wp -every wp ::0::3 P12_90_2.dat,1:2wl P12_90_o2.dat,1:2wp -every wp ::0::3 -title "RANDOM TRIANGLES IN TWO 2D PLANES SHOWING THE OVERLAPPING TRIANGLES"

# gpdata3 P12_90_1.dat,1:2wl P12_90_o1.dat,1:2wp P12_90_2.dat,1:2wl P12_90_o2.dat,1:2wp -title "RANDOM TRIANGLES IN TWO 2D PLANES SHOWING THEIR OVERLAPPING TRIANGLES"

# gpdata3 P12_90_1.dat,1:2wl P12_90_o1.dat,1:2wp -every wp ::0::3 P12_90_2.dat,1:2wl P12_90_o2.dat,1:2wp -every wp ::0::3 -title "RANDOM TRIANGLES IN TWO 2D PLANES SHOWING THEIR OVERLAPPING TRIANGLES"

This example is shown in the following terminal.

       terminal for example: RANDOM POLYGONS IN TWO 2D PLANES
viewme

 -E- Display. 11.8.1   [RANDOM POLYGONS IN TWO 2D PLANES][RANDOM POLYGONS IN TWO 2D PLANES]
Terminal showing RANDOM POLYGONS IN TWO 2D PLANES