Description
I’m using honeybee-vtk to visualize sensor grid results on a mesh, but the rendered output shows smooth color interpolation between cells rather than discrete per-cell colors. I’d like to understand why this interpolation occurs and if there’s a way to display flat, per-cell color values instead.
Current Behavior
The mesh is rendered with gradient color transitions across cells, creating a smooth interpolated appearance (see image below). While this looks visually appealing, it doesn’t accurately represent the discrete per-cell values I’m trying to visualize.
Code
from honeybee_vtk.model import Model, SensorGridOptions, DisplayMode
from honeybee_vtk.scene import Scene
from honeybee.room import Room
from honeybee.model import Model as HBModel
import os
import random
# Create Model
room = Room.from_box('simulated_room', 5, 10, 3)
south_face = room[3]
south_face.apertures_by_ratio(0.4, 0.01)
model = HBModel('simulated_test_model', [room])
grid = room.properties.radiance.generate_sensor_grid(1, offset=0.8)
model.properties.radiance.sensor_grids = [grid]
# Save to hbjson
hbjson_path = os.path.abspath("output/temp_model.hbjson")
model.to_hbjson(name="temp_model", folder="output")
# Generate dummy results
results_folder = os.path.abspath("output/results")
os.makedirs(results_folder, exist_ok=True)
res_path = os.path.join(results_folder, f"{grid.identifier}.res")
values = [random.uniform(0, 100) for _ in range(len(grid.mesh.faces))]
# Convert to honeybee-vtk Model with grids loaded
model_vtk = Model.from_hbjson(hbjson_path, SensorGridOptions.Mesh)
# Add data with per_face=True
model_vtk.sensor_grids.add_data_fields(
[values],
name="DaylightAutonomy",
per_face=True
)
model_vtk.sensor_grids.color_by = "DaylightAutonomy"
model_vtk.to_images(
folder="output",
view=[view_file],
model_display_mode=DisplayMode.Wireframe,
grid_display_mode=DisplayMode.SurfaceWithEdges,
image_width=1200,
image_height=900
)
Expected Behavior
I would expect each mesh cell to display a single flat color based on its associated value, similar to how results are displayed in typical daylight autonomy visualizations where each grid point/cell has a discrete color.
Questions
- Is the interpolation happening because of how VTK handles cell data visualization, or is there a setting in
honeybee-vtkthat controls this? - Is there a parameter or display mode that forces flat/discrete per-cell coloring without interpolation?
- Would using
SensorGridOptions.Sensors(points) instead ofSensorGridOptions.Meshbe more appropriate for discrete value visualization?
Environment
- honeybee-vtk version: 0.39.1
- Python version: 3.13.12
- OS: Windows
view_file
rvu -vtv -vp 20 -20 20 -vd -1 1 -1 -vu 0 0 1 -vh 45 -vv 45
Any guidance would be appreciated!
