Unwrapping a Prism
Author: Mike May, S.J.
Date: December 23, 2008

An Applet form the net showing how a prism unwraps

Contributed to the forum by luxmath.

NumberSides = 4 (slider from 3 to 50, step 1)
SideTurnAngle: 2.000000000000000 * 3.141592653589793 / NumberSides
UnwindFaces = 0 (slider from 0 to 1, step 0.01)
FaceAnglesUnwound = Sequence(n * (SideTurnAngle - 2.000000000000000 * 3.141592653589793 UnwindFaces / NumberSides), n, 0.000000000000000, NumberSides - 1.000000000000000)
FaceAnglesUnwoundSin: sin(FaceAnglesUnwound)
FaceAngles = Sequence(2.000000000000000 * 3.140000000000000 / NumberSides i, i, 0.000000000000000, NumberSides - 1.000000000000000)
ViewAngle = 0.5 (slider from -1 to 1, step 0.05)
α = 1.3962634015954636 rad (slider from 0 to 3.141592653589793, step 0.08726646259971647)
perimeter = 18 (slider from 0 to 40, step 0.1)
FaceAnglesCos: cos(FaceAngles)
ViewAngleSin: sin(α) ViewAngle
FaceAnglesSumCos = Sequence(Sum[FaceAnglesCos, k], k, 1.000000000000000, NumberSides)
FaceAnglesSin: sin(FaceAngles)
FaceAnglesSumSin = Sequence(Sum[FaceAnglesSin, k], k, 1.000000000000000, NumberSides)
topAngle = 0 (slider from 0 to 1.57, step 0.01)
RectangleWidth: perimeter / NumberSides
ViewAngleCos: cos(α) ViewAngle
BasePoint = (3.984352898797222, 0.08544125842693615)
FaceAnglesUnwoundCos: cos(FaceAnglesUnwound)
FaceAnglesUnwoundSumSin = Sequence(Sum[FaceAnglesUnwoundSin, k], k, 1.000000000000000, NumberSides)
FaceAnglesUnwoundSumCos = Sequence(Sum[FaceAnglesUnwoundCos, k], k, 1.000000000000000, NumberSides)
RectanglesTopCorner = Sequence(BasePoint + RectangleWidth (Element[FaceAnglesUnwoundSumCos, k] + ViewAngleCos Element[FaceAnglesUnwoundSumSin, k], -1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 ViewAngleSin Element[FaceAnglesUnwoundSumSin, k]), k, 1.000000000000000, NumberSides)
VerticesTopFace = Sequence(BasePoint + RectangleWidth (Element[FaceAnglesSumCos, k] + ViewAngleCos cos(topAngle) Element[FaceAnglesSumSin, k], (sin(topAngle) - ViewAngleSin cos(topAngle)) Element[FaceAnglesSumSin, k]), k, 1.000000000000000, NumberSides)
height = 6 (slider from 0 to 10, step 0.1)
RectanglesBottomCorner = Sequence(Element[RectanglesTopCorner, k] + height (0.000000000000000, -1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000), k, 1.000000000000000, NumberSides)
R_0: BasePoint + height (0.000000000000000, -1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000)
EdgesSides = Sequence(Polygon[Element[RectanglesTopCorner, k], Element[RectanglesTopCorner, k + 1.000000000000000], Element[RectanglesBottomCorner, k + 1.000000000000000], Element[RectanglesBottomCorner, k]], k, 1.000000000000000, NumberSides)
EdgesFaceSudes = Sequence(Segment[Element[RectanglesTopCorner, k], Element[RectanglesBottomCorner, k]], k, 1.000000000000000, NumberSides)
EdgeSideFirst = Segment(BasePoint, R_0)
EdgesTop = Sequence(Segment[Element[VerticesTopFace, k], Element[VerticesTopFace, k + 1.000000000000000]], k, 1.000000000000000, NumberSides)
EdgeFirstTop = Segment(BasePoint, Element[VerticesTopFace, 1.000000000000000])
VerticesBottomFace = Sequence(R_0 + RectangleWidth (Element[FaceAnglesSumCos, k] + ViewAngleCos cos(topAngle) Element[FaceAnglesSumSin, k], (-1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 * 1.000000000000000 sin(topAngle) - ViewAngleSin cos(topAngle)) Element[FaceAnglesSumSin, k]), k, 1.000000000000000, NumberSides)
EdgesBottom = Sequence(Segment[Element[VerticesBottomFace, k], Element[VerticesBottomFace, k + 1.000000000000000]], k, 1.000000000000000, NumberSides)
EdgeBottoFirst = Segment(R_0, Element[RectanglesBottomCorner, 1.000000000000000])