Hi
From building a tree in Blender I got to arabaro (java) form there to povray and
very nice in Blender 2.5.8 there is a Povray-addon using Povray 3.7 (not lower!) and
works nicely!
Got interested in Povray ans saw lots of examples available!
This povray-code e.g (main part, lighting camera etc. left off):
#declare Hx = 2.00;
#declare Hy = 3.50;
#declare Hz = 4.00;
#declare Roof_Angle = 25;//38;
difference{
box { <-Hx,0,0>,< Hx,Hy,Hz>
texture { pigment{ color Green}
finish { phong 1}
} // end of texture
scale <1,1,1> rotate<0,0,0> translate<0,0,0>
no_shadow
} // end of box --------------------------------------
plane{ <0,-1,0>,0
texture { pigment{ color rgb<1,0,0>}
finish { phong 1}
} // end of texture
rotate<0,0,Roof_Angle>
translate<0,Hy,0>
}
plane{ <0,-1,0>,0
texture { pigment{ color rgb<1,1,1>}
finish { phong 1}
} // end of texture
rotate<0,0,-Roof_Angle>
translate<0,Hy,0>
}
}// end of difference
Showing how to use ‘difference’ ==> inspiring me to use a boolean Modifier
to lead me to:
import bpy
from math import radians
#van de kubus schuine stukken afsnijden
#NL huis = EN house = DE Haus = FR maison
#NL neiging (an het dak) = EN .. = DE Neigungg (des Daches)
def maakHuis(neigingLinks = 30, neigingRechts = 30):
bpy.ops.mesh.primitive_cube_add()
cube = bpy.context.active_object
bpy.ops.mesh.primitive_plane_add()
huis = bpy.context.active_object
huis.name = "Huis"
bpy.ops.transform.resize(value=(2, 2, 2))
bpy.ops.transform.translate(value=(0, 0, 0.5))
bpy.ops.transform.rotate(value=(radians(neigingLinks),), axis=(1, 0, 0), constraint_axis=(True, False, False))
bpy.ops.object.modifier_add(type='BOOLEAN')
mod = huis.modifiers[-1]
print(mod.operation)
mod.object = cube
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Boolean")
bpy.ops.object.select_all(action='TOGGLE')
cube.select = True
bpy.ops.object.delete()
# deel 1 klaar herhalen met tweede 'plane'
bpy.ops.mesh.primitive_plane_add()
bpy.ops.transform.resize(value=(2, 2, 2))
bpy.ops.transform.translate(value=(0, 0, 0.5))
bpy.ops.transform.rotate(value=(-radians(neigingRechts),), axis=(1, 0, 0), constraint_axis=(True, False, False))
mijnhuis = bpy.context.active_object
mijnhuis.name = "mijn huis"
bpy.ops.object.modifier_add(type='BOOLEAN')
modmijnhuis = mijnhuis.modifiers[-1]
modmijnhuis.object = huis
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Boolean")
bpy.ops.object.select_all(action='TOGGLE')
huis.select = True
bpy.ops.object.delete()
mijnhuis.select = True
bpy.ops.transform.translate(value=(0, 0, 1))
return mijnhuis
maakHuis()
Nice, isn’t it?
Consequence, learn building objects from Povray!