|
![](/i/fill.gif) |
"Paulo Mota" <pmo### [at] gmail com> wrote:
> Can some one help me on the povray code to make the following solid:
> A rectangle defined on the xz plane (with two opposite corners <-h,0,-m> and
> <h,0,m>)
> is sweeped (by a thickness e) and rotated (by an angle a) along the y axis.
>
> Regards,
> Paulo Mota
You could use an isosurface to get what you are looking for...
I wrote a little scene code that does exactly that:
camera {
location <0.75, 0.5, -1>*7
up y
right 4/3*x
look_at 0
angle 27
}
light_source {<1, 2.5, -2>*10 color rgb 1}
#declare x_h = 0.75; // half of width
#declare y_e = 1.25; // height
#declare z_m = 0.25; // half of length
#declare r_a = 135; // rotation angle (degrees)
#declare func_box = function {max (abs (x) - x_h, abs (y - y_e/2) - y_e/2, abs
(z) - z_m)}
#declare r_a_rad_y = radians (r_a)/y_e;
#declare func_twist = function {func_box (x*cos (y*r_a_rad_y) - z*sin
(y*r_a_rad_y), y, x*sin (y*r_a_rad_y) + z*cos (y*r_a_rad_y))}
#declare twisted_box_iso =
isosurface {
function {func_twist (x, y, z)}
contained_by {box {-2, 2}}
max_gradient 3
}
object {
twisted_box_iso
pigment {
wrinkles
color_map {
[0 color rgb y]
[1 color rgb z]
}
}
finish {phong 0.5}
}
plane {
y, 0
pigment {checker color rgb <0.8, 0.2, 0.1> color rgb <1, 0.3, 0.1>}
finish {diffuse 0.25 reflection {0.3}}
}
Regards,
Florian
Post a reply to this message
|
![](/i/fill.gif) |