pickover evolutif
This commit is contained in:
parent
f89860afe0
commit
756ef965fd
1
Fraktalism/.gitignore
vendored
1
Fraktalism/.gitignore
vendored
@ -6,6 +6,7 @@ voxelize
|
|||||||
evolvopick
|
evolvopick
|
||||||
|
|
||||||
WS/*.dat
|
WS/*.dat
|
||||||
|
WS/*.txt
|
||||||
|
|
||||||
*.pgm
|
*.pgm
|
||||||
*.gif
|
*.gif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
GFOPT = -Wall -Wextra -time -g -pg -Imods/
|
GFOPT = -Wall -Wextra -time -O -Imods/
|
||||||
|
|
||||||
# ---------------------------------------------
|
# ---------------------------------------------
|
||||||
|
|
||||||
|
15
Fraktalism/encode.sh
Executable file
15
Fraktalism/encode.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DDIR="frames/pick3d"
|
||||||
|
|
||||||
|
echo "Encoding from " $DDIR
|
||||||
|
|
||||||
|
ffmpeg -nostdin \
|
||||||
|
-loglevel warning \
|
||||||
|
-y -r 25 -f image2 -i $DDIR/%05d.png \
|
||||||
|
-metadata artist='---[ tTh ]---' \
|
||||||
|
-metadata title='---[ experiment ]---' \
|
||||||
|
-c:v libx264 -pix_fmt yuv420p \
|
||||||
|
clifford-evolv-0.mp4
|
||||||
|
|
||||||
|
|
@ -13,44 +13,57 @@ program evolvopick
|
|||||||
double precision :: dptick
|
double precision :: dptick
|
||||||
type(t_point3d), dimension(:), allocatable :: points
|
type(t_point3d), dimension(:), allocatable :: points
|
||||||
integer :: nbpoints
|
integer :: nbpoints
|
||||||
integer :: errcode
|
integer :: fd, errcode
|
||||||
character (len=200) :: command
|
character (len=200) :: command
|
||||||
|
|
||||||
KA(1) = 2.24 ; KA(2) = 0.43
|
KA(1) = -1.42 ; KA(2) = 1.62
|
||||||
KA(3) = -0.65 ; KA(4) = -2.43
|
KA(3) = 1.08 ; KA(4) = -2.43
|
||||||
KB(1) = 1.11 ; KB(2) = 0.22
|
|
||||||
KB(3) = 1.65 ; KB(4) = -1.43
|
|
||||||
|
|
||||||
nbsteps = 1199
|
KB(1) = 1.51 ; KB(2) = -1.89
|
||||||
nbpoints = 26000
|
KB(3) = 1.69 ; KB(4) = 0.79
|
||||||
|
|
||||||
|
nbsteps = 1800
|
||||||
|
nbpoints = 70000
|
||||||
allocate(points(nbpoints), stat=errcode)
|
allocate(points(nbpoints), stat=errcode)
|
||||||
if (0 .NE. errcode) then
|
if (0 .NE. errcode) then
|
||||||
STOP " : EVOLVOPICK, NO ENOUGH MEMORY"
|
STOP " : EVOLVOPICK, NO ENOUGH MEMORY"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
do tick = 0, nbsteps
|
do tick = 0, nbsteps-1
|
||||||
|
|
||||||
dptick = DBLE(tick) / DBLE(nbsteps)
|
dptick = DBLE(tick) / DBLE(nbsteps)
|
||||||
! print *, tick, " ", dptick
|
! print *, tick, " ", dptick
|
||||||
call interp4dp(KA, KB, KI, dptick)
|
call interp4dp(KA, KB, KI, dptick)
|
||||||
! print *, KI(1), KI(2), KI(3), KI(4)
|
! print *, KI(1), KI(2), KI(3), KI(4)
|
||||||
write(0, '(1X, I8, 3X, 4F12.6)') tick, KI
|
write(0, '(1X, I8, 3X, 4F11.6)') tick, KI
|
||||||
|
|
||||||
|
! mmmm, not optimal
|
||||||
|
open (newunit=fd, file='WS/k-pick.txt', &
|
||||||
|
status='unknown', position='append', &
|
||||||
|
action='write', iostat=errcode)
|
||||||
|
if (0 .NE. errcode) then
|
||||||
|
STOP ' : FUBAR ON OUTPUT FILE'
|
||||||
|
endif
|
||||||
|
write(fd, '(I5, 4X, 4F8.4)') tick, KI
|
||||||
|
close(fd)
|
||||||
|
!
|
||||||
|
|
||||||
call compute_pickover(points, KI)
|
call compute_pickover(points, KI)
|
||||||
call write_points3d(points, 7, 25990, 'WS/pick.dat')
|
call write_points3d(points, 27, 69900, 'WS/pick.dat')
|
||||||
|
|
||||||
write(command, '(A, I6)') './tracepick.sh ', tick
|
write(command, '(A, I6)') './tracepick.sh ', tick
|
||||||
call execute_command_line (command, exitstat=errcode)
|
call execute_command_line (command, exitstat=errcode)
|
||||||
if (0 .NE. errcode) then
|
if (0 .NE. errcode) then
|
||||||
STOP ' : ERR RUN COMMAND !'
|
STOP ' : ERR RUN TRACE COMMAND !'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
!-----------------------------------------------------
|
!-----------------------------------------------------
|
||||||
|
|
||||||
contains
|
contains
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
subroutine interp4dp (ina, inb, out, dpk)
|
subroutine interp4dp (ina, inb, out, dpk)
|
||||||
double precision, dimension(4), intent(in) :: ina, inb
|
double precision, dimension(4), intent(in) :: ina, inb
|
||||||
double precision, dimension(4), intent(out) :: out
|
double precision, dimension(4), intent(out) :: out
|
||||||
@ -63,6 +76,4 @@ program evolvopick
|
|||||||
|
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end program evolvopick
|
end program evolvopick
|
||||||
|
@ -27,6 +27,9 @@ subroutine simple_julia(pic, cx, cy, maxiter)
|
|||||||
C = complex(cx, cy)
|
C = complex(cx, cy)
|
||||||
print *, "Const = ", C
|
print *, "Const = ", C
|
||||||
|
|
||||||
|
! ready ? ok, clear the picture
|
||||||
|
pic = 0
|
||||||
|
|
||||||
do ix = 1, width
|
do ix = 1, width
|
||||||
fx = (float(ix) / (float(width)/4.0) - 2.0)
|
fx = (float(ix) / (float(width)/4.0) - 2.0)
|
||||||
do iy = 1, height
|
do iy = 1, height
|
||||||
@ -50,11 +53,10 @@ subroutine simple_julia(pic, cx, cy, maxiter)
|
|||||||
if (over_iter) then
|
if (over_iter) then
|
||||||
pic(ix, iy) = 0
|
pic(ix, iy) = 0
|
||||||
else
|
else
|
||||||
pic(ix, iy) = iter
|
pic(ix, iy) = iter*12
|
||||||
endif
|
endif
|
||||||
|
enddo ! iy
|
||||||
enddo
|
enddo ! ix
|
||||||
enddo
|
|
||||||
|
|
||||||
end subroutine simple_julia
|
end subroutine simple_julia
|
||||||
!-----------------------------------------------------
|
!-----------------------------------------------------
|
||||||
@ -70,25 +72,19 @@ subroutine compute_pickover(array, coefs)
|
|||||||
integer :: i
|
integer :: i
|
||||||
! print *, "coefs ", coefs
|
! print *, "coefs ", coefs
|
||||||
|
|
||||||
write(0, '(1X, A18, I9)') "compute pickover ", ubound(array, 1)
|
! write(0, '(1X, A18, I9)') "compute pickover ", ubound(array, 1)
|
||||||
|
|
||||||
xa = 0.00 ; ya = 0.00 ; za = 0.0
|
xa = 1.0 ; ya = 1.0 ; za = 1.0
|
||||||
|
|
||||||
do i=1, ubound(array, 1)
|
do i=1, ubound(array, 1)
|
||||||
|
|
||||||
xb = sin(coefs(1)*ya) - za*cos(coefs(2)*xa)
|
xb = sin(coefs(1)*ya) - za*cos(coefs(2)*xa)
|
||||||
yb = za*sin(coefs(3)*xa) - cos(coefs(4)*ya)
|
yb = za*sin(coefs(3)*xa) - cos(coefs(4)*ya)
|
||||||
zb = sin(xa)
|
zb = sin(xa)
|
||||||
|
|
||||||
array(i)%x = xb
|
array(i)%x = xb
|
||||||
array(i)%y = yb
|
array(i)%y = yb
|
||||||
array(i)%z = zb
|
array(i)%z = zb
|
||||||
array(i)%seq = i
|
array(i)%seq = i
|
||||||
|
|
||||||
xa = xb ; ya = yb ; za = zb
|
xa = xb ; ya = yb ; za = zb
|
||||||
|
|
||||||
! print *, xb, yb, zb
|
|
||||||
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
end subroutine
|
end subroutine
|
||||||
@ -114,6 +110,9 @@ subroutine plot_pickover(pic, count)
|
|||||||
STOP " : NO ENOUGH MEMORY"
|
STOP " : NO ENOUGH MEMORY"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
! Clear the picture
|
||||||
|
pic = 0
|
||||||
|
|
||||||
coefs(1) = 2.24 ; coefs(2) = 0.43
|
coefs(1) = 2.24 ; coefs(2) = 0.43
|
||||||
coefs(3) = -0.65 ; coefs(4) = -2.43
|
coefs(3) = -0.65 ; coefs(4) = -2.43
|
||||||
call compute_pickover(points, coefs)
|
call compute_pickover(points, coefs)
|
||||||
@ -122,11 +121,9 @@ subroutine plot_pickover(pic, count)
|
|||||||
h = ubound(pic, 2)
|
h = ubound(pic, 2)
|
||||||
|
|
||||||
do i=1, ubound(points, 1)
|
do i=1, ubound(points, 1)
|
||||||
|
px = int((points(i)%x * (w/4.09)) + (w / 2))
|
||||||
px = (points(i)%x * (w/4.09)) + (w / 2)
|
py = int((points(i)%y * (h/4.09)) + (h / 2))
|
||||||
py = (points(i)%y * (h/4.09)) + (h / 2)
|
pic(px, py) = 255 ! WARNING COREDUMP ?
|
||||||
pic(px, py) = 255 ! WARNING COREDUMP
|
|
||||||
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
deallocate(points)
|
deallocate(points)
|
||||||
|
@ -10,6 +10,8 @@ module points3d
|
|||||||
!-----------------------------------------------------
|
!-----------------------------------------------------
|
||||||
contains
|
contains
|
||||||
|
|
||||||
|
!-----------------------------------------------------
|
||||||
|
|
||||||
subroutine list_points3d(array, start, length)
|
subroutine list_points3d(array, start, length)
|
||||||
type(t_point3d), dimension(:), intent(in) :: array
|
type(t_point3d), dimension(:), intent(in) :: array
|
||||||
integer, intent(in) :: start, length
|
integer, intent(in) :: start, length
|
||||||
@ -38,7 +40,7 @@ subroutine write_points3d(array, start, length, fname)
|
|||||||
|
|
||||||
integer :: sz, i, j, io
|
integer :: sz, i, j, io
|
||||||
|
|
||||||
write(0, '(1X, A15, 2I9)') "write pt3d ", start, length
|
! write(0, '(1X, A15, 2I9)') "write pt3d ", start, length
|
||||||
sz = ubound(array, 1)
|
sz = ubound(array, 1)
|
||||||
if ((start+length) .GT. sz) then
|
if ((start+length) .GT. sz) then
|
||||||
STOP ' : WRITE P3D, OUT OF BOUND'
|
STOP ' : WRITE P3D, OUT OF BOUND'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
POVOPT=" -d +q9 +a +W1024 +H768 -v +WT2"
|
POVOPT=" -d +q9 +a +W1280 +H1024 -v +WT4"
|
||||||
TMPNG="/dev/shm/evolv.png"
|
TMPNG="/dev/shm/evolv.png"
|
||||||
|
|
||||||
outfile=$(printf "frames/pick3d/%05d.png" $1)
|
outfile=$(printf "frames/pick3d/%05d.png" $1)
|
||||||
@ -8,18 +8,29 @@ outfile=$(printf "frames/pick3d/%05d.png" $1)
|
|||||||
|
|
||||||
awk -f pick2pov.awk < WS/pick.dat > WS/pickover.inc
|
awk -f pick2pov.awk < WS/pick.dat > WS/pickover.inc
|
||||||
|
|
||||||
PASS=900
|
PASS=2222
|
||||||
|
|
||||||
povray -ipick3d.pov -K120 ${POVOPT} \
|
povray -ipick3d.pov -K120 ${POVOPT} \
|
||||||
Declare=NBPASS=${PASS} \
|
Declare=NBPASS=${PASS} \
|
||||||
-O${TMPNG} 2> toto
|
-O${TMPNG} 2> WS/err-tracepick.txt
|
||||||
|
|
||||||
convert ${TMPNG} \
|
title="Clifford Pickover strange attractor"
|
||||||
-fill Gray50 \
|
tdate=$(date +'%F %R:%S')
|
||||||
-gravity South-West \
|
# echo $tdate
|
||||||
-pointsize 24 \
|
coefs=$(tail -1 WS/k-pick.txt)
|
||||||
-annotate +20+10 "tTh" \
|
# echo $coefs
|
||||||
|
txt=$(printf '%s %s' "$tdate" "$coefs")
|
||||||
|
|
||||||
|
convert ${TMPNG} \
|
||||||
|
-fill Orange \
|
||||||
|
-font Courier-Bold \
|
||||||
|
-pointsize 32 \
|
||||||
|
-gravity North-West \
|
||||||
|
-annotate +30+30 "${title}" \
|
||||||
|
-pointsize 22 \
|
||||||
|
-gravity South-West \
|
||||||
|
-annotate +30+30 "${txt}" \
|
||||||
$outfile
|
$outfile
|
||||||
|
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user