Commit 9c38f6bc authored by Jayant Khatkar's avatar Jayant Khatkar
Browse files

read in vtk data for stress

parent 52f14e84
...@@ -10,5 +10,5 @@ def main(fname): ...@@ -10,5 +10,5 @@ def main(fname):
return return
if __name__ == '__main__': if __name__ == '__main__':
fname = 'torsionbar_hor.stl' fname = 'tensile.vtk'
pl = Planner(fname, 1, 0.25) pl = Planner(fname, 1, 0.25)
This diff is collapsed.
...@@ -24,10 +24,11 @@ class Planner: ...@@ -24,10 +24,11 @@ class Planner:
# read mesh data # read mesh data
self.mesh = pv.read(mesh_file_name) self.mesh = pv.read(mesh_file_name)
self.boundary = self.mesh.decimate_boundary()
#voxelize #voxelize
hwratio = voxel_dim/self.lheight hwratio = voxel_dim/self.lheight
m = self.mesh.copy() m = self.boundary.copy()
m.points[:,2] *= hwratio m.points[:,2] *= hwratio
self.grid = pv.voxelize(m, density=self.voxel_dim) self.grid = pv.voxelize(m, density=self.voxel_dim)
self.grid.points[:,2] *= 1/hwratio self.grid.points[:,2] *= 1/hwratio
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