Hexdecks is built in python with three key components:
Check out our Github repository Here!
For the web interface we used the Flask module to create a web based input and display.
Our application is built off of an HTML5UP template website. We call a POST request in Python and in the HTML template that contains our form so that user generated inputs can be interpreted by python. Our Python backend then calls two functions: one to calculate the desired cut pattern and one to generate a CAD (computer aided design) drawing that can used on the laser cutter. This file is saved and made available for download on a new web page that the user sees upon submitting the form.
Our Mechanical Model was built using the data collected from research done in the material science class at Olin. Using this data we created a model that would define the side length for geometry given a desired amount of deflection in the center of the board and the riders weight. Below is the code that is key to how we calculate the side length of a given hexagon.
It relies heavily on principles of sandwich composites and the math module in python to do the number crunching.
h = c + (fiber_thickness * layers) #thickness of the deck/specimen including fiberglass ***this might actually be better suited as a variable
# S = (P / ((h + c) * b)) #core shear stress
# F = ((P * a) / (2 * f * (h + c))) * b #average facing stress
D = (E_f * (h**3 - c**3) * b) / (12 * (1. - v**2)) #flexural stiffness
N = 1 / (4 * ((w / (P * a) - (a**2 / (48 * D))))) #shear stiffness - utilizing the deflection equation
G = ((N * 4 * c) / ((h + c)**2 * b))/1000 #core shear modulus
side_length = 1.04466 - (0.0000795962 * G) + (0.000000000131406 * G**2) #side length of the hexagon
the synthesized data from material science testing that we used to generate our model
We are using a combination of OpenSCAD and SolidPython to generate the geometry of the decks. The code takes in the outer extents of the hexagon cut out from the board math and and the required spacing and generated a DXF with the correct shape and a series of hexagon cut outs. It does this through a series of boolean operations.
After creating a field of hexagons the right size and separation it then runs a boolean intersect and with the core shape (as shown below on the far right). After this takes place it then runs a boolean combine of the resultant and the board outline and truck pads (the middle and right images below). It then takes this final CAD geometry and exports it out as a DXF which can then be sent to the web interface for download.
core = import_('Core.dxf') #Import core
flatflat = outsize*math.sqrt(3)/2.0 # outsize is tip to tip distance of outer hexagon
#Draw and subtract one grid of hexagons.
for i in range(-20,10):
#go left then draw another column
leftdist=outsize*1.5*i+outsize*.75
#Draw a column of hexagons
for i in range(-8,8):
Hexagon2 = left(leftdist)(forward((flatflat*i+flatflat/2))(circle(insize/2)))
Hexagon2.add_param('$fn',6) # make hexagonal
core = difference()(core, Hexagon2)
#Draw and subtract half offset grid to make lightweighting pattern
for i in range(-20,10):
#go left
leftdist=outsize*1.5*i
#Draw a column of hexagons
for i in range(-8,8):
Hexagon1 = left(leftdist)(forward(flatflat*i)(circle(insize/2)))
Hexagon1.add_param('$fn',6) # make hexagonal
core = difference()(core, Hexagon1)
#combine lightweighted core, board outer profile, and truck attachment points to make skateboard
outside= import_('Outside.dxf')
trucks= import_('Trucks.dxf')
basic_geometry = core + outside + trucks
flask - http://flask.pocoo.org/
math - https://docs.python.org/2/library/math.html
solid python - https://github.com/SolidCode/SolidPython
openSCAD - http://www.openscad.org/
MDF Skateboard Research - brennan.vhoeks.com/#/mdfskateboard/