release of voxel-2

This commit is contained in:
tth 2022-04-10 01:41:42 +02:00
parent 85d6b57eee
commit 694066169c
4 changed files with 35 additions and 24 deletions

View File

@ -12,34 +12,36 @@ fi
./voxelize > WS/voxels.dat ./voxelize > WS/voxels.dat
./vox2inc.awk < WS/voxels.dat > WS/voxels.inc ./vox2inc.awk < WS/voxels.dat > WS/voxels.inc
grep NbrVox WS/voxels.inc
TMPNG="/dev/shm/voxvidz.png" TMPNG="/dev/shm/voxvidz.png"
NBIMG=360 NBIMG=360
for idx in $( seq 0 $(( NBIMG - 1)) ) for idx in $( seq 0 $(( NBIMG - 1)) )
do do
dst=$(printf "frames/voxel/%05d.png" $idx) dst=$(printf "frames/voxel/%05d.png" $idx)
delta=$( echo "scale=3 ; ${idx}/360" | bc -l) delta=$( echo "scale=6 ; ${idx}/360" | bc -l)
echo "Renderbox work on " $dst " tu" $delta echo "Renderbox work on "$dst" delta = " $delta
povray -ishowvoxels.pov -K$idx ${POVOPT} \ povray -ishowvoxels.pov -K$idx ${POVOPT} \
-O${TMPNG} 2> WS/toto.err -O${TMPNG} 2> WS/toto.err
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
echo "ERROR ERROR ERROR ERROR" echo "ERROR ERROR ERROR ERROR ERROR ERROR"
tail -15 WS/toto.err tail -15 WS/toto.err
sleep 20 sleep 20
#exit 1 #exit 1
fi fi
titre='>>> Voxelisation - tTh - avril 2022' titre='Voxelisation - tTh - avril 2022'
numbers=$(tail -1 WS/camvox.log | \ numbers=$(tail -1 WS/camvox.log | \
awk '{printf ">>> %6.3f %6.3f %6.3f", $1, $2, $3}') awk '{printf " %6.3f %6.3f %6.3f", $1, $2, $3}')
echo $numbers echo "$numbers"
convert ${TMPNG} \ convert ${TMPNG} \
-fill Cyan \ -fill Gray70 \
-kerning 1 \ -kerning 1 \
-pointsize 16 \ -pointsize 24 \
-font AvantGarde-Book \ -font AvantGarde-Book \
-gravity South-West \ -gravity South-West \
-annotate +20+32 "$titre" \ -annotate +20+32 "$titre" \
@ -51,4 +53,4 @@ do
done done
./encode.sh frames/voxel/ voxel-1.mp4 ./encode.sh frames/voxel/ voxel-2.mp4

View File

