I want to change the color of the surface on the basis of another value (an ID) that is considered discrete (hence I In the simplified example given below, I have prepared a field with 3 different IDs: 0 / red on left 2 / blue 1 / green left But with the code below, I have some strange behavior on the border between red and blue (green Point) I think this is probably due to an interpolation! Code: import from import mlab np # np # my dataset -simplified-x, y, z = np.mgrid [-3: 3: 100] H, -3: 3: 100h, -3: 3: 100 h] value = NP. SQLT (x ** 2 + y ** 2 + z ** 2) # My color value: Volume is divided into 3 sub-versions taking colorvalues with X = np.empty (values.shape) colorvalues [0:33,:,:] = 0 colorvalues [33:66,:,:] = 2. Look [66:,:,:] = 1 src = mlab.pipeline.scalar_field (value) src.image_data.point_data.add_array (colorvalues.T.ravel ()) (1) .name = 'MyID' src.image_data. point_data.update src.image_data.point_data.get_array () # surface, contour = mlab.pipe...
Comments
Post a Comment