diff --git a/VirtualRobot/Visualization/TriMeshModel.h b/VirtualRobot/Visualization/TriMeshModel.h index 8ee329955ea10ab1b63e3959ffd47d7b1b73ef91..ce9eb52a301a5dd7443c67b8cb0b3f25fbb178c6 100644 --- a/VirtualRobot/Visualization/TriMeshModel.h +++ b/VirtualRobot/Visualization/TriMeshModel.h @@ -64,7 +64,20 @@ namespace VirtualRobot int addMaterial(const VisualizationFactory::PhongMaterial& material); void clear(); void flipVertexOrientations(); + /** + * @brief Merges vertices that are close together (mergeThreshold). + * Usually, vertices that are close together should be one vertex. Otherwise the mesh + * could consist of many individual triangles. + * All vertex ids stored in faces are updated. This function is quite efficient due to a kd-tree and an inverted face-vertex mapping. + * @param mergeThreshold If squared Euclidan distance of two points is belong this threshold, two vertices are merged. + */ void mergeVertices(float mergeThreshold = 0.0001); + + /** + * @brief fatten or shrink this trimesh. Done by moving a vertex along a normal calculated from the normals + * of all the faces the vertex is used in. + * @param offset All vertexes are moved about this offset in mm. + */ void fattenShrink(float offset); // Overwrite all colors void setColor(VisualizationFactory::Color color);