|
|
macro to create fast rounded boxes. (1/3 of superelipsoid render time).
#macro RoundedBox(X, Y, Z, R)
/*
---------------JWV 2003---------------
| |
| X = size in x direction |
| Y = size in y direction |
| Z = size in z direction |
| R = radius of edges |
| |
--------------------------------------
*/
#union{
sphere{<-X/2+R, -Y/2+R, -Z/2+R>, R}
sphere{<X/2-R, -Y/2+R, -Z/2+R>, R}
sphere{<X/2-R, -Y/2+R, Z/2-R>, R}
sphere{<-X/2+R, -Y/2+R, Z/2-R>, R}
sphere{<-X/2+R, Y/2-R, -Z/2+R>, R}
sphere{<X/2-R, Y/2-R, -Z/2+R>, R}
sphere{<X/2-R, Y/2-R, Z/2-R>, R}
sphere{<-X/2+R, Y/2-R, Z/2-R>, R}
cylinder{<-X/2+R, -Y/2+R, -Z/2+R>, <X/2-R, -Y/2+R, -Z/2+R>,R}
cylinder{<-X/2+R, Y/2-R, -Z/2+R>, <X/2-R, Y/2-R, -Z/2+R>,R}
cylinder{<-X/2+R, -Y/2+R, Z/2-R>, <X/2-R, -Y/2+R, Z/2-R>,R}
cylinder{<-X/2+R, Y/2-R, Z/2-R>, <X/2-R, Y/2-R, Z/2-R>,R}
cylinder{<X/2-R, -Y/2+R, Z/2-R>, <X/2-R, -Y/2+R, -Z/2+R>,R}
cylinder{<-X/2+R, -Y/2+R, Z/2-R>, <-X/2+R, -Y/2+R, -Z/2+R>,R}
cylinder{<X/2-R, Y/2-R, Z/2-R>, <X/2-R, Y/2-R, -Z/2+R>,R}
cylinder{<-X/2+R, Y/2-R, Z/2-R>, <-X/2+R, Y/2-R, -Z/2+R>,R}
cylinder{<X/2-R, -Y/2+R, -Z/2+R>, <X/2-R, Y/2-R, -Z/2+R>,R}
cylinder{<-X/2+R, -Y/2+R, -Z/2+R>, <-X/2+R, Y/2-R, -Z/2+R>,R}
cylinder{<X/2-R, -Y/2+R, Z/2-R>, <X/2-R, Y/2-R, Z/2-R>,R}
cylinder{<-X/2+R, -Y/2+R, Z/2-R>, <-X/2+R, Y/2-R, Z/2-R>,R}
box{<-X/2, -Y/2+R, -Z/2+R>, <X/2, Y/2-R, Z/2-R>}
box{<-X/2+R, Y/2, -Z/2+R>, <X/2-R, -Y/2, Z/2-R>}
box{<-X/2+R, -Y/2+R, Z/2>, <X/2-R, Y/2-R, -Z/2>}
}
#end
JWV
Post a reply to this message
|
|