%%%% elpsd_17.ldf
%%%% Created by Laurence D. Finston (LDF) Tue Dec 13 21:47:16 CET 2005
%% Modified by Laurence D. Finston (LDF) Fri Dec 16 14:27:59 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, 2009, 2010, 2011, 2012, 2013 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.
%%%% Please send bug reports to Laurence.Finston@gmx.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
%%%% Laurence.Finston@gmx.de
%% *** (3) The intersection of a `plane' and an `ellipsoid'.
%% This seems to work now.
%% LDF 2005.12.15.
verbatim_metapost "verbatimtex \magnification=\magstep5 etex";
pickup pencircle scaled (.75mm, .75mm);
focus f;
set f with_position (-12, 15, -30) with_direction (-12, 15, 100) with_distance 20;
picture save_picture;
beginfig(1);
ellipsoid E;
Ew := 20;
Eh := 16;
Ed := 8;
rw := Ew + 10;
rd := Ed + 15;
set E with_center origin with_axis_x Ew with_axis_y Eh with_axis_z Ed
with_divisions_x 8 with_divisions_y 8 with_divisions_z 2
with_point_count 64;
rectangle r[];
%r0 := unit_rectangle scaled (rw, 0, rd) rotated (15, 15, 20) shifted (0, 0, 4); %% These work.
%r0 := unit_rectangle scaled (rw, 0, rd) rotated (15, 15, 0);
%r0 := unit_rectangle scaled (rw, 0, rd) rotated (30, 15, 0);
%r0 := unit_rectangle scaled (rw, 0, rd) rotated (45, 0, 0);
%r0 := unit_rectangle scaled (rw, 0, rd) rotated (45, 11, 0);
% r0 := unit_rectangle scaled (rw, 0, rd) rotated (80, 0, 0) shifted (0, 0, 1); %% This works.
% r0 := unit_rectangle scaled (rw, 0, rd) rotated (0, 90, 0) shifted (0, 0, 1); %% This works.
% r0 := unit_rectangle scaled (rw, 0, rd) rotated (0, 0, 90) shifted (0, 0, 1); %% This works.
% r0 := unit_rectangle scaled (rw, 0, rd) rotated (0, 10, 80) shifted (0, 0, 1); %% This works.
r0 := unit_rectangle scaled (rw, 0, rd) rotated (60, 25, 10) shifted (0, 0, 1); %% This works.
%r0 := unit_rectangle scaled (rw, 0, rd) rotated (15, 15, 20) shifted (0, 0, 4); %% This works.
%r0 := unit_rectangle scaled (rw, 0, rd) rotated (90, 0) shifted (0, 0, 1); %% This works.
% r0 := unit_rectangle scaled (rw, 0, rd) rotated (90, 0) shifted (0, 0, 2); %% This works.
% r0 := unit_rectangle scaled (rw, 0, rd) rotated (90, 0) shifted (0, 0, 1); %% This works.
%% **** (4)
transform t;
t := identity rotated (5, 5) shifted (2, 3);
%t := identity;
E *= t;
r0 *= t;
cuboid c;
c := out_cuboid E;
plane q;
q := (plane) r0;
ellipse e;
e := E intersection q;
message "is_elliptical e:"; %% It fails the test, but all of its `points' are
%% on the `ellipsoid'.
show is_elliptical e;
filldraw e with_color red;
draw r0 with_color blue;
draw E;
save_picture := current_picture;
endfig with_focus f no_sort;
point label_pt;
label_pt := (0, -10);
beginfig(2);
output save_picture with_projection parallel_x_z;
%label("Parallel Projection, X-Z Plane", label_pt shifted 6);
endfig with_projection parallel_x_y;
beginfig(3);
output save_picture with_projection parallel_x_y;
%label("Parallel Projection, X-Y Plane", label_pt);
endfig with_projection parallel_x_y;
beginfig(4);
output save_picture with_projection parallel_z_y;
%label("Parallel Projection, Z-Y Plane", label_pt);
endfig with_projection parallel_x_y;
verbatim_metapost "end";
end;