Jump to navigation .EDGE{ FILL: CLEAR; STROKE: #0066FF; STROKE-WIDTH: 13; STROKE-LINECAP: ROUND; } EDGES = [[0,1],[1,2],[2,3],[3,0],[0,4],[1,5],[2,6],[3,7],[4,5],[5,6],[6,7],[7,4]] X_COORDS = [140,140,229,229,51,51,140,140] Y_COORDS = [140,243,191,89,89,191,140,37] Z_COORDS = [249,177,102,176,176,102,31,103] CENTRE_X = 140; CENTRE_Y = 140; CENTRE_Z = 140; FUNCTION DRAWBOX() { FOR(VAR I=0; I<EDGES.LENGTH; I++) { EDGE = SVGDOCUMENT.GETELEMENTBYID('EDGE-'+I); EDGE.SETATTRIBUTENS(NULL, 'X1', X_COORDS[EDGES[I][0]]); EDGE.SETATTRIBUTENS(NULL, 'X2', X_COORDS[EDGES[I][1]]); EDGE.SETATTRIBUTENS(NULL, 'Y1', Y_COORDS[EDGES[I][0]]); EDGE.SETATTRIBUTENS(NULL, 'Y2', Y_COORDS[EDGES[I][1]]); } } FUNCTION ROTATEABOUTY(RADIANS) { FOR(VAR I=0; I<X_COORDS.LENGTH; I++) { X = X_COORDS[I] - CENTRE_X; Z = Z_COORDS[I] - CENTRE_Z; D = MATH.SQRT(X*X + Z*Z); THETA = MATH.ATAN2(X, Z) + RADIANS; X_COORDS[I] = CENTRE_X + D * MATH.SIN(THETA); Z_COORDS[I] = CENTRE_Z + D * MATH.COS(THETA); } DRAWBOX(); } FUNCTION BEGINROTATEY(RADIANS) { ROTATEABOUTY(RADIANS); ROTATEY_TIMEOUT = SETINTERVAL("ROTATEABOUTY(" + RADIANS + ")", 20); } FUNCTION ENDROTATEY() { IF (TYPEOF(ROTATEY_TIMEOUT) != "UNDEFINED") { CLEARTIMEOUT(ROTATEY_TIMEOUT); } } FUNCTION INIT(EVT) { IF ( WINDOW.SVGDOCUMENT == NULL ) { SVGDOCUMENT = EVT.TARGET.OWNERDOCUMENT; BEGINROTATEY(-.01); } DRAWBOX(); } HUB FOLDING BOX COMPANY, INC. “Creativity Through Packaging” Search form Search ABOUT INNOVATION EXPERTISE AWARDS ECO-HUB MARKETS CONTACT US HUB’S AWARD WINNING TEAM DIAGEO; Winner, 2020 Supplier Award for Quality Excellence 123456 Previous Next HUB FOLDING BOX COMPANY INC. • Established in 1918 • Celebrating 100 Years of “Creativity Through Packaging” Hub's Founder: Francesco DiRico Hub's 2nd Generation: Joe, Henry & Fred DiRico Hub’s 3rd Generation of DiRico Family Leadership: Jack, Tony, Joe & Mark DiRico HUB NEWS HUB FOLDING BOX COMPANY, INC. 800-334-1113 774 Norfolk St, Mansfield, MA 02048 © Copyright 2016 Hub Folding Box Company, Inc. About Innovation Expertise Awards Eco-Hub Markets Hub News