VoxelLayer Isosurface

This sample shows how to edit and modify VoxelIsosurface on a VoxelLayer.

An isosurface is a surface representing a specific value within a continuous variable. It is important to take note that VoxelIsosurface only draws when the renderMode property is surfaces and that the maximum number of isosurfaces that can be drawn is 4. Isosurfaces are for continuous variables only. To draw only a single particular value of discrete variable you would just set the enabled property of all of the other VoxelUniqueValue to false.

The value of the VoxelIsosurface can be modified. The stretchRange values can be used as a reference, but isosurface values are not limited to those values. The value of a VoxelIsosurface can be less than the minimum or greater than the maximum value of a stretchRange.

The colorLocked property defines whether or not the VoxelIsosurface color is automatically updated when the variable's transfer function's colorStops change. If the value of colorLocked is true, the VoxelIsosurface will use the specified color property. When set to false, the VoxelIsosurface is automatically updated based on what is defined on the colorStops.

Use dark colors for code blocksCopy
let variableStyle = vxlLayer.getVariableStyle(vxlLayer.currentVariableId);
const range = variableStyle.transferFunction.stretchRange;
const min = Math.min(Math.round(range[0]), Math.round(range[1]));
const max = Math.max(Math.round(range[0]), Math.round(range[1]));
let currentValue = Math.floor((min + max) / 2);
let newIsoSurface = new VoxelIsosurface({
    value: currentValue,
    enabled: true,
    color: [102, 136, 248],
    colorLocked: true

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.