Home » Archimedes archive » Acorn User » AU 1994-02.adf » !FEMS_App_FEMS_App » sims/cloth/ClothShort

sims/cloth/ClothShort

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1994-02.adf » !FEMS_App_FEMS_App
Filename: sims/cloth/ClothShort
Read OK:
File size: 0641 bytes
Load address: 0000
Exec address: 0000
File contents
FEMS2
/* simulation definition file to drop a cloth on a sphere */
/* short-range bonding: compare with ClothSpher and ClothLong */
/* the cloth defined in this file will eventually explode */

/* select output style */
rendering {
 type dots             /* draw scene with dots: "lines" takes more memory */
 resolution 320,256    /* use a 320 x 256 pixel screen mode */
 view -30,24           /* viewpoint: x-y rotation, elevation in degrees */
}

/* simulation parameters */
frame_aim 640          /* pause after 640 frames */
gravity 0,0,-600       /* set direction and strength of gravity */
time_div 1             /* time step division: 1 is fastest, larger values
                          (use 2,4,8, etc.) make objects stiffer */

/* create the cloth */
solid {   
 /* first create the object... */
 create {
  type sheet
  points 21            /* 21 points on each side, making 20 x 20 squares */
  size 16.3in          /* this sets the size of the cloth */
 }
 /* ...then join the points together */
 nearbonds {
  spring_const 70      /* this sets the strength of the springs */
  range 1.1            /* connect all points within 1.1 times the side
                          length of the squares */
 }
 air_damp 3
 translate 0,0,6.9in   /* move the cloth up */
}

