Skip to content

Commit 6e65f17

Browse files
committed
Send bbox array to vis module in voxel component
1 parent bb68887 commit 6e65f17

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

geomdl/abstract.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2761,8 +2761,8 @@ def render(self, **kwargs):
27612761
# Add evaluated points as voxels
27622762
if self._vis_component.mconf['evalpts'] == 'voxels':
27632763
grid, filled = voxelize.voxelize(self, **kwargs)
2764-
polygrid = voxelize.convert_bb_to_faces(grid)
2765-
self._vis_component.add(ptsarr=[polygrid, filled], name=self.name, color=evalcolor, plot_type='evalpts')
2764+
faces = voxelize.convert_bb_to_faces(grid)
2765+
self._vis_component.add(ptsarr=[grid, faces, filled], name=self.name, color=evalcolor, plot_type='evalpts')
27662766

27672767
# Bounding box
27682768
self._vis_component.add(ptsarr=self.bbox, name="Bounding Box", color=bboxcolor, plot_type='bbox')

geomdl/visualization/VisMPL.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -864,16 +864,16 @@ def render(self, **kwargs):
864864

865865
# Plot evaluated points
866866
if plot['type'] == 'evalpts' and self.vconf.display_evalpts:
867-
grid = np.array(plot['ptsarr'][0], dtype=self.vconf.dtype)
868-
filled = np.array(plot['ptsarr'][1], dtype=self.vconf.dtype)
867+
faces = np.array(plot['ptsarr'][1], dtype=self.vconf.dtype)
868+
filled = np.array(plot['ptsarr'][2], dtype=self.vconf.dtype)
869869
# Find filled voxels
870-
grid_filled = np.concatenate(grid[filled == 1.0])
870+
faces_filled = np.concatenate(faces[filled == 1.0])
871871
# Create a single Poly3DCollection object
872-
pc3d = Poly3DCollection(grid_filled, facecolors=plot['color'], edgecolors='k')
872+
pc3d = Poly3DCollection(faces_filled, facecolors=plot['color'], edgecolors='k')
873873
ax.add_collection3d(pc3d)
874874
# Set axis limits
875-
gf_min = np.amin(grid_filled, axis=(0, 1))
876-
gf_max = np.amax(grid_filled, axis=(0, 1))
875+
gf_min = np.amin(faces_filled, axis=(0, 1))
876+
gf_max = np.amax(faces_filled, axis=(0, 1))
877877
ax.set_xlim([gf_min[0], gf_max[0]])
878878
ax.set_ylim([gf_min[1], gf_max[1]])
879879
ax.set_zlim([gf_min[2], gf_max[2]])

0 commit comments

Comments
 (0)