mesh_select
ABSTRACT
Selects a subset of a mesh-tree.
IMPORTANT ELEMENT
One of the more commonly used mesh utility functions. Also, note that this operation removes type information. For instance, suppose the input tree was a functor with type Circle. Then, the output will visually look the same as the original circle (assuming the predicate selects it), however, all type information will be lost. This means that we won't be able to do x.center
or access any other attributes. This is especially important when trying to do operations related to Lerp, which relies on type information heavily.
PARAMETERS
root | Specifies the mesh-tree of which we want to find a subset of. |
tag_predicate(tag) | Determines whether or not a mesh should be included in the output if it has the given tag |
RETURN
A mesh-tree of all the selected meshes. It is guaranteed the output is a vector of meshes which has depth 1.
DECLARATION
func mesh_select([mesh_tree] {[main] {root, tag_predicate(tag)}})