ASPL User Guide v 1.00
© 2025 Bassem W. Jamaleddine
The script polyclouds.aspl creates the temporary workspace TRANSIENT whose element grouping class GEOSPHERES, hence switching the set operators f& and f\ to do contextual set intersection and set difference according to contextual routines, here they are the GEOmetric routines.
The script creates random polygons on three spheres and uses the set operations to find intersecting polygons between the spheres. The script invokes the ASPL interpreter using the two lines shebang: line 1 and line 2; the first specifies the interpreter, and the second specifies the arguments to be passed to the interpreter.
We invoke the script at the shell prompt by specifying its name followed by a positive integer. This integer is being read and passed as an argument, represented by $1 to be concatenated to S123_ (line 15) to form a symbolic production. For instance, if we typed on the shell prompt the following command to create 130 random polygons:
# polyclouds.aspl 130
S123_130 = ggRPO3Sov(N,130,glb1,S1,glb2,S2,glb3,S3,nmfl,S123_130)
hence creating the set variable S123_130 to be assigned the GADg group that contains the grouping of three spheres labeled S1, S2, and S3. Line 16 splits S123_130 into three set variables: S1, S2, and S3. Lines 17 to 19 get the intersection between each pair of spheres, namely: S1 and S2, S1 and S3, S2 and S3. Line 20 gets the interesection between all three spheres: S1 S2 S3. Since the results of the set operations have been pushed on the answer stack, lines 21 to 24 pop the stack into the set variables S123, S23, S13, and S12. Optinally, line 25 to 28, the set variables are being dumped to ASPL ~tmp directory where we can invoke the utility script gpdata3 to drawn the polygons.
1. #!/usr/bin/env aspl 2. #ENVARG= -wsname TRANSIENT -groupingclass GEOSPHERES 3. 4. ;;*********************************************************************** 5. ;; polyclouds.aspl 6. ;; 7. ;; Copyright © 2021-2024 Bassem W. Jamaleddine 8. ;; All rights reserved. 9. ;; 10. ;;*********************************************************************** 11. 12. endScriptIfShellArgsLessThan 1 13. 14. print RANDOM POLYGONS ON THREE SPHERES WITH $1 POLYGONS ON EACH 15. S123_$1 = ggRPO3Sov(N,$1,glb1,S1,glb2,S2,glb3,S3,nmfl,S123_$1) 16. split S123_$1 into S1 S2 S3 17. f& S1 S2 18. f& S1 S3 19. f& S2 S3 20. f& S1 S2 S3 21. pop S123 22. pop S23 23. pop S13 24. pop S12 25. dumpgad S123 26. dumpgad S12 27. dumpgad S13 28. dumpgad S23 29. 30. endscript 31. 32. __END__ 33. 34. Create random polygons on three spheres. 35. $00 must be followed by one argument specifying the number of polygons 36. to create on each sphere. 37. 38. draw 100 random polygons on three spheres 39. $00 100 40. 41. In ASPL GEO's workspaces the set operations perform set operations 42. on geometric data, and the command "dumpgad" dumps GAD objects that 43. can be read by the command "drawgad" to draw such geometric data.
This example is shown in the following terminal.