POV-Ray : Newsgroups : povray.bugreports : min_extent () & max_extent () : min_extent () & max_extent () Server Time
15 May 2024 21:58:22 EDT (-0400)
  min_extent () & max_extent ()  
From: Stephen Klebs
Date: 8 Apr 2009 05:40:00
Message: <web.49dc70c192c6fd30fc413f510@news.povray.org>
/*
Don't know if this is a known bug but the functions min_extent()
and max_extent() are not correct with cylinders and cones whose
ends are not parallel to an axis. Have not tested in 3.7.
Works correctly when rotated and translated into position.
*/
#version 3.6;

camera {
  location  -10*z
  look_at 0
  right     x*image_width/image_height
}

light_source {<-100, 100, -100> color rgb 1}

#declare Cylinder1 =
  cylinder { 0, 5*y, 1
    rotate degrees(atan(4/3))*-z
    translate <-2, -3, 0>
    pigment {color x}
  }

#declare Cylinder2 = cylinder { <-2, 0, 0>, <2, 3, 0>, 1 pigment {color y}}

#debug concat("Min 1 = ", str(min_extent (Cylinder1).z, 0, -1), "\n")
//Returns "Min 1 = -1.000000"
#debug concat("Min 2 = ", str(min_extent (Cylinder2).z, 0, -1))
//Returns "Min 2 = -1.400000"

object {Cylinder1}
object {Cylinder2}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.