StlSpheresGenerator Namespace Reference

Functions

def ImportOrInstallModules ()
 
def main ()
 

Function Documentation

◆ ImportOrInstallModules()

def StlSpheresGenerator.ImportOrInstallModules ( )
9  # This function automatically installs required packages if they are missing
10  try:
11  __import__('stl')
12  except ImportError:
13  print("Package numpy-stl not installed, installing...")
14  pip.main(['install', 'numpy-stl'])
15  return
16 
18 
19 
20 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet print(const Packet &a)
Definition: GenericPacketMath.h:1166
def ImportOrInstallModules()
Definition: StlSpheresGenerator.py:8

References Eigen::internal.print().

◆ main()

def StlSpheresGenerator.main ( )
21 def main():
22  from stl import mesh
23  from src.save_to_stl import make_sphere
24  data = make_sphere([0,0,0], 0.5, 64, 64)
25  data = np.hstack((data, make_sphere([-1,0,0], 0.5, 64, 64)))
26  data = np.hstack((data, make_sphere([1, 0, 0], 0.5, 64, 64)))
27 
28  your_mesh = mesh.Mesh(data, remove_empty_areas=True)
29  your_mesh.save('../input/stl/3_spheres_64.stl')
30  print("saved")
31 
32 
def main()
Definition: StlSpheresGenerator.py:21

References Eigen::internal.print().