Questions tagged [trimesh]
94 questions
1
vote
0 answers
Setting colors on a trimesh union mesh according to the original component meshes
I'm working with the trimesh Python library, and I couldn't wrap my head around working with colors from reading the docs (a Spartan API reference) and examples. I'm not even sure if I'm setting the face colors right, if I can modify…

villares
- 333
- 2
- 12
1
vote
0 answers
Trimesh: find an intersection between ray and mesh only on the length of the ray and not in its extension
I'm looking for a way to find the intersection between a path of vectors and a trimesh. I have built my code following these two posts:
Python: Fastest ray to mesh intersection?
Intersection between 2d image point and 3d mesh
I did not have any…

Stunti
- 11
- 2
1
vote
1 answer
Saving cross section of 3d object by Trimesh - Python
After obtaining the cross section of a 3D object having sphere holes inside it as shown in the picture below, I couldn't find a way to save it as either numpy array or any image format. I used the Trimesh code below to take the section:
slice =…

sonido
- 47
- 7
1
vote
0 answers
Textured mesh browsing in Trimesh library
I'm trying to find the uv coordinates of a neighboring vertices of a target vertex in a 3D textured mesh (please see the attached figure).
I'm trying to find the uv coordinates of neighboring vertices of a target vertex in a 3D textured mesh (please…

paul
- 9
- 2
1
vote
1 answer
How to add two 3D meshes to get single mesh in python
I'm playing with some mesh operations.
Suppose we have two meshes, one human head mesh and another one is human body.
we just have to add head to body so that the end result is one single complete human body
mesh.
I think it can be done using…

Ujjawal Kumar Singh
- 21
- 2
1
vote
1 answer
Need help making a 3D mesh given co-ordinates of the vertices and vertex indices of each face for 3D Slicer - trimesh python
Given the following data:
The Cartesian co-ordinates of the vertices in the surface mesh: n vertices x 3
The vertex indices of each face in the surface mesh: n faces x 3
I'm trying to export some 3D file that I can readily import to 3D Slicer for…

myfatson
- 354
- 2
- 14
1
vote
1 answer
How to combine multiple polygons into 3d mesh (Python-trimesh)
I'm dealing with stl data which can be loaded by:
# load a file by name or from a buffer
mesh = trimesh.load_mesh('./dummydata.stl')
# preview mesh in a pyglet window from a terminal, or inline in a notebook
mesh.show()
This creates a 3D object…

VeravdL
- 19
- 3
1
vote
1 answer
How to determine output path directory for trimesh.exchange.ply.export_ply?
I am working with datasets of ply files. Eventually, I need to export the ply files in a separate directory.
Now, if I use the function trimesh.exchange.ply.export_ply, I cant seem to understand how to set the directory where to export the meshes. I…

Salman
- 11
- 2
1
vote
1 answer
Slice mesh with trimesh
I work on a big .stl file which I want to cut into pieces using a bounding box.
For this purpose, I use trimesh python package to load the .stl.
Here is the piece of code used to generate the bounding box :
box = trimesh.creation.box(extents=[1.5,…

Joachim C.
- 31
- 2
1
vote
1 answer
How to load textured mesh in trimesh?
My final purpose is to either load the textured obj model into trimesh as a SINGLE TriangleMesh object, or convert textures into colored point cloud, so that I could just use the colors stored in vertex_colors property.
When I'm using trimesh.load,…

Ivan Hahanov
- 21
- 2
- 5
1
vote
1 answer
How to determine convexity of an incomplete trimesh?
How can I determine the convexity of an incomplete (i.e. non-watertight) trimesh? Convexity is well-defined even for incomplete meshes: Iff the incomplete trimesh T can be completed to a convex trimesh, T is convex. (I use the term "incomplete" over…

Jann Poppinga
- 444
- 4
- 18
1
vote
1 answer
How to get pixel coordinates of object after rendering the scene as image in pyrender?
I am trying to obtain the pixel coordinates (x, y) of the object that is rendered using pyrender. The aim is to get the bounding box coordinates of that object. I use OffScreenRenderer to render the scene.
r =…

Viole
- 11
- 2
1
vote
1 answer
How to convert the 3D Coordinates (x,y,z) into .STL file in MATLAB?
Good day, I would like to seek for helps on how to convert the 3D Coordinates (x,y,z) into .STL file in MATLAB.
Below are some of the 3D Coordinates I simulated and obtained in MATLAB and stored it in a .txt file.
P =
14 0 25
16 0 20
15 4 …

Jay
- 11
- 5
1
vote
1 answer
Find Properties of Polygons from Path2D, derived from the.to_planar() function of Trimesh Module in Python
With the Trimesh module in Python, I am able to get 2D cross-sections from a STL file, with the code shown below.
mesh = trimesh.load_mesh('MyFile.stl')
slicex = mesh.section(plane_origin=mesh.centroid, plane_normal=[0,30,0])
slice_2D, to_3D =…

AdCal
- 19
- 1
1
vote
0 answers
Manually Texture Mesh with PyRender or Similar Python Library?
I have a partial mesh of a room that I am trying to texture with an image taken from a particular camera view of it. I am using pyrender to do the rendering. If I load a mesh from an .obj file that is already textured, the rendering shows up with…

argupta
- 11
- 2