( ** Go back to PARENTPAGE ../RANDOM-POLYGONS-IN-TWO-2D-PLANES.html)
( ** Go back to HOMESITE https://www.tcnd.com)
( ** Go back to SetSphere https://www.setsphere.com)

Workspace POLY2PLANES and set operations in 2D plane

The workspace POLY2PLANES shows how to do contextual set operations on geometric data (polygons in 2D plane). Find the intersections of the polygons in 2D plane, and find the difference of polygons in 2D plane.

ASPL 1> ks x1 y1 x2 y2 x3 y3
set the ks vector to shorten the displayed data

ASPL 2> P12_90 = ggRPI2Pov(N,90,glb1,P1,glb2,P2,nmfl,P12_90)
get random polygons in two 2D planes also generate named data in ~tmp

ASPL 3> split P12_90 into P1 P2
split the variable P12_90 for the two planes

ASPL 4> f& P1 P2
intersect the two planes

ASPL 5> f\ P1 P2
get the difference between 1st plane and the 2nd plane, the result is pushed on the stack

ASPL 6> f\ P2 P1
get the difference between 2nd plane and the 1st plane, the result is pushed on the stack

ASPL 7> ans
print the answer stack

ASPL 8> pop P2_1
pop the stack result into variable P2_1 as the difference f\ P2 P1

ASPL 9> pop P1_2
pop the stack result into variable P1_2 as the difference f\ P1 P2

ASPL 10> pop P12
pop the stack result into variable P12 as the intersection f& P1 P2

ASPL 11> ans
print the answer stack

ASPL 12> v
print the symbol table

ASPL 13> dumpgad P12
dump GADg of P12 write it to a file in ~tmp directory

ASPL 13> dumpgad P1_2
dump GADg of P1_2 write it to a file in ~tmp directory

ASPL 13> dumpgad P2_1
dump GADg of P2_1 write it to a file in ~tmp directory

ASPL 13> dumpgad P12_90
dump GADg of P12_90 write it to a file in ~tmp directory

ASPL 14> bye
save and quit.. sweet!