Skip to content

Instantly share code, notes, and snippets.

#$ pip install genysis
import genysis
#easy part upload at https://studiobitonti.appspot.com/
#see upload tutorial for more details
token = "dev"
MPfilename = "implant.obj"
cellName = "cell_1.obj"
#First set up a new lattice component to blend into
newBlendTarget = "cell_2.obj"
genysis.genLatticeUnit(7,0.01,0.01,0.01,1.0,1,newBlendTarget,token)
#set the values needed for this function
cranial.addPointAttractor(newBlendTarget,point=[1.6,90.4,0.6],range=2)
cranial.setOutput("implant_2.obj")
#generate new lattive with attractor.
final=genysis.marchingCube(MPfilename,900,0.01,"implantOutput",token)
#create a surface lattice class
cranial =genysis.surfaceLattice()
#set the values needed for this function
cranial.setSurface("Skull_Srf.obj")
cranial.setCellHeight(0.1)
cranial.setOutput(MPfilename)
cranial.setComponent(cellName)
#Generate the lattice. It will be saved as implant.obj
import genysis
token = "YOUR TOKEN +"
MPfilename = "implant.obj"
cellName = "cell_1.obj"
genysis.genLatticeUnit(7,0.0,0.0,0.0,0.0,0.0,cellName,token)
#generate the lattice (this is a large part and it might take a min or two...)
mechP.runStochastic(token)
#apply marchingCube function to transform the lattice into a mesh for 3D print.
#marchingCube(lines,resolution,memberThickness,filename,token):
final=genysis.marchingCube(MPfilename,700,0.25,"mechOutput",token)
mechP = genysis.volumeLattice()
mechP.setVolume("Part.obj")
mechP.setPoreSize(1.5) #units are mm
mechP.setOutput(MPfilename)
@francisbitontistudio
francisbitontistudio / mech.py
Last active December 18, 2018 21:34
Lightweight Metal with Stochastic Lattice Tutorial
import genysis
#easy part upload at https://studiobitonti.appspot.com/
#see upload tutorial for more details
token = "YOUR TOKEN"
MPfilename = "mechP.obj"
#create a volume lattice object
mechP = genysis.volumeLattice()
import genysis
token = "YOUR TOKEN"
MPfilename = "mechP.obj"
mechP = genysis.volumeLattice()
mechP.setVolume("Part.obj")
mechP.setPoreSize(1.5) #units are mm
mechP.setOutput(MPfilename)
@francisbitontistudio
francisbitontistudio / index.html
Created November 27, 2018 23:49
Servicebot - Embed Demo - Pricing Embed + Checkout Embed - Francis
<link href="https://fonts.googleapis.com/css?family=Merriweather:300,400,700|Open+Sans:300,400,700" rel="stylesheet">
<div id="servicebot-tiers-embed"></div>
<script src="https://js.stripe.com/v3/"></script>
<script src="https://servicebot.io/js/servicebot-tiers-embed.js" type="text/javascript"></script>
<script type="text/javascript">
Servicebot.Tiers({
templateId : 2,
url : "https://demo2018.serviceshop.io",
selector : document.getElementById('servicebot-tiers-embed'),