Commit 90a79182 authored by Jayant Khatkar's avatar Jayant Khatkar
Browse files

voxelise input stl

parents
from utils import *
import sys
import numpy as np
import time
#from slicer import Slicer, GCode, plot_meshes, ParsedSettings, utils
import pandas as pd
def main(fname):
return
if __name__ == '__main__':
fname = 'torsionbar_hor.stl'
pl = Planner(fname, 1)
from .planner import Planner
import numpy as np
import time
import pyvista as pv
from pyvista import examples
from math import pi
import trimesh as tm
import pymeshfix as pf
class Planner:
"""
Track all relevant mesh objects for pin insertion
"""
def __init__(self,
mesh_file_name, # vtk file as generated by FreeCAD
grid_res=2,
):
# record params
self.grid_res = grid_res
# read mesh data
self.mesh = pv.read(mesh_file_name)
#voxelize
self.grid = pv.voxelize(self.boundary, density=self.grid_res)
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