@ -17,7 +17,7 @@ global_settings {
#declare VOXEL = object #declare VOXEL = object
{ {
// sphere { 0, 1.18 } // sphere { 0, 1.18 }
#local D = 1.38; #local D = 1.0111;
box { <-D, -D, -D>, <D, D, D> } box { <-D, -D, -D>, <D, D, D> }
} }
@ -34,18 +34,18 @@ object {
//---------------------------------------------------------------- //----------------------------------------------------------------
// light_source { <-12, 45, -25> color Gray70 } // light_source { <-12, 45, -25> color Gray70 }
light_source { <-52, 5, -38> color Yellow*0.55 } light_source { <-52, 5, -38> color Yellow*0.45 }
light_source { < 59, 5, 48> color Gray20 } light_source { < 59, 5, 48> color Gray20 }
light_source { < 3, -59, 8> color Red*0.75 } light_source { < 3, 59, 8> color Red*0.65 }
light_source { < 8, 61, 3> color Green*0.85 } light_source { < 8, -61, 3> color Green*0.75 }
#declare NormClock = (clock/360); #declare NormClock = (clock/360);
#declare ECAM = 88 - 23*NormClock; #declare ECAM = 88 - (73*NormClock);
#declare XCAM = ECAM * sin(radians(clock)); #declare XCAM = ECAM * sin(radians(clock));
#declare YCAM = -12; #declare YCAM = -12;
#declare ZCAM = ECAM * cos(radians(clock)); #declare ZCAM = ECAM * cos(radians(clock));
#declare ACAM = 65 + (27*NormClock); #declare ACAM = 65 + (48*NormClock);
#if (0 = clock) #if (0 = clock)
#fopen CL "WS/camvox.log" write #fopen CL "WS/camvox.log" write

View File

@ -9,7 +9,7 @@ BEGIN {
print "union {" print "union {"
} }
$4 > 145 { $4 > 500 {
count = $4 count = $4
value = $5 value = $5
if (count > maxcount) if (count > maxcount)

View File

@ -7,23 +7,25 @@
program voxelize program voxelize
use fraktals use fraktals
implicit none
integer, parameter :: DIM = 100 integer, parameter :: DIM = 100
integer, dimension(:,:,:), allocatable :: cube integer, dimension(:,:,:), allocatable :: cube
type(t_point3d), dimension(:), allocatable :: points type(t_point3d), dimension(:), allocatable :: points
integer :: errcode, foo integer :: errcode, foo
integer :: ix, iy, iz integer :: ix, iy, iz
double precision, dimension(4) :: coefs integer :: nbr_points
double precision, dimension(4) :: coefs, KB
double precision :: dval double precision :: dval
! XXX foo = (DIM*DIM*DIM) / (1024) write(0, *) "--- start of voxelize"
! XXX PRINT *, "memory request for cube (in Kwords) ", foo
allocate (cube(DIM,DIM,DIM), stat=errcode) allocate (cube(DIM,DIM,DIM), stat=errcode)
if (0 .NE. errcode) then if (0 .NE. errcode) then
STOP " : NO ENOUGH MEMORY FOR CUBE" STOP " : NO ENOUGH MEMORY FOR CUBE"
endif endif
nbr_points = 3100000 nbr_points = 2800000
allocate(points(nbr_points), stat=errcode) allocate(points(nbr_points), stat=errcode)
if (0 .NE. errcode) then if (0 .NE. errcode) then
STOP " : NO ENOUGH MEMORY FOR POINTS" STOP " : NO ENOUGH MEMORY FOR POINTS"
@ -31,7 +33,10 @@ program voxelize
coefs(1) = 2.23 ; coefs(2) = 0.42 coefs(1) = 2.23 ; coefs(2) = 0.42
coefs(3) = -0.64 ; coefs(4) = -2.42 coefs(3) = -0.64 ; coefs(4) = -2.42
call compute_pickover(points, coefs)
KB(1) = 1.51 ; KB(2) = -1.89
KB(3) = 1.69 ; KB(4) = 0.79
call compute_pickover(points, KB)
call clear_cube(cube) call clear_cube(cube)
@ -46,7 +51,7 @@ program voxelize
enddo enddo
dval = DBLE(MAXVAL(cube)) dval = DBLE(MAXVAL(cube))
write(0, *) "--- cube maximum = ", dval write(0, *) "--- maximum of the cube= ", dval
do foo=1, nbr_points do foo=1, nbr_points
call fcoor2icoor(points(foo)%x, ix) call fcoor2icoor(points(foo)%x, ix)
@ -57,6 +62,9 @@ program voxelize
DBLE(cube(ix,iy,iz)) / dval DBLE(cube(ix,iy,iz)) / dval
enddo enddo
dval = DBLE(MAXVAL(cube))
write(0, *) "--- end of voxelize"
!----------------------------------------------------- !-----------------------------------------------------
contains contains
!----------------------------------------------------- !-----------------------------------------------------
@ -76,7 +84,7 @@ subroutine fcoor2icoor(in, out)
if (outvalue .GE. DIM) out = DIM-1 if (outvalue .GE. DIM) out = DIM-1
end subroutine end subroutine
!----------------------------------------------------- !------------------------------------------------------------
subroutine clear_cube(cube) subroutine clear_cube(cube)
type(integer), dimension(:,:,:), intent(out) :: cube type(integer), dimension(:,:,:), intent(out) :: cube
@ -91,7 +99,7 @@ subroutine clear_cube(cube)
enddo enddo
end subroutine end subroutine
!----------------------------------------------------- !------------------------------------------------------------
subroutine spit_cube_as_union(fname, datas, notused) subroutine spit_cube_as_union(fname, datas, notused)
character(*) :: fname character(*) :: fname
type(integer), dimension(:,:,:), intent(in) :: datas type(integer), dimension(:,:,:), intent(in) :: datas
@ -106,6 +114,7 @@ subroutine spit_cube_as_union(fname, datas, notused)
STOP ' : SPITUNION : FAIL OPEN OUTPUT FILE' STOP ' : SPITUNION : FAIL OPEN OUTPUT FILE'
endif endif
close(fd) close(fd)
end subroutine end subroutine