Commit e0910c8b authored by Jayant Khatkar's avatar Jayant Khatkar
Browse files

reduce python code into single file

parent 3d120f3e
*.pyc *.pyc
*.csv *.csv
*.gcode
using DataFrames
using CSV
df = DataFrames.DataFrame(CSV.File("tensile-1-1.csv"))
from utils import *
import sys
import numpy as np
import time
#from slicer import Slicer, GCode, plot_meshes, ParsedSettings, utils
import pandas as pd
import pyvista as pv
def main(fname):
return
if __name__ == '__main__':
fname = 'tensile.vtk'
pl = Voxelizer(fname, 1, 1) #0.25)
#pl.export_voxels('tensile')
from .planner import Voxelizer
import sys
import numpy as np import numpy as np
import time import time
import pandas as pd
import gcode2contour as gc
import pyvista as pv import pyvista as pv
from pyvista import examples
from math import pi from math import pi
import trimesh as tm
import pymeshfix as pf
from scipy.spatial import KDTree from scipy.spatial import KDTree
from scipy.interpolate import LinearNDInterpolator from scipy.interpolate import LinearNDInterpolator
import pandas as pd import pandas as pd
...@@ -76,7 +76,7 @@ class Voxelizer: ...@@ -76,7 +76,7 @@ class Voxelizer:
node_i_stress = self.mesh['StressValues'][node_is] node_i_stress = self.mesh['StressValues'][node_is]
e = time.time() e = time.time()
print(e-s) print(e-s)
return node_i_pred_stress, node_i_stress return node_i_pred_stress, node_i_stress
def export_voxels(self, fname): def export_voxels(self, fname):
...@@ -87,3 +87,10 @@ class Voxelizer: ...@@ -87,3 +87,10 @@ class Voxelizer:
csv_name = "{}-{}-{}.csv".format(fname, self.voxel_dim, self.lheight) csv_name = "{}-{}-{}.csv".format(fname, self.voxel_dim, self.lheight)
df.to_csv(csv_name) df.to_csv(csv_name)
return csv_name return csv_name
if __name__ == '__main__':
obj = 'tensile'
pl = Voxelizer(obj + '.vtk', 1, 1) #0.25)
contours = gc.decode_gcode(obj + '.gcode')
#pl.export_voxels('tensile')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment