Open mahmouddinar opened 3 weeks ago
Another thing I found was that the collet1 test part returns False when mesh.is_volume but also has a value for mesh.volume np.float64(2.074216113966994), and it is much less than the bounding box volume How can it has volume but not being a volume? Thank you.
Hello and thank you for the work you have done with Trimesh.
I am working on a function creating voxels by finding an intersection of cuboids with a mesh. I copy the function below and attach the failing test case. Earlier I had an issue with intersections not being found when the precision of vertices was too high. Setting "process=False" in creating the trimesh objects (cuboids) solved that issue, but I wonder if it creates another one. The test part is not too small (extents: [2.34324074, 4.51999998, 2.34349799]). But it has skinny sections. Had to attach as zip; there is another case that works without this issue. test.zip
Below is the code:
`import trimesh import numpy as np import pyvista as pv import math import pickle from IPython.display import Image, display import os import subprocess from collections import deque import itertools from decimal import Decimal, getcontext import json import plotly.graph_objects as go import binvox_rw def geometric_progression_sum(p, k): if p == 1: return k return (1 - p**k) / (1 - p) def exp_voxel_vf(mesh, progression, resolution, stock_mesh=None, for_channels=False): segments = resolution//2 if stock_mesh is not None: bounding_box_center = stock_mesh.bounding_box.centroid bb_x, bb_y, bb_z = stock_mesh.bounding_box.extents else: bounding_box_center = mesh.bounding_box.centroid bb_x, bb_y, bb_z = mesh.bounding_box.extents
mesh = trimesh.load_mesh('test/collet1.stl') exp_voxel_vf(mesh, 2, 8) `