% Antoine's Necklace 
% Rob Scharein - April 20, 1996

% Function key F1 can be used to read in this file again.
% F2 will resize the view window.

func 1 <make-antoines-necklace2
func 2 resize 1200 744

% Comment out the following line if you want to see the construction.

Draw=f

% Set up the viewing coordinate system, these numbers may be
% changed for different effects.

untran
rot x -55
scale = .4
try = 1.667

cyl = .1             % radius of smooth tubes.

lxnseg = 20           % quality factors
lxncur = 6            % for `luxo' mode.

chnseg = 8            % quality factors
chncur = 2            % for `cheapo' mode.

pop                   % pop the view window forward.

clrf zf               % these are the default clear functions, here
                      % in case they need to be reset.

chain 20 7            % create a chain with 20 rings of 7 beads each.

fitto 3             % fit it to size of 1.5

save /tmp/KP-antoines-necklace.dum    % save it as a temporary file.

trans 10                              % translate it 10 units in x direction.
save /tmp/KP-antoines-necklace.dumm   % save the translated version.
load /tmp/KP-antoines-necklace.dum    % load the untranslated version.
about y 90                            % rotate it about the y-axis        
trans 10                              % and translate it by 10.
about z 18                             % rotate it so it'll link with dumm.

load comb /tmp/KP-antoines-necklace.dumm  % combine with dumm, now we have
                                          % one pair of linked rings.
% remove all the dummy files.

!/bin/rm /tmp/KP-antoine*


sbuff                                     % switch to single buffer mode
                                          % so that we can draw in an 
                                          % accumulating mode.

disp t          % clear the frame buffer
disp t          % (twice), maybe not really needed.
clrf n          % turn off clearing of frame buffers.

Draw=f    % This line should not be commented out.  Want to explicitly issue
          % drawing commands.

% Draw the first big ring by duplicating it 19 more times.

#9 about z 36,disp t

% set up the coord system to draw right hand big ring.

rot x 90
trx = 5

#10 about z 36, disp t


% set up the coord system to draw left hand big ring.

trx = -5

#10 about z 36, disp t

delete all
Draw=t