/* create the sphere */
background {
 create {
  type sphere
  points 12            /* this sets the number of points used to draw the
                          sphere: 12 means 24 round the circumference */
  size 3.3in           /* this is the radius of the sphere */
 }
 translate 0,0,3.3in   /* move the sphere up */
}
00000000  46 45 4d 53 32 0a 2f 2a  20 73 69 6d 75 6c 61 74  |FEMS2./* simulat|
00000010  69 6f 6e 20 64 65 66 69  6e 69 74 69 6f 6e 20 66  |ion definition f|
00000020  69 6c 65 20 74 6f 20 64  72 6f 70 20 61 20 63 6c  |ile to drop a cl|
00000030  6f 74 68 20 6f 6e 20 61  20 73 70 68 65 72 65 20  |oth on a sphere |
00000040  2a 2f 0a 2f 2a 20 73 68  6f 72 74 2d 72 61 6e 67  |*/./* short-rang|
00000050  65 20 62 6f 6e 64 69 6e  67 3a 20 63 6f 6d 70 61  |e bonding: compa|
00000060  72 65 20 77 69 74 68 20  43 6c 6f 74 68 53 70 68  |re with ClothSph|
00000070  65 72 20 61 6e 64 20 43  6c 6f 74 68 4c 6f 6e 67  |er and ClothLong|
00000080  20 2a 2f 0a 2f 2a 20 74  68 65 20 63 6c 6f 74 68  | */./* the cloth|
00000090  20 64 65 66 69 6e 65 64  20 69 6e 20 74 68 69 73  | defined in this|
000000a0  20 66 69 6c 65 20 77 69  6c 6c 20 65 76 65 6e 74  | file will event|
000000b0  75 61 6c 6c 79 20 65 78  70 6c 6f 64 65 20 2a 2f  |ually explode */|
000000c0  0a 0a 2f 2a 20 73 65 6c  65 63 74 20 6f 75 74 70  |../* select outp|
000000d0  75 74 20 73 74 79 6c 65  20 2a 2f 0a 72 65 6e 64  |ut style */.rend|
000000e0  65 72 69 6e 67 20 7b 0a  20 74 79 70 65 20 64 6f  |ering {. type do|
000000f0  74 73 20 20 20 20 20 20  20 20 20 20 20 20 20 2f  |ts             /|
00000100  2a 20 64 72 61 77 20 73  63 65 6e 65 20 77 69 74  |* draw scene wit|
00000110  68 20 64 6f 74 73 3a 20  22 6c 69 6e 65 73 22 20  |h dots: "lines" |
00000120  74 61 6b 65 73 20 6d 6f  72 65 20 6d 65 6d 6f 72  |takes more memor|
00000130  79 20 2a 2f 0a 20 72 65  73 6f 6c 75 74 69 6f 6e  |y */. resolution|
00000140  20 33 32 30 2c 32 35 36  20 20 20 20 2f 2a 20 75  | 320,256    /* u|
00000150  73 65 20 61 20 33 32 30  20 78 20 32 35 36 20 70  |se a 320 x 256 p|
00000160  69 78 65 6c 20 73 63 72  65 65 6e 20 6d 6f 64 65  |ixel screen mode|
00000170  20 2a 2f 0a 20 76 69 65  77 20 2d 33 30 2c 32 34  | */. view -30,24|
00000180  20 20 20 20 20 20 20 20  20 20 20 2f 2a 20 76 69  |           /* vi|
00000190  65 77 70 6f 69 6e 74 3a  20 78 2d 79 20 72 6f 74  |ewpoint: x-y rot|
000001a0  61 74 69 6f 6e 2c 20 65  6c 65 76 61 74 69 6f 6e  |ation, elevation|
000001b0  20 69 6e 20 64 65 67 72  65 65 73 20 2a 2f 0a 7d  | in degrees */.}|
000001c0  0a 0a 2f 2a 20 73 69 6d  75 6c 61 74 69 6f 6e 20  |../* simulation |
000001d0  70 61 72 61 6d 65 74 65  72 73 20 2a 2f 0a 66 72  |parameters */.fr|
000001e0  61 6d 65 5f 61 69 6d 20  36 34 30 20 20 20 20 20  |ame_aim 640     |
000001f0  20 20 20 20 20 2f 2a 20  70 61 75 73 65 20 61 66  |     /* pause af|
00000200  74 65 72 20 36 34 30 20  66 72 61 6d 65 73 20 2a  |ter 640 frames *|
00000210  2f 0a 67 72 61 76 69 74  79 20 30 2c 30 2c 2d 36  |/.gravity 0,0,-6|
00000220  30 30 20 20 20 20 20 20  20 2f 2a 20 73 65 74 20  |00       /* set |
00000230  64 69 72 65 63 74 69 6f  6e 20 61 6e 64 20 73 74  |direction and st|
00000240  72 65 6e 67 74 68 20 6f  66 20 67 72 61 76 69 74  |rength of gravit|
00000250  79 20 2a 2f 0a 74 69 6d  65 5f 64 69 76 20 31 20  |y */.time_div 1 |
00000260  20 20 20 20 20 20 20 20  20 20 20 20 2f 2a 20 74  |            /* t|
00000270  69 6d 65 20 73 74 65 70  20 64 69 76 69 73 69 6f  |ime step divisio|
00000280  6e 3a 20 31 20 69 73 20  66 61 73 74 65 73 74 2c  |n: 1 is fastest,|
00000290  20 6c 61 72 67 65 72 20  76 61 6c 75 65 73 0a 20  | larger values. |
000002a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000002b0  20 20 20 20 20 20 20 20  20 28 75 73 65 20 32 2c  |         (use 2,|
000002c0  34 2c 38 2c 20 65 74 63  2e 29 20 6d 61 6b 65 20  |4,8, etc.) make |
000002d0  6f 62 6a 65 63 74 73 20  73 74 69 66 66 65 72 20  |objects stiffer |
000002e0  2a 2f 0a 0a 2f 2a 20 63  72 65 61 74 65 20 74 68  |*/../* create th|
000002f0  65 20 63 6c 6f 74 68 20  2a 2f 0a 73 6f 6c 69 64  |e cloth */.solid|
00000300  20 7b 20 20 20 0a 20 2f  2a 20 66 69 72 73 74 20  | {   . /* first |
00000310  63 72 65 61 74 65 20 74  68 65 20 6f 62 6a 65 63  |create the objec|
00000320  74 2e 2e 2e 20 2a 2f 0a  20 63 72 65 61 74 65 20  |t... */. create |
00000330  7b 0a 20 20 74 79 70 65  20 73 68 65 65 74 0a 20  |{.  type sheet. |
00000340  20 70 6f 69 6e 74 73 20  32 31 20 20 20 20 20 20  | points 21      |
00000350  20 20 20 20 20 20 2f 2a  20 32 31 20 70 6f 69 6e  |      /* 21 poin|
00000360  74 73 20 6f 6e 20 65 61  63 68 20 73 69 64 65 2c  |ts on each side,|
00000370  20 6d 61 6b 69 6e 67 20  32 30 20 78 20 32 30 20  | making 20 x 20 |
00000380  73 71 75 61 72 65 73 20  2a 2f 0a 20 20 73 69 7a  |squares */.  siz|
00000390  65 20 31 36 2e 33 69 6e  20 20 20 20 20 20 20 20  |e 16.3in        |
000003a0  20 20 2f 2a 20 74 68 69  73 20 73 65 74 73 20 74  |  /* this sets t|
000003b0  68 65 20 73 69 7a 65 20  6f 66 20 74 68 65 20 63  |he size of the c|
000003c0  6c 6f 74 68 20 2a 2f 0a  20 7d 0a 20 2f 2a 20 2e  |loth */. }. /* .|
000003d0  2e 2e 74 68 65 6e 20 6a  6f 69 6e 20 74 68 65 20  |..then join the |
000003e0  70 6f 69 6e 74 73 20 74  6f 67 65 74 68 65 72 20  |points together |
000003f0  2a 2f 0a 20 6e 65 61 72  62 6f 6e 64 73 20 7b 0a  |*/. nearbonds {.|
00000400  20 20 73 70 72 69 6e 67  5f 63 6f 6e 73 74 20 37  |  spring_const 7|
00000410  30 20 20 20 20 20 20 2f  2a 20 74 68 69 73 20 73  |0      /* this s|
00000420  65 74 73 20 74 68 65 20  73 74 72 65 6e 67 74 68  |ets the strength|
00000430  20 6f 66 20 74 68 65 20  73 70 72 69 6e 67 73 20  | of the springs |
00000440  2a 2f 0a 20 20 72 61 6e  67 65 20 31 2e 31 20 20  |*/.  range 1.1  |
00000450  20 20 20 20 20 20 20 20  20 20 2f 2a 20 63 6f 6e  |          /* con|
00000460  6e 65 63 74 20 61 6c 6c  20 70 6f 69 6e 74 73 20  |nect all points |
00000470  77 69 74 68 69 6e 20 31  2e 31 20 74 69 6d 65 73  |within 1.1 times|
00000480  20 74 68 65 20 73 69 64  65 0a 20 20 20 20 20 20  | the side.      |
00000490  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000004a0  20 20 20 20 6c 65 6e 67  74 68 20 6f 66 20 74 68  |    length of th|
000004b0  65 20 73 71 75 61 72 65  73 20 2a 2f 0a 20 7d 0a  |e squares */. }.|
000004c0  20 61 69 72 5f 64 61 6d  70 20 33 0a 20 74 72 61  | air_damp 3. tra|
000004d0  6e 73 6c 61 74 65 20 30  2c 30 2c 36 2e 39 69 6e  |nslate 0,0,6.9in|
000004e0  20 20 20 2f 2a 20 6d 6f  76 65 20 74 68 65 20 63  |   /* move the c|
000004f0  6c 6f 74 68 20 75 70 20  2a 2f 0a 7d 0a 0a 2f 2a  |loth up */.}../*|
00000500  20 63 72 65 61 74 65 20  74 68 65 20 73 70 68 65  | create the sphe|
00000510  72 65 20 2a 2f 0a 62 61  63 6b 67 72 6f 75 6e 64  |re */.background|
00000520  20 7b 0a 20 63 72 65 61  74 65 20 7b 0a 20 20 74  | {. create {.  t|
00000530  79 70 65 20 73 70 68 65  72 65 0a 20 20 70 6f 69  |ype sphere.  poi|
00000540  6e 74 73 20 31 32 20 20  20 20 20 20 20 20 20 20  |nts 12          |
00000550  20 20 2f 2a 20 74 68 69  73 20 73 65 74 73 20 74  |  /* this sets t|
00000560  68 65 20 6e 75 6d 62 65  72 20 6f 66 20 70 6f 69  |he number of poi|
00000570  6e 74 73 20 75 73 65 64  20 74 6f 20 64 72 61 77  |nts used to draw|
00000580  20 74 68 65 0a 20 20 20  20 20 20 20 20 20 20 20  | the.           |
00000590  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 73  |               s|
000005a0  70 68 65 72 65 3a 20 31  32 20 6d 65 61 6e 73 20  |phere: 12 means |
000005b0  32 34 20 72 6f 75 6e 64  20 74 68 65 20 63 69 72  |24 round the cir|
000005c0  63 75 6d 66 65 72 65 6e  63 65 20 2a 2f 0a 20 20  |cumference */.  |
000005d0  73 69 7a 65 20 33 2e 33  69 6e 20 20 20 20 20 20  |size 3.3in      |
000005e0  20 20 20 20 20 2f 2a 20  74 68 69 73 20 69 73 20  |     /* this is |
000005f0  74 68 65 20 72 61 64 69  75 73 20 6f 66 20 74 68  |the radius of th|
00000600  65 20 73 70 68 65 72 65  20 2a 2f 0a 20 7d 0a 20  |e sphere */. }. |
00000610  74 72 61 6e 73 6c 61 74  65 20 30 2c 30 2c 33 2e  |translate 0,0,3.|
00000620  33 69 6e 20 20 20 2f 2a  20 6d 6f 76 65 20 74 68  |3in   /* move th|
00000630  65 20 73 70 68 65 72 65  20 75 70 20 2a 2f 0a 7d  |e sphere up */.}|
00000640  0a                                                |.|
00000641