]> hackdaworld.org Git - physik/posic.git/commitdiff
manual boundaries
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Tue, 14 Aug 2007 13:15:37 +0000 (15:15 +0200)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Tue, 14 Aug 2007 13:15:37 +0000 (15:15 +0200)
visualize

index 6255e89e95af46f95fc9af50f9e1ca3b6cc052c8..f4736ea73dd174cd05a8f54e330bb938187a3250 100755 (executable)
--- a/visualize
+++ b/visualize
@@ -15,8 +15,6 @@ pigment { color White }
 EOF
 }
 
-       
-
 directory="doesnt_exist____for_sure"
 width="1024"
 height="768"
@@ -25,6 +23,8 @@ x0=""; y0=""; z0="";
 x1=""; y1=""; z1="";
 cx=""; cy=""; cz="";
 lx="0"; ly="-100"; lz="100";
+bx0=""; by0=""; bz0="";
+bx1=""; by1=""; bz1="";
 
 while [ "$1" ]; do
        case "$1" in
@@ -37,6 +37,8 @@ while [ "$1" ]; do
                -c)             cx=$2; cy=$3; cz=$4;    shift 4;;
                -l)             lx=$2; ly=$3; lz=$4;    shift 4;;
                -o)             ortographic=1;          shift 1;;
+               -b)             bx0=$2; by0=$3; bz0=$4;
+                               bx1=$5; by1=$6; bz1=$7; shift 7;;
                *)
                                echo "options:"
                                echo "########"
@@ -51,6 +53,8 @@ while [ "$1" ]; do
                                echo "  -nll <x> <y> <z> (near lower left)"
                                echo "  -fur <x> <y> <z> (far upper right)"
                                echo "  -o (ortographic)"
+                               echo "bounding box:"
+                               echo "  -b <x0> <y0> <z0> <x1> <y1> <z1>"
                                echo "povray:"
                                echo "  -c <x> <y> <z> (camera position)"
                                echo "  -l <x> <y> <z> (light source)"
@@ -118,6 +122,8 @@ EOF
        fi
 
        # boundaries
+       if [ -z "$bx0" ]; then
+
        if [ -z "$x0" ]; then
        cat $file | grep '# \[D\]' | while read foo bar x1 y1 z1 x2 y2 z2 ; do
                cat >> temp.pov <<-EOF
@@ -145,6 +151,26 @@ EOF
                draw_cyl $x1 $y1 $z1 $x1 $y1 $z0
        fi
 
+       else
+
+               # manually drawing the 3x4 boundaries specified by argv ...
+               draw_cyl $bx0 $by0 $bz0 $bx1 $by0 $bz0
+               draw_cyl $bx0 $by0 $bz0 $bx0 $by1 $bz0
+               draw_cyl $bx1 $by1 $bz0 $bx1 $by0 $bz0
+               draw_cyl $bx0 $by1 $bz0 $bx1 $by1 $bz0
+
+               draw_cyl $bx0 $by0 $bz1 $bx1 $by0 $bz1
+               draw_cyl $bx0 $by0 $bz1 $bx0 $by1 $bz1
+               draw_cyl $bx1 $by1 $bz1 $bx1 $by0 $bz1
+               draw_cyl $bx0 $by1 $bz1 $bx1 $by1 $bz1
+
+               draw_cyl $bx0 $by0 $bz1 $bx0 $by0 $bz0
+               draw_cyl $bx0 $by1 $bz1 $bx0 $by1 $bz0
+               draw_cyl $bx1 $by0 $bz1 $bx1 $by0 $bz0
+               draw_cyl $bx1 $by1 $bz1 $bx1 $by1 $bz0
+
+       fi      
+
        # add camera and light source
        cat >> temp.pov <<-EOF
 camera {