// -------------------------- macro RoofHeight(...)-------
#macro RoofHeight(Len,Angle)
Len*tan(radians(Angle))
#end
// -------------------------- macro RoofDiag(...)---------
#macro RoofDiag (ROver, R_Len, R_Angle, RoCyl_R)
#local RXOver = ROver*cos(radians(RoofAngle));
#local RYOver = ROver*sin(radians(RoofAngle));
cylinder{<-RXOver,-RYOver,-RXOver>,
<R_Len,RoofHeight(R_Len,R_Angle),R_Len>,
1.2*RoCyl_R
texture{Roof1 rotate<0,-45,R_Angle>}}
#end // end of macro
// --------------------------- macro Roof(...) -----------
#macro Roof (RoAngle1, // roof angle
RoLen_X11,// lenght in x
RoLen_X12,// lenght in z
RoWideZ11,// width x parts
RoWideZ12,// width z parts
RoOver, // overhang
R_Cyl, // radius cylinders
Cyl_D) // distance cylinders
union{
object{ Roof_quarter(RoAngle1,RoLen_X11,RoWideZ11,
RoOver,R_Cyl,Cyl_D)
translate< 0,0,0>}
object{ Roof_quarter(RoAngle1,RoLen_X11,RoWideZ11,
RoOver,R_Cyl,Cyl_D)
scale<-1,1,1> translate<RoWideZ12,0,0>}
object{ Roof_quarter(RoAngle1,RoLen_X12,RoWideZ12,
RoOver,R_Cyl,Cyl_D)
rotate<0, 90,0>translate<0.00,0,RoWideZ11>}
object{ Roof_quarter(RoAngle1,RoLen_X12,RoWideZ12,
RoOver,R_Cyl,Cyl_D)
rotate<0,-90,0>translate<RoWideZ12,0,0>}
union{
object{ RoofDiag (RoOver, RoLen_X11, RoAngle1, R_Cyl)
translate< 0,0,0>}
object{ RoofDiag (RoOver, RoLen_X11, RoAngle1, R_Cyl)
rotate<0,-90,0> translate<RoWideZ12,0,0>}
object{ RoofDiag (RoOver, RoLen_X11, RoAngle1, R_Cyl)
rotate<0,180,0> translate<RoWideZ12,0,RoWideZ11>}
object{ RoofDiag (RoOver, RoLen_X11, RoAngle1, R_Cyl)
rotate<0, 90,0> translate< 0,0,RoWideZ11>}
cylinder{<0,0,0>,<0,0,RoWideZ11-RoWideZ12>,1.2*R_Cyl
translate<RoLen_X11,
RoHeight(RoLen_X11,
RoAngle1),RoLen_X12>
texture{Roof1 rotate<0,90,0>}
}// end of cylinder
translate<0,0.05,0>}
} #end // -----------------end of Roof(...) macro ------ |