## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
• Create your own community
##### Activity
Mihai ANDRIES
@science-code

You need to install meshlab for that work.
To change the number of triangles in the final mesh, edit the value on line 21:

<Param type="RichInt" value="2000" name="TargetFaceNum"/>

Jason McInerney
@wwwslinger
@science-code thanks for the script. I tested it out, but am getting a not found for the Remove Unreferenced Vertex Filter. Is there a default somewhere that I can plug in?
Mihai ANDRIES
@science-code
@wwwslinger Try to remove that line, it will probably work without it.
To have the exact code for any operation on the mesh in MeshLab, go to "Filter > Show current filter script".
See the exact name of the operation in your version of MeshLab, as use that one instead.
Those filters are just for cleaning the mesh.
Giacomo Vianello
@giacomov
Hi, I am looking for a simple way to solve this problem in python: I have a mesh of a roof. The real object is composed of planes intersecting at sharp angles. However, the mesh I have has several thousand faces. I am looking for a way to merge all adjacent faces whose normals are within a certain angle. In other words, I want to merge all nearly coplanar faces. Is there a trimesh way of doing this? I was looking at trimesh.grouping.group_vectors, but I don't know how to enforce connectivity and also I don't know how to merge the groups.
jaredsagendorf
@jaredsagendorf
Hello all, I want to compute the mean/gaussian curvature over a mesh and I'm looking at the curvature.ipynb example with the following code: discrete_gaussian_curvature_measure(mesh, mesh.vertices, r)/sphere_ball_intersection(1, r)
But I don't really understand what the sphere_ball_intersection(1,r) call is about... what exactly is this example showing? Can I use this to calculate curvature at every vertex for an arbitrary mesh? How would I know what value of r to use?
PedroLopes211
@PedroLopes211
Hello. For my project, I need to measure the distance between two STL files. I wrote a script that allows reading the files, positioning them in relation to each other in the desired position . I saw the module Trimesh.collision because it looks like a mesh - mesh comparer . So I tried to use min_distance_single to "get the minimum distance between any pair of objects, one in each manager" but I receive and error like this
I tried to upload a mesh from a .stl file (ASCII) . I discover this library recently, is there a module that can make me discover the distance between those two objects? I also wrote the question here: https://stackoverflow.com/questions/61159587/measure-distance-between-meshes?noredirect=1#comment108198970_61159587
Jose Juan Montes
@jjmontesl
Hi there. Just sharing something I'm working on that uses Trimesh:
Jose Juan Montes
@jjmontesl
ChrisCarragher
@ChrisCarragher
Hi, I am just wondering if anyone has any recommends as to how to create an interactive UI with trimesh. I want a user to be able to open a file containing multiple meshes, display the meshes and have the user select one. Currently, I can open the file and modify meshes and extract information and show meshes I'm just not sure how I would allow a user to select one. Any help would be much appreciated.
Michael Dawson-Haggerty
@mikedh
hey you might check out the glooey widget example: https://github.com/mikedh/trimesh/blob/master/examples/widget.py
ernijsyoyo
@ernijsyoyo
Hi all! I have a problem where I need to take a mesh "A" and divide it into 3 smaller, seperate meshes. I am slightly overwhelmed by the documentation and I am not sure which trimesh functions should I be using for this task. I've discovered graph.Split() (which reduced the amount of original vertices..?), Submesh() or trimesh.remesh.Subdivide()
Also is the functionality available which allows to specify the number parts in which I want to subdivide my mesh? example 3, 4 or 5 equal parts?
Jose Juan Montes
@jjmontesl
As far as I know, there is no "splitting" option with the semantics you mention. Subdividing is actually adding triangles, so that's not what you are looking for.
Note that I don't know the entire API well, but as far as I know you have operations to:
Jose Juan Montes
@jjmontesl
Jose Juan Montes
@jjmontesl
This may be a silly question but, how do I create a hierarchy of nodes to be exported with GLTF? I know how to add meshes to a scene, but I don't know how to create a tree of nodes with or without meshes and with different local transforms (ideally also with "extra" custom metadata).
Does someone know how to do this with Trimesh, that can share or point me to an example?
Jose Juan Montes
@jjmontesl
hello again... ^^^ anybody? I'm really struggling with this :/
Jose Juan Montes
@jjmontesl
also, I'd like to share the lightning talk (5m) about the tool I'm working on, which uses Trimesh:
Tomas Novak
@TomasN_gitlab
Hi all! I am going to use this awesome tool to render create 3D models and render images, but I have not found the way how to render orthographic image. Is there a way how to configure a camera? Thank you
Jose Juan Montes
@jjmontesl
Hello @TomasN_gitlab , I believe there's an issue on Github that refers to that
This is the one: mikedh/trimesh#929
vivekdhameliya
@vivekdhameliya

