Ver en el manual en castellano Objetos CSG, en el Curso a distancia sobre POV-Ray.

Aplicación de CSG, se perfora un prisma hexagonal, con esfers y cilindros.

Recomendamos estudiar el recurso Objetos CSG.

camera {
location <-3.5, 0.25, -3.5>
look_at <0.0, 1.0, 0.0>
right x*image_width/image_height
}
camera {
location <-0.0, 0.60, -0.85>
look_at <0.0, 0.60, 0.0>
right x*image_width/image_height
}
camera {
location <-0.30, 0.10, -1.0>
look_at <0.0, 1.40, 0.0>
right x*image_width/image_height
}


Fuente de la primer imagen.


// Persistence of Vision Ray Tracer Scene Description File
// File: ejercicio_CSG_01.pov
// Vers: 3.6
// Desc: ejercicio prisma perforado con esferas y cilindros
// Date: 19 de junio de 2005
// Auth: Mario Antonio Herrero Machado
// ==== Standard POV-Ray Includes ====
#include "colors.inc" // Standard Color definitions
#include "textures.inc" // Standard Texture definitions
#include "functions.inc" // internal functions usable in user defined functions
#include "woods.inc"
//global_settings {
// assumed_gamma 1}
//===================== RADIANCE AND ENVIRONMENT SETTINGS =====================


#declare Rad_Quality = 3;

global_settings {
assumed_gamma 1

#switch (Rad_Quality)
#case (1)
radiosity { // --- Settings 1 (fast) ---
pretrace_start 0.08
pretrace_end 0.02
count 50
error_bound 0.5
recursion_limit 1
}
#break
#case (2)
radiosity { // --- Settings 2 (medium quality) ---
pretrace_start 0.08
pretrace_end 0.01
count 120
error_bound 0.25
recursion_limit 1
}
#break
#case (3)
radiosity { // --- Settings 3 (high quality) ---
pretrace_start 0.08
pretrace_end 0.005
count 400
error_bound 0.1
recursion_limit 1
}
#break
#case (4)
radiosity { // --- Settings 4 (medium quality, recursion_limit 2) ---
pretrace_start 0.08
pretrace_end 0.005
count 350
error_bound 0.15
recursion_limit 2
}
#break
#end

}

fog {
fog_type 2
fog_alt 1.3
fog_offset 0
color rgb <0.7, 0.8, 0.9>
distance 800
}

light_source {<1000, 10000, -15000> color rgb <1.0, 0.9, 0.78>*1.5} //2.3

sphere { // --- Sky ---
<0, 0, 0>, 1
texture {
pigment {
gradient y
color_map {
[0.0 color rgb < 1.0, 1.0, 1.0 >]
[0.3 color rgb < 0.5, 0.6, 1.0 >]
}
}
finish { diffuse 0 ambient 1 }
}
scale 10000
hollow on
no_shadow
}
// perspective (default) camera
camera {
location <-3.5, 0.25, -3.5>
look_at <0.0, 1.0, 0.0>
right x*image_width/image_height
}
/*
// create a regular point light source
light_source {
0*x // light's position (translated below)
color rgb <1,1,1> // light's color
translate <-20, 40, -20>
}
*/
plane{y,0 pigment{color rgb<1,1,1>}}

#declare madera=texture{T_Wood14 scale 0.125 rotate<90,0,0> translate<0.2,0,0>}

#declare prisma=prism {
linear_sweep
linear_spline
-1, // arrastraremos la siguiente figura desde aquí...
1, // ... hasta aquí.
7, // número de puntos que forman la figura ...
<0.3,0.5>, <-0.3,0.5>, <-0.5,0.0>, <-0.3,-0.5>, <0.3, -0.5>, <0.5,0.0>, <0.3,0.5>
texture{madera}
}

#declare mazo=union{
sphere{<0.0,0.0,0.0>,0.15 texture{madera}}
cylinder{<0,0,0>,<0,-0.5,0>,0.085 texture{madera}}
cylinder{<0,0,0>,<0.0,0.0,1.0>,0.085 texture{madera}}
}

#declare mazos=union{
object{mazo translate<0.0,1.2,-0.5>}
object{mazo translate<0.0,0.8,-0.5>}
object{mazo translate<0.0,0.4,-0.5>}
object{mazo translate<0.0,0.0,-0.5>}
object{mazo translate<0.0,-0.4,-0.5>}
object{mazo translate<0.0,-0.8,-0.5>}
}

#declare escultura=difference{object{prisma}
object {mazos}
//object{mazos rotate<0,30,0>}
object{mazos rotate<0,60,0>}
//object{mazos rotate<0,90,0>}
object{mazos rotate<0,120,0>}
//object{mazos rotate<0,150,0>}
object{mazos rotate<0,180,0>}
//object{mazos rotate<0,210,0>}
object{mazos rotate<0,240,0>}
//object{mazos rotate<0,270,0>}
object{mazos rotate<0,300,0>}
//object{mazos rotate<0,330,0>}
}

object{escultura translate<0,1,0>}
object{escultura translate<-1.5,1,1.5>}
object{escultura translate<1.5,1,-1.5>}