From: wndalouise@aol.com (WndaLouise)
Newsgroups: comp.sys.hp48
Subject: Islamic Tile Maker ( soft )
Date: 12 Jan 1998 00:28:31 GMT
Lines: 325
Message-ID: <19980112002800.TAA11372@ladder02.news.aol.com>
NNTP-Posting-Host: ladder02.news.aol.com
X-Admin: news@aol.com
Organization: AOL http://www.aol.com
Xref: republic.btigate.com comp.sys.hp48:5584

1234567891123456789212345678931234567894123456789512345678961234567897

Islamic Tiles

This Program/Directory is supposed to generate tiles that look like those
RadOut Islamic geometrical tiles that are often seen in Mosques or Presidential
Palaces in the Middle East...(???)...and it sort of does...???...but they tend
to be considerably more complex and only a small percentage of them turn out
reasonably decent...???!
I'm not sure exactly-- how one would go about installing a minimal sense of
aesthetical awareness into a 48 program, so the 'sludge' factor is probably
unavoidable; at least until the 48 series has several gigabytes of memory that
can be used to create a synthetic level of consciousness...???

The ones that do come out marginally well are excellent for tiling the desktop
of your big-box, background on your website, or printing out for wallpaper.

The Directory Consists of eight objects:

Islam      The 'big' starter program
Do.10      Makes 10 of the tiles
name       Contains a number that is used to name the tiles
Abc	       Converts a decimal number into a zeroless base 26 number
Cba        The inverse function of Abc
Cpict      Centers PICT for viewing during program execution
Pxdm       Returns the size one pixel on PICT
PPAR       Plot Parameters

To use Islam:
'Islam' comes equipped with a -DoubleClick- feature; 
Which allows you to make one tile at a time, displaying an Input prompt for the
User; 
Or--
To use Islam as a subprogram that takes it's Input arguments directly from the
stack.

To Make just one tile;
Double click on the 'Islam' key, which causes an INFORM Input window to come
up. The items that need to be filled in are:

Tile Width      The width of the tile, 
                This has to be at least 131 pixels.
                The height of the tile is derived from 
                assigned width. About 42% shorter...
Symmetry        Either a 0 or 1
                Which makes the mandala like design 
                mirrored along each arm or not.
Polyation       How many sides the mandala will have.
Straights       The number of straight lines in the mandala.
Bents           The number of circles in the mandala.
OffSet          Rotational Deviation of each Mandala

The number of circles is what really slows down the making of a tile...since
the 48 draws circles rather slowly...???...plus, and since, the 48 doesn't know
where the circles and lines are going to appear, it draws the mandala seven
times, although the mandala is only depicted on the tile twice, once in the
middle, and six times, in pieces, surrounding it...???
So if the mandala has 6 mirrored facets, and draws 2 circles per mandala, the
total number of circles drawn will be; 336 !!!

Eeeeeeeeeeeeeeeeeeeeeek!

To Make a whole bunch of tiles;
Load the stack with all the necessary variables...

6:               real integer   Tile Width
5:                     0 or 1   Symmetry
4:               real integer   Polyation
3:               real integer   Straights
2:               real integer   Bents
1:                       real   Off Set

Then click on 'Islam' once.

After each tile is made, The number in 'name' is Incremented & used to generate
a Zeroless Base 26 Alpha Character Group which is used to Store the tile. 
1 = A  2 = B  26 = Z  27 = AA  28 = AB
As a side note; 
This Zeroless Base 26 numbering system is entirely self consistent, and
addition & multiplication tables can ( and have ) been made from it...
I've been working on & off, on a new system of arithmetic which amoung other
things doesn't allow the multiplication by non-positive numbers, called
Debt-Numbers. You can multiple Debt-Numbers by a positive number, but not
vice-versa. 
It just doesn't make sense to say that if you -owe- 3 apples to your sister
Mabel and that if you mulitple them by negative 4, you'll have anything
intelligible...!
Or if you -have- 3 apples and then multiple them by negative 4 apples...what
will you have, negative 12 apples...and what happened to the original 3
apples...??? HUH...huh, huh, huh...!!!

so anyway... ( sorry for that digression ) (!)

To use 'Do.10';
Simply hit 'Do.10 once and stand back---
Be careful not to hit any other keys while the programming is operating, 
as this will cause the INFORM box to come up!

The ranges that Do.10 sets are:
Width               n = 200
Symmtry         0 = n = 1
Sides          3 <= n <= 12
Lines          3 <= n <= 8
Arcs           0 <= n <= 7
OffSet         0 <= n <= 45

You really have to make alot of tiles to get a few that are really interesting,
regardless of what you think interesting is...!?!?

Once you've got a whole bunch of tiles made, and have uploaded/downloaded (?)
them to your big box, use the GROBer (mac's) or -(?)- (femac's) to change them
into a format that you can work with...

Then what i've found works kind of well, 
to paint them in a nearly painless way...
 
Is to define the resolution of a -Paint- area to match the tile,
Paste the tile onto the Paint area,
Highlight the whole tile,
Then use the modifier functions to change all the colours on the tile, 
pretty much randomly until an interesting colour combination comes up...
On ClarisWorks, the only fuctions that i really have to work with are;
Darken, Lighten, Invert & Blur.
Usually if i Darken the tile, some number of times, then Invert it, the
inverted colours will be highly counterintuitive, and by repeating this
sequence, any number of colour combinations will result.
The Blur function, for whatever reasons, will often create a 3D like effect, by
adding intermediate colours.
Blur, more than the other functions, is usually responsible for ultimately
distroying the tile pattern.
Save the resulting tiles as you go along, and then aftwards use them as
backgrounds from your big-box desktop, or website...!!! (?)

For more information or -help with problems- contact:
Tiny Wanda at:
WndaLouise@aol.com  
( who will -someday- get a website of my own )

If you have a s or sx, the only problem bit should be the INFORM routine at the
beginning of the program...just delete this part or rewrite it to the ultimate
effect of however you like Input structures to look...??? (!)

-------------------

Name:        Tilez
CheckSum:  # 2054h
Size:       2639.5

-------------------

%%HP: T(3)A(D)F(.);
DIR
  Islam
    \<< .2 WAIT KEY       @ DoubleClickChecker
      \<< DROP            @ StartOf INFORM Input
"ISLAMIC TILES" { {
"Tile Width?"
"Height Derived From Width"
0 } { } {
"Symmetry?"
"Mirror: On-1 Off-0"
0 } { "Polyation?"
"Number Of Facets?"
0 } { "Straights?"
"Number Of Straight Lines 3-12"
0 } { "Bents?"
"Number Of Circles"
0 } { } {
"Off Set?"
"Rotational Deviation"
0 } } { 2 4 } { 200
1 6 5 3 0 } DUP
INFORM DROP OBJ\->
DROP
      \>> IFT 3 ROLLD     @ EndOf INFORM Input.
0 1                       @ IFT MarksEndOfDoubleClk.
      START SWAP          @ If StraightsOrBents
DUP 0 <                   @ Are<0ThenNewValuesAre
        \<< DROP RAND     @ RandomlyAssigned 3<=n<=21 (!)
18 * CEIL 3 +
        \>> IFT
      NEXT { (0,0)
(1.5,.866025403785)       @ TheseArrangeTheMandalas
(0,1.73205080757)         @ InABeehiveFormation
(-1.5,.866025403785)      @ ToCreateTheTilingEffect
(-1.5,-.866025403785)
(0,-1.73205080757)
(1.5,-.866025403785)
} .866025403784
RCLF 360 8 ROLL / \->
w s \.V \Ga \Gb \GD y f \Ge
      \<< -16 CF w        @ ILikeToUseOddVariables
R\->B 1 + w .5773 *
R\->B 1 + PDIM y y
NEG YRNG 1.5 -1.5
XRNG :&: Pxdm EVAL
V\-> y SWAP - NEG y
YRNG 1.5 SWAP - NEG
1.5 XRNG PICT SIZE
1 - SWAP 1 - SWAP
PDIM -16 -19 SF SF
:&: Cpict EVAL \Ga
        \<< RAND 1.5
* RAND 360 * \->V2 \->
\GW
          \<< \GW 1 \Ga
            FOR $ $
\Ga == '\GW'
              \<<
RAND 1.5 * RAND 360
* \->V2
              \>>
IFTE \-> p q
              \<< 1 7
FOR \162 \GD \162 GET \-> \Gr
  \<< \.V DUP 359 +
    FOR \163 p V\-> \163 +
\->V2 \Gr + q V\-> \163 +
\->V2 \Gr + LINE s
      \<< p V\-> \163 +
\->V2 CONJ \Gr + q V\-> \163
+ \->V2 CONJ \Gr + LINE
      \>> IFT \Ge
    STEP
  \>>
NEXT q
              \>>
            NEXT
          \>>
        \>> IFT DROP
1 \Gb
        START RAND
1.1 * DUP 1.1 SWAP
- RAND * SWAP .3 +
RAND 360 * \->V2 \-> r
c
          \<< 1 7
            FOR \162 \GD
\162 GET \-> \Gr
              \<< \.V
DUP 359 +
FOR \163 c V\-> \163 + \->V2
\Gr + r 0 360 ARC s
  \<< c V\-> \163 + \->V2
CONJ \Gr + r 0 360
ARC
  \>> IFT \Ge
STEP
              \>>
            NEXT
          \>>
        NEXT f STOF
PICT RCL "'" 'name'
INCR Abc + OBJ\-> STO     @ AbcAssignsNameToTile
-56 CF 1 12
        START RAND        @ BeepingSequence
3 * CEIL { { 20 15        @ GoesOffWhenDone
.5 } { 100 20 .1 }        @ Hit ON ToTurnItOff
{ 2000 500 .02 } {
4000 1000 .005 } }
SWAP GET EVAL \-> a b
c
          \<< RAND a
* b + c BEEP
          \>>
        NEXT -56 SF
      \>>
    \>>
  Do\18310
    \<< 1 10
      START "Width"
DROP 200 "Symmtry"
DROP RAND 2 * CEIL
1 - "Sides" DROP
RAND 9 * 3 +
"Lines" DROP CEIL
RAND 5 * 3 + CEIL
"Arcs" DROP RAND 7
* FLOOR "OffSet"
DROP RAND 45 *
Islam
      NEXT
    \>>
  name 0                     @ ZeroTurnsToOneAtFirst
  Abc                        @ INCR Which='A'
    \<< ""
      WHILE OVER 26
>
      REPEAT OVER
26 SWAP 1 - SWAP
MOD 1 + DUP 64 +
CHR EVAL ROT + 3
ROLLD - 26 / SWAP
      END SWAP 64 +
CHR EVAL SWAP +
    \>>
  Cba
    \<< DUP SIZE \-> \162
      \<< 0 1 \162
        FOR $ OVER
$ $ SUB NUM 64 - 26
\162 $ - ^ * +
        NEXT SWAP
DROP
      \>>
    \>>
  Cpict
    \<< PICT SIZE 64
- 2 / SWAP 131 - 2
/ SWAP 2 \->LIST
PVIEW
    \>>
  Pxdm
    \<< { # 1d # 0d }
PX\->C { # 0d # 1d }
PX\->C -
    \>>
  PPAR {
(-1.5,-.866025403784)
(1.5,.866025403784)
X 0 (0,0) FUNCTION
Y }
END

