Questions tagged [trimesh]

94 questions
0
votes
1 answer

getting vertices and face as numpy array from a stl file using trimesh

I have an STL file, I now need to read the vertices and face value of that STL file using trimesh. myobj = trimesh.load_mesh("file.stl", enable_post_processing=True, solid=True) myobj.faces #gives me ndarray of faces how to read vertices from…
user8530486
0
votes
0 answers

make a shape watetight using trimesh

We are trying to make a shape to be watertight, we are using trimesh library. However, neither trimesh.repair.fill_holes nor meshlab's filter is giving good results. We have the same problem as: Complete a partial mesh and make it watetight
0
votes
1 answer

How to set window size and position in trimesh

I have trimesh 3.9.32 installed on Raspbian GNU/Linux 10 (buster) armv7l. This snippet: import trimesh mesh = trimesh.creation.cylinder(1, height=1) mesh.show() displays a window spilling into my second display. I would like to control window size…
Paul Jurczak
  • 7,008
  • 3
  • 47
  • 72
0
votes
1 answer

Python: Fastest ray to mesh intersection?

hey guys is there a faster way to get the intersections between rays and a mesh than using trimesh in python? So right now I am doing this approach: Stackoverflow: Python Intersections ray and mesh Snippet of my code: import numpy as np import…
Gian Alessio
  • 95
  • 1
  • 9
0
votes
0 answers

Running the same code but getting different results

I've written a code for my homework and it works fine for me; but when my friend tries to run it, Spyder gives "ZeroDivisionError: float division by zero". import trimesh import shapely import numpy as np import math import pylab import…
0
votes
0 answers

How should I make random 3d object using pyvista/or other module?

I am trying to make random 3d blob objects using pyvista. First, I wrote a code as following , import os import sys import numpy as np import cv2 import pyvista as pv import trimesh as tm import math import random as rnd smooth_iter =…
EJ Song
  • 123
  • 2
  • 13
0
votes
1 answer

Trimesh get faces centroids / centers

I am using trimesh python library. I want to overlay face normals ontop of face centroids. Is there any easy way to do that? Perhaps if there is an external library or helper script that can do this quickly that would also help. thanks
user3180
  • 1,369
  • 1
  • 21
  • 38
0
votes
1 answer

How do I apply a material to a .glb/.gltf mesh?

I have a model in .glb format with nothing edit(but a mesh) in the scene. How do I apply a material of a glb/gltf mesh using Python? I am using Pygltflib and Trimesh although I can use other libraries.
Steve Scott
  • 1,441
  • 3
  • 20
  • 30
0
votes
2 answers

rotate a mesh in python to be parallel to a vector

I have two meshes (call them A and B) which I am interacting within python using the open3d library (happy to use import trimesh or something else if it works better). Mesh A is a curved structure and mesh B approximates to a flatter surface. I need…
Lord Bubbacub
  • 133
  • 1
  • 8
0
votes
1 answer

trimesh.section face_index doesn't map to the returned Path3D?

I noticed that the trimesh.section method returns a Path3D with the indices of the intersected faces stuck into the path's metadata['face_index']. I also noticed that the number of face indices corresponds to the number of the path's entities'…
D. Reagan
  • 841
  • 1
  • 8
  • 24
0
votes
1 answer

Save the Path2D as a .PNG or .JPEG from .to_planar() function of Trimesh Module in Python

My main aim is to get the Drawing views of a STL file. I have tried the SolidWorks Method of converting a STL file to SLDPRT and then take the drawing views, but the drawing views in that case contains a lot of noise and is not accurate. SO, I am…
AdCal
  • 19
  • 1
0
votes
1 answer

Load Mesh from a glb file using trimesh

I am new to 3D geometry. I am trying to extract a mesh from a glb file using python library trimesh. I couldn't figure out the proper way of doing that. My requirement is that I need a 3D mesh (as adjacency matrix) of an object so that I can apply…
Bidur-Khanal
  • 5
  • 1
  • 4
0
votes
2 answers

Select vertex from a mesh to parse as an argument to a script

I have made a Python script which takes a mesh and the index of a vertex to apply an operation. Unfortunately, Trimesh -the library I use to process the mesh- does not have an option to select an vertex by clicking on it. Is it possible to visually…
Jorge Diaz
  • 491
  • 5
  • 11
0
votes
1 answer

Check if 3D grid is filled from top to bottom

I have a 3D grid for representing shapes/meshes which is represented in python using an ndarray(20,20,20) of type bool. Each element in the grid represents the presence or absence of material. I want to be able to check if a given grid represents a…
user1234
  • 115
  • 1
  • 9
0
votes
1 answer

How to find angle of rotation for Oriented Bounding Box?

I have a Axis Aligned Bounding Box and a Oriented Bounding Box for a 3D Mesh. How do I find the rotation matrix for Oriented Bounding Box?