%%%% cubd_01.ldf %%%% Created by Laurence D. Finston (LDF) Fri Dec 16 15:26:59 CET 2005 %%%% Modified by Laurence D. Finston (LDF) Fri Dec 16 17:30:29 CET 2005 %% * (1) Copyright and License. %%%% This file is part of GNU 3DLDF, a package for three-dimensional drawing. %%%% Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 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 3 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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 lfinsto1@gwdg.de %%%% 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 %%%% c/o The Free Software Foundation, Inc. %%%% 51 Franklin St, Fifth Floor %%%% Boston, MA 02110-1301 %%%% USA %%%% lfinsto1@gwdg.de %%%% s246794@stud.uni-goettingen.de %% *** (3) Classifying `points' with respect to a `cuboid'. verbatim_metapost "verbatimtex \magnification=\magstep5 etex"; pen dot_pen; dot_pen := pencircle scaled (2mm, 2mm); pickup pencircle scaled (.75mm, .75mm); focus f; set f with_position (-12, 15, -30) with_direction (-12, 15, 100) with_distance 20; beginfig(1); cuboid c; c := unit_cuboid scaled (20, 16, 10) rotated (-20, 15); draw c; point p[]; p0 := (0, 1, 1); message "p0 location c:"; show p0 location c; string s; s := "\\setbox0=\\hbox{$p_0$}\\hbox to \\wd0{\\box0 , $l = " & decimal (p0 location c) & "$\\hss}"; drawdot p0 with_pen dot_pen with_color blue; label.top(s, p0 shifted (0, .25)); rectangle r[]; r0 := get_rectangle 0 c; p1 := mediate(get_point 0 r0, get_point 3 r0, 1/3); message "p1 location c:"; show p1 location c; s := "\\setbox0=\\hbox{$p_1$}\\hbox to \\wd0{\\box0 , $l = " & decimal (p1 location c) & "$\\hss}"; drawdot p1 with_pen dot_pen with_color blue; label.rt(s, p1 shifted .25); r1 := get_rectangle 2 c; p2 := mediate(get_point 0 r1, get_point 2 r1); message "p2 location c:"; show p2 location c; s := "\\setbox0=\\hbox{$p_2$}\\hbox to \\wd0{\\box0 , $l = " & decimal (p2 location c) & "$\\hss}"; drawdot p2 with_pen dot_pen with_color blue; label.rt(s, p2 shifted .25); r2 := get_rectangle 4 c; p3 := mediate(get_point 0 r2, get_point 2 r2) shifted (0, 2); message "p3 location c:"; show p3 location c; s := "\\setbox0=\\hbox{$p_3$}\\hbox to \\wd0{\\box0 , $l = " & decimal (p3 location c) & "$\\hss}"; drawdot p3 with_pen dot_pen with_color blue; label.top(s, p3 shifted (0, .25)); endfig with_focus f no_sort; verbatim_metapost "end"; end;