From 4d6787a75c38b4f3e54b189c8243fd969278b895 Mon Sep 17 00:00:00 2001 From: Saurabh Mogre Date: Thu, 14 Sep 2023 16:08:32 -0700 Subject: [PATCH] reduce chunk size for mesh point calculations --- cellpack/autopack/MeshStore.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cellpack/autopack/MeshStore.py b/cellpack/autopack/MeshStore.py index 94ecd2173..31a57381b 100644 --- a/cellpack/autopack/MeshStore.py +++ b/cellpack/autopack/MeshStore.py @@ -4,7 +4,7 @@ import trimesh from cellpack import autopack -CHUNK_SIZE = 100000 +CHUNK_SIZE = 50000 class MeshStore: @@ -261,6 +261,7 @@ def contains_point(self, geomname, point): def contains_points_mesh(self, geomname, points): mesh = self.get_object(geomname) + inside = numpy.full(len(points), False) if mesh is not None: if len(points) <= CHUNK_SIZE: return mesh.contains(points) # TODO: check for memory leak @@ -273,7 +274,7 @@ def contains_points_mesh(self, geomname, points): else: inside = numpy.append(inside, mesh.contains(chunk)) return inside - return numpy.full(len(points), False) + return inside def get_smallest_radius(self, geomname, center): mesh = self.get_object(geomname)