Get Minimum and Maximum coordinates of a POV-RAY Object

166 Views Asked by At

I need to get the lowest and highest X, Y and Z values of an object in a .pov ray file that has been created with the union of multiple shapes (boxes, cylinder, spheres etc.).

1

There are 1 best solutions below

0
On

You're looking for the min_extend and max_extend functions

#declare Sphere =
sphere {
  <0,0,0>, 1
  pigment { rgb <1,0,0> }
  }

#declare Min = min_extent ( Sphere );
#declare Max = max_extent ( Sphere );

object { Sphere }
box {
  Min, Max
  pigment { rgbf <1,1,1,0.5> }
  }