%% sphere.ldf %% * (0) Copyright and License. %%%% This file is part of GNU 3DLDF, a package for three-dimensional drawing. %%%% Copyright (C) 2003, 2004, 2005, 2006, 2007 The Free Software Foundation. %%%% GNU 3DLDF is free software; you can redistribute it and/or modify %%%% it under the terms of the GNU General Public License as published by %%%% the Free Software Foundation; either version 2 of the License, or %%%% (at your option) any later version. %%%% GNU 3DLDF is distributed in the hope that it will be useful, %%%% but WITHOUT ANY WARRANTY; without even the implied warranty of %%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %%%% GNU General Public License for more details. %%%% You should have received a copy of the GNU General Public License %%%% along with GNU 3DLDF; if not, write to the Free Software %%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA %%%% GNU 3DLDF is a GNU package. %%%% It is part of the GNU Project of the %%%% Free Software Foundation %%%% and is published under the GNU General Public License. %%%% See the website http://www.gnu.org %%%% for more information. %%%% GNU 3DLDF is available for downloading from %%%% http://www.gnu.org/software/3dldf/LDF.html. %%%% It is also available from %%%% http://www.dante.de/software/ctan/, the Dante www-server %%%% and from http://wwwuser.gwdg.de/~lfinsto1, %%%% the author's website. %%%% Please send bug reports to bug-3dldf@gnu.org %%%% The mailing list help-3dldf@gnu.org is available for people to %%%% ask other users for help. %%%% The mailing list info-3dldf@gnu.org is for the maintainer of %%%% GNU 3DLDF to send announcements to users. %%%% To subscribe to these mailing lists, send an %%%% email with ``subscribe '' as the subject. %%%% The author can be contacted at: %%%% Laurence D. Finston %%%% Kreuzbergring 41 %%%% D-37075 Goettingen %%%% Germany %%%% lfinsto1@gwdg.de %%%% s246794@stud.uni-goettingen.de %% Sphere. beginfig(1); circle c[]; division_value := 64; one_quarter_division_value := 1/4division_value; three_quarters_division_value := 3/4division_value; set c0 with_point_count division_value; scale c0 (8, 0, 8); rotate c0 by 90; point p; path q[]; q[division_value] += get_point 0 c0; pen thick_pen; thick_pen := pencircle scaled (2.5, 2.5, 2.5); pickup thick_pen; step_value := 360 / division_value; j := 1; for i = 0 step step_value until 360 - step_value: rotate c0 (0, step_value); if (is_even j): draw c0; fi; for k = 2 step 2 until one_quarter_division_value - 2: q[k] += get_point (k) c0; q[three_quarters_division_value + k] += get_point (three_quarters_division_value + k) c0; endfor; q[division_value] += get_point 0 c0; j += 1; endfor; q[division_value] += cycle; q[division_value] += ..; draw q[division_value]; for i = 2 step 2 until one_quarter_division_value - 2: q[i] += ..; q[i] += cycle; q[three_quarters_division_value + i] += ..; q[three_quarters_division_value + i] += cycle; draw q[i]; draw q[three_quarters_division_value + i]; endfor; rotate current_picture (-45, -15); endfig; end;