Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
578 views
in Technique[技术] by (71.8m points)

How to make a mesh (obj file) a solid on Python?

I've been working with pyvista on Python to filter a scan of my arm, obtaining an obj object in the end. But everytime I try to open the final result on SolidWorks it's only a mesh but though Python it shows up as it was a solid (I even extrude the scan on pyvista).

Here you can see it.

enter image description here

Does anybody know how can I make this mesh a solid so I can print it?

Here is the obj file for download

Edit: Scan without extrusion


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You are right, there was a bug in pymadcad for the .OBJ importation. This is fixed in the latest source version and will be available in the next release.

However I think what you are looking for is not extrusion but thickening: This is the result:

thickscan = thicken(
              read('scan.obj'), 
              0.01,               # offset between surfaces
              method='point',     # 'point' if faster and fine for a higly resolved mesh like this, but leave it to default works also
              )

thickened mesh

NB

The extrusion function only works shifting by an offset vector, and not along the mesh normals, which is usually not good for closed shapes like this:

thick = extrusion(vec3(0.01,0,0), read('scan.obj'))

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

63 comments

56.6k users

...