MovedNextTo
The MovedNextTo operation relocates meshes within the provided mesh-tree next to a reference mesh based on the specified direction. Formally, we move the mesh such that the difference of their centers is a scalar multiple of the specified direction. Moreover, there exists a plane normal to the provided direction that separates the mesh from the reference mesh (and in fact, a small buffer will be added). Finally, the dot product between the direction and any vector from a point on the reference mesh to a point on the plane is positive.
mesh | Represents the mesh-tree containing meshes to be relocated. All provided meshes will undergo relocation. |
root | The root of the mesh-tree, serving as the container for mesh selection. |
tag_predicate(tag) | Determines whether a mesh should be moved based on the provided tag. |
ref | A reference mesh-tree, to which the target mesh tree will be moved next to. |
dir | A direction vector indicating the relocation direction. |
If the complete mesh set is provided, all selected meshes will be moved next to the reference mesh based on the specified direction. The return value is the mesh-tree of all meshes after relocation. However, if only a subset is chosen, the returned value will comprise a mesh-tree of the selected meshes after relocation, while the unselected meshes will remain unchanged. Crucially, all meshes you didn't select will still be included in the result mesh_tree, but their positions will remain unchanged.
func MovedNextTo([mesh_tree] {[full] {mesh}, [tag_pred] {root, tag_predicate(tag)}}, ref, dir)