Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "colors.inc"
- #include "PolyhedronKit.inc"
- #declare light=<1, 0, 0> * 3.75;
- #declare light=<1, 1, 1> * 2.5;
- background {color White}
- camera {location light look_at <0, 0, 0>}
- //camera {location <-5, 0, 0> look_at <0, 0, 0>}
- light_source {light color White}
- light_source {<0, 0, 0> color White}
- #macro triBifrusta(xrot, yrot, zrot, ocolor)
- #declare height = 1.34;
- #declare bwidth = 2.325;
- #declare swidth = 1.315;
- // Main axis points
- #declare p1 = <0, 0, .577 * bwidth>;
- #declare p2 = <0, -.5 * bwidth, -.289 * bwidth>;
- #declare p3 = <0, .5 * bwidth, -.289 * bwidth>;
- // Positive axis points
- #declare p4 = <height, 0, .577 * swidth>;
- #declare p5 = <height, -.5 * swidth, -.289 * swidth>;
- #declare p6 = <height, .5 * swidth, -.289 * swidth>;
- // Negative axis points
- #declare p7 = <-height, 0, .577 * swidth>;
- #declare p8 = <-height, -.5 * swidth, -.289 * swidth>;
- #declare p9 = <-height, .5 * swidth, -.289 * swidth>;
- // Trying to keep a constant width for ease of folding
- //#declare pwidth=0.25;
- #declare pwidth=0.1;
- // Upper then lower triangular faces
- #declare triAngle=0;
- otriangle(p4, p5, p6, triAngle, pwidth, <xrot, yrot, zrot>, ocolor, true)
- otriangle(p7, p8, p9, triAngle, pwidth, <xrot, yrot, zrot>, ocolor, false)
- // Upper then lower trapezoidal faces
- #declare trapAngle=0;
- oquad(p1, p2, p5, p4, trapAngle, pwidth, <xrot, yrot, zrot>, ocolor, false)
- oquad(p2, p3, p6, p5, trapAngle, pwidth, <xrot, yrot, zrot>, ocolor, false)
- oquad(p3, p1, p4, p6, trapAngle, pwidth, <xrot, yrot, zrot>, ocolor, false)
- oquad(p1, p2, p8, p7, trapAngle, pwidth, <xrot, yrot, zrot>, ocolor, false)
- oquad(p2, p3, p9, p8, trapAngle, pwidth, <xrot, yrot, zrot>, ocolor, false)
- oquad(p3, p1, p7, p9, trapAngle, pwidth, <xrot, yrot, zrot>, ocolor, false)
- #debug "\n\n###################################"
- #debug "\nUSEFUL INFO HERE!!!!\n"
- #debug concat("Piece Width: : ", str(pwidth, 2, 4), "\n")
- #debug concat("End Triangular Piece length: ", str(swidth, 2, 4), "\n")
- #debug concat("Center Triangular Piece length: ", str(bwidth, 2, 4), "\n")
- #debug concat("Remaining Piece length: ", str(vlength(p4 - p1), 2, 4), "\n")
- #debug concat("End Triangular Angle: ", str(degrees(anglemeasure(p4, p5, p6) / 2), 2, 4), "\n")
- #debug concat("Trapazoid Acute Angle: ", str(degrees(anglemeasure(p4, p1, p2) / 2), 2, 4), "\n")
- #debug concat("Trapazoid Obtuse Angle: ", str(degrees(anglemeasure(p4, p5, p2) / 2), 2, 4), "\n")
- #end
- //triBifrusta(0, 0, 0, 1, Orange)
- triBifrusta(30, 35.2644, 45, Orange)
- //triBifrusta(-30, -35.2644, 45, Magenta)
- triBifrusta(30, 35.2644, -45, Green)
- //triBifrusta(-30, -35.2644, -45, Yellow)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement