ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/gen/markpath.csh
Revision: 2.2
Committed: Thu Jan 1 19:44:07 2004 UTC (20 years, 3 months ago) by greg
Content type: application/x-csh
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1, rad5R3, HEAD
Changes since 2.1: +3 -3 lines
Log Message:
Changed lam to rlam

File Contents

# Content
1 #!/bin/csh -f
2 # RCSid: $Id: markpath.csh,v 2.1 2003/02/22 02:07:23 greg Exp $
3 #
4 # Put right trianglar markers down a path at the given intervals.
5 # Use with replmarks to place regular-sized objects along a path.
6 # Shorter (y-side) of triangles is always horizontal (perp. to z).
7 #
8 # Input is an ordered list of 3-D points defining the path.
9 # We interpolate the path and align our markers with it.
10 # Triangles are sized and aligned so tip of one meets butt of next
11 #
12 if ($#argv < 2) then
13 echo "Usage: $0 3d.pts spacing [markmat]"
14 exit 1
15 endif
16 set pts=$1
17 set step=$2
18 set mat=mark
19 if ($#argv > 2) set mat=$3
20 set npts=`wc -l < $pts`
21 (head -1 $pts ; cat $pts) | rlam - $pts \
22 | rcalc -e '$1=d($1,$2,$3,$4,$5,$6)' -e "cond=$npts+.5-recno" \
23 -e 's(x):x*x;d(x0,y0,z0,x1,y1,z1):sqrt(s(x1-x0)+s(y1-y0)+s(z1-z0))' \
24 | total -1 -r > /tmp/run$$.dat
25 rlam /tmp/run$$.dat $pts | tabfunc -i xp yp zp > /tmp/path$$.cal
26 set tmax=`tail -1 /tmp/run$$.dat`
27 set nsteps=`ev "floor($tmax/$step)"`
28 echo $mat > /tmp/tri$$.fmt
29 cat >> /tmp/tri$$.fmt << '_EOF_'
30 polygon marker.${recno}
31 0
32 0
33 9
34 ${ x0 } ${ y0 } ${ z0 }
35 ${ x1 } ${ y1 } ${ z1 }
36 ${ x2 } ${ y2 } ${ z2 }
37
38 '_EOF_'
39 cnt $nsteps | rcalc -o /tmp/tri$$.fmt -f /tmp/path$$.cal -e st=$step \
40 -e 't=$1*st;x0=xp(t);y0=yp(t);z0=zp(t)' \
41 -e 'x1=xp(t+st);y1=yp(t+st);z1=zp(t+st)' \
42 -e 'x2=x0+.5*(y0-y1);y2=y0+.5*(x1-x0);z2=z0'
43 rm /tmp/run$$.dat /tmp/path$$.cal /tmp/tri$$.fmt