You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using porespy to generate overlapping spheres to be able to subtract them from a box and then, mesh the sturcture in solidworks for further analysis. However, when I use porespy for this work, it creates surfaces which are not smooth and it causes generation of non-smooth surfaces that cause error in generating mesh or creating the readable file for processing softwares like Ansys. Could you please help me on how can I increase the smoothness of the surface with your software? Actually, I tried using "smooth=True" command, however this does not make any difference in the output results. Could you please guide me further?
Thanks.
Here is the code that I used to create the structure:
"import porespy as ps
import matplotlib.pyplot as plt
import numpy as np
from stl import mesh
from skimage import measure
import trimesh
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am using porespy to generate overlapping spheres to be able to subtract them from a box and then, mesh the sturcture in solidworks for further analysis. However, when I use porespy for this work, it creates surfaces which are not smooth and it causes generation of non-smooth surfaces that cause error in generating mesh or creating the readable file for processing softwares like Ansys. Could you please help me on how can I increase the smoothness of the surface with your software? Actually, I tried using "smooth=True" command, however this does not make any difference in the output results. Could you please guide me further?
Thanks.
Here is the code that I used to create the structure:
"import porespy as ps
import matplotlib.pyplot as plt
import numpy as np
from stl import mesh
from skimage import measure
import trimesh
ps.visualization.set_mpl_style()
shape = [100, 100, 100]
r = 15
smooth = True
im = ps.generators.random_spheres(shape=shape, r=r, smooth=smooth)
im_inverted = np.logical_not(im)
verts, faces, _, _ = measure.marching_cubes(im, level=0.5) # level=0.5 for binary interface, it gives all the vertices and faces
Create a trimesh object
mesh = trimesh.Trimesh(vertices=verts, faces=faces)
Export to STL
mesh.export("porous_sphere.stl")
plt.imshow(im[:, :, 50]) # Visualize a slice
plt.show()"
P.S: I tried different generators, like random_spheres, overlapping_spheres, etc.
Beta Was this translation helpful? Give feedback.
All reactions