ColorMapped
The ColorMapped operation maps the positions of vertices in a mesh-tree to new colors based on a provided color map function. Note that it applies to lines, dots, and triangles
ColorMapped isn't as useful as PointMapped, but is still something you should know about to help visualized certain functions, and possibly for debugging as well
mesh | Represents the mesh-tree containing points with colors to be mapped. All provided meshes' point colors will undergo mapping. |
root | The root of the mesh-tree, serving as the container for mesh selection. |
tag_predicate(tag) | Determines whether a mesh should be included in the color mapping based on the provided tag. |
color_map(point) | A function that defines the mapping for each point's color. The function takes a vertex's position as input (3-vector) and returns a color value (4-vector). |
If the complete mesh set is provided, all meshes' point colors will be individually mapped according to the specified color map function. The return value is the mesh-tree of all the mapped meshes. However, if only a subset is chosen, the returned value will comprise a mesh-tree of the mapped selected meshes, while the unselected meshes will remain unchanged. Crucially, all meshes you didn't select will still be included in the result mesh_tree, but be provided as is (i.e. not color mapped).
func ColorMapped([mesh_tree] {[full] {mesh}, [tag_pred] {root, tag_predicate(tag)}}, color_map(point))