I am currently using trimesh to create multi view snapshots of geometries. Unfortunately, after a while of calling the scene.save_image method a couple of times issues occur: a random ZeroDivisionError and a random Process exit.

After around 446 iterations python crashes completely and it returns 'Process finished with exit code -1073740771 (0xC000041D)' Here the exit codes are different every time.
I do not see the memory/CPU/GPU statistics blowing up in the task manager.

Joan Massich
@massich

Is there any reason why I cannot scene.set_camera from scene.camera ?
I'm trying to do something like this:

mesh = trimesh.load_mesh(in_fname, process=False)
scene_A = trimesh.Scene(mesh)
scene_B = trimesh.Scene(mesh)
scene_A.show()  # play with the camera

scene_B.set_camera(**scene_A.camera)

If scence_A.camera was a dict and the parameters of set_camera where matching the elements of this dict. This would work. My question is how can I get the parameters of the camera so that I can pass them to set_camera. I've the feeling that scene.camera misses some of the parameters required to properly set the camera using set_camera

Tomas Novak
@TomasN_gitlab
Hello, is there a way how to display text (digits) in opengl window? When I add text entity to path, I can see it in Path2D.show(). But when I create Path3D I see no text. Is there any workaround? Creating Path2D for each digit, extrude it and add to scene is quite hardcore solution. Thanks for help
Tomas Novak
@TomasN_gitlab
How does lights work in trimesh scene. It seems to me that it does not matter where I place them. Scene looks still the same. Also intensity adjustment makes no change. Is it implemented? Thanx
alexspace360
@alexspace360
hello i am new to trimesh
i need a help please
i want to flip obj vectors or faces does trimesh allow that ?
note i know nothing about the library
Jose Juan Montes
@jjmontesl

i need a help please

Trimesh has a invert method that inverts faces: https://trimsh.org/trimesh.base.html#trimesh.base.Trimesh.invert

There's also related code in the 'repair' module I think.
Sayantan Das
@ucalyptus
Hi guys, a beginner here.
[Beginner Question] How to generate a trimesh from adjacency matrix?
visineo
@visineo
Hello All. I am trying to use trimesh to segment all planar sections of a roof top
I could not locate any API which takes in a trimesh and segments it into multiple planar mesh's
@mikedh : Can you please help provide any suggestions ?
Souhaib Attaiki
@pvnieo

Hi all,

I have a 3D shape loaded from an .off file, and I have an image load as a PIL image.

I want to add this image as a texture to the mesh but I can't figure out how to do it. I did the following manipulation, but when I show the mesh, the texture is not applied.

import trimesh
from PIL import Image

im = Image.open("image.png")
m = trimesh.load("mesh.off", process=False)

tex = trimesh.visual.TextureVisuals(image=im)
m.visual.texture = tex

m.show()

How can I do this?
Thank you in advance.

Damien
@damienallen
So, I've found that both submesh() and update_faces() can give me the result I need (a subset of faces from given indices). Does anyone have experience with these two functions? Is there a big performance difference between them? Use cases to be avoided for either?
cesroceng
@cesroceng
Hi all, I am working with trimesh and I need to use convex decomposition which needs v-hacd. I cloned the v-hacd repository and built it (working on Linux), there was no error and the paths are correct, but when I try to use in my code trimesh fails to open a process to testVHACD. Is there anyone here that have used v-hacd and perhaps had the same problem as me? Thanks in advance. Regards.
Jose Juan Montes
@jjmontesl
Maybe try to run that command from command line and see the output?