/usr/share/octave/packages/vrml-1.0.13/vrml_lines.m is in octave-vrml 1.0.13-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | ## Copyright (C) 2002 Etienne Grossmann <etienne@egdn.net>
##
## This program 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.
##
## This program 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
## this program; if not, see <http://www.gnu.org/licenses/>.
## s = vrml_lines(x,f,...)
##
## x : 3xP : The 3D points
## f : 3xQ : The indexes of the points forming the lines. Indexes
## should be in 1:P.
##
## Returns a Shape -> IndexedLineSet vrml node.
##
## No check is done on anything
##
## Options :
##
## "col" , col : 3x1 : Color, default = [1,0,0]
function s = vrml_lines(x,f,varargin)
if nargin < 2, f = ones (1,columns(x)); end
col = [1, 0, 0] ;
opt1 = " col " ;
opt0 = " " ;
verbose = 0 ;
i=1;
while (nargin -2) >=i ,
tmp = varargin{i++} ; # pos 2.1.39
if ! ischar(tmp) ,
error ("vrml_lines : Non-string option : \n") ;
## keyboard
end
if index(opt1,[" ",tmp," "]) ,
tmp2 = varargin{i++}; # pos 2.1.39
## args-- ;
eval([tmp,"=tmp2;"]) ;
if verbose , printf ("vrml_lines : Read option : %s.\n",tmp); end
elseif index(opt0,[" ",tmp," "]) ,
eval([tmp,"=1;"]) ;
if verbose , printf ("vrml_lines : Read boolean option : %s\n",tmp); end
else
error ("vrml_lines : Unknown option : %s\n",tmp) ;
## keyboard
end
endwhile
if exist("col")!=1, col = [0.5, 0.5, 0.8]; end
s = sprintf([... # string of indexed face set
"Shape {\n",...
" appearance Appearance {\n",...
" material Material {\n",...
" diffuseColor %8.3f %8.3f %8.3f \n",...
" emissiveColor %8.3f %8.3f %8.3f\n",...
" }\n",...
" }\n",...
" geometry IndexedLineSet {\n",...
" coordIndex [\n%s]\n",...
" coord Coordinate {\n",...
" point [\n%s]\n",...
" }\n",...
" }\n",...
"}\n",...
],...
col,col,...
sprintf(" %4d, %4d, %4d, -1,\n",f-1),...
sprintf(" %8.3f %8.3f %8.3f,\n",x)) ;
endfunction
|