Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
    POV-Ray Examples - How To Make Objects for POV-Ray
Italiano Italiano
Français français
Deutsch Deutsch

Home
- POV-Ray Tutorial
  - POV-Ray Examples
   Index of Content
  - Geometry
  - Architecture
    - House
    - Roof
    - Tower
    - Castle
    - Window + Door
        - Window
        - Door
        - Shoji
        - Paravent
    - Stairs
    - Pyramid
    - Columns
    - Arch
    - Fences
    - Furnitur
    - Household
  - Engineering
                                       
 
Door

Door by macro

Objects: "box", "sphere", "cylinder".
Methods: "difference", "union", "#declare", "macro".
The construction in details:
The door is constructed in a similar way to the "Window". It's made as a macro to let the door open angle be free to choose.
An include file to use this object as a read-made object you can find at my POV-Ray Objects page.
//-----------------------------------------
#macro Door (Door_Angle) //----------------
union{  // I
 difference{
  box{<-0.50,0.01,-0.02>,< 0.50,1.80,0.02>}
  box{<-0.45,0.85,-0.03>,<-0.03,1.27,0.03>}
  box{< 0.03,0.85,-0.03>,< 0.45,1.27,0.03>}
  box{<-0.45,1.33,-0.03>,<-0.03,1.75,0.03>}
  box{< 0.03,1.33,-0.03>,< 0.45,1.75,0.03>}
  texture{Door_Texture_1}
  } // ---end of difference
 box{ <-0.49,0.81,0>,< 0.49,1.79,0.001>
      texture{T_Glass3}}  // no interior!!!
 // door handle
 union{ // II
  sphere  {<-0.15,0,-0.07>, 0.015 }
  cylinder{<-0.15,0,-0.07>,<0,0,-0.1>,0.015}
  sphere  {< 0,0,-0.07>, 0.015}
  cylinder{< 0,0,-0.07 >,<0,0,0>,0.015}
  cylinder{< 0,0,-0.035>,<0,0,0>,0.04}
  texture { Chrome_Metal }
  translate<0.43,0.75,0>
  }// end of union II

 // rotation of the door:
 translate< 0.50,0,0>
 rotate<0,-Door_Angle,0>
 translate<-0.50,0,0>
 } // ---end of union I
#end // ----------- end of Door(...) macro
//-----------------------------------------

#declare Door_Hole =   //symmetric!!!
  box{<-0.50,0.01,-0.50>,< 0.50,1.80,0.50>
      texture{Wall_Texture_2}}
//--------- end of Door_Hole --------------
A door with windows and handle.
 

To place the doors in their positions we have to define their positions. Then we can also easily subtract the door holes from the wall and add doors to their positions.

#declare Door_Positon_1 = <-1,0,0>;
#declare Door_Positon_1 = < 1,0,0>;

difference{
box   { <-2,0,0>,< 2,2.3,0.2>
        texture {Wall_Texture_1}}
object{ Door_Hole translate Door_Positon_a}
object{ Door_Hole translate Door_Positon_b}
} // end of difference --------------------

object{ Door(85) translate Door_Positon_1}
object{ Door(25) scale<-1,1,1>
                 translate Door_Positon_2}
//-----------------------------------------
This makes to following image:
Door
Click here for the scene description for POV-Ray:
".txt" file oder ".pov" file
Ready-made POV-Ray objects as
include files and example files you'll find
at the POV-Ray Objects Page
top

© Friedrich A. Lohmüller, 2012
www.f-lohmueller.de