Hello everyone!
I’m trying to figure out why this part of the code :
If code
repeat 4 {
if $>==0 nx,ny,nxb,nyb=$x,$y,$xb,$yb
elif $>==1 nx,ny=$x nxb,nyb=$xb
elif $>==2 nx,ny,nxb,nyb=$y,$x,$yb,$xb
else nx,ny=$y nxb,nyb=$yb
fi
ellipse[0] $nx%,$ny%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col1
if $dbl
if $dir ang:=$<*$angle fi
ellipse[0] $nxb%,$nyb%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col2
fi
}
Ugly!
…does not output the same image as this ?
Spam code
ellipse[0] $x%,$y%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col1
ellipse[0] $x%,$x%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col1
ellipse[0] $y%,$x%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col1
ellipse[0] $y%,$y%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col1
if $dbl
if $dir ang:=$<*$angle fi
ellipse[0] $xb%,$yb%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col2
ellipse[0] $xb%,$xb%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col2
ellipse[0] $yb%,$xb%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col2
ellipse[0] $yb%,$yb%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col2
fi
Bettery!
I think they should be equivalent? I think…
Also, is there a reason why these vars work :
col1={[$-6,$-5,$-4]}
col2:=[255,0,0]
but this one doesn’t ?
col1:=[$-6,$-5,$-4]
Full (really) dumb script below :
#@gui Sketchy Ellipses : pr_sketchy_ellipses, pr_sketchy_ellipses(1)*
#@gui : Amount = int(2000,100,5000)
#@gui : Center X = ~float(35,0,100)
#@gui : Center Y = ~float(35,0,100)
#@gui : Center XB = ~float(35,0,100)
#@gui : Center YB = ~float(35,0,100)
#@gui : Increment X = ~float(7,-10,10)
#@gui : Increment Y = ~float(4,-10,10)
#@gui : Increment XB = ~float(4,-10,10)
#@gui : Increment YB = ~float(4,-10,10)
#@gui : Inc Modifier = ~int(1000,10,1000)
#@gui : Ratio = ~float(2,0.1,5)
#@gui : Increment Size = float(4,1,10)
#@gui : Angle Factor = ~float(1,.01,10)
#@gui : Add B Set = ~bool(1)
#@gui : Invert B Direction = ~bool(1)
#@gui : Opacity = float(.3,.01,1)
#@gui : Line Pattern = text(0,0xFFFFFFFF)
#@gui : Color 1 = ~color(0,0,0)
#@gui : Color 2 = ~color(255,255,255)
pr_sketchy_ellipses:
foreach {
amount,x,y,xb,yb,SX,SY,SXB,SYB,boost,ratio,Rinc,angle,dbl,dir,op,pat=${1-17}
col1={[$-6,$-5,$-4]}
col2={[$-3,$-2,$-1]}
SX,SY,SXB,SYB/=$boost
Rinc/=100
S=0
repeat $amount {
opac:=u($op)
ang:=$>*$angle
# repeat 4 {
# if $>==0 nx,ny,nxb,nyb=$x,$y,$xb,$yb
# elif $>==1 nx,ny=$x nxb,nyb=$xb
# elif $>==2 nx,ny,nxb,nyb=$y,$x,$yb,$xb
# else nx,ny=$y nxb,nyb=$yb
# fi
# ellipse[0] $nx%,$ny%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col1
# if $dbl
# if $dir ang:=$<*$angle fi
# ellipse[0] $nxb%,$nyb%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col2
# fi
# }
ellipse[0] $x%,$y%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col1
ellipse[0] $x%,$x%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col1
ellipse[0] $y%,$x%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col1
ellipse[0] $y%,$y%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col1
if $dbl
if $dir ang:=$<*$angle fi
ellipse[0] $xb%,$yb%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col2
ellipse[0] $xb%,$xb%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col2
ellipse[0] $yb%,$xb%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col2
ellipse[0] $yb%,$yb%,$S%,{$S*$ratio}%,$ang,$opac,$pat,$col2
fi
x,y+=$SX,$SY
xb,yb+=$SXB,$SYB
S+=u($Rinc)
}
n 0,255
}