Skip to content

Commit 4d8c472

Browse files
authored
Merge pull request #342 from pariterre/fixMeshPath
Added path for all STL files
2 parents 6892bcd + 1edb9a0 commit 4d8c472

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

include/RigidBody/Mesh.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ class BIORBD_API Mesh
7171
///
7272
utils::Vector3d& color() const;
7373

74+
///
75+
/// \brief Return if there is a mesh
76+
/// \return If there is a mesh
77+
bool hasMesh() const;
78+
7479
///
7580
/// \brief Add a point to the mesh
7681
/// \param node The point to add

src/ModelReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2275,6 +2275,7 @@ rigidbody::Mesh Reader::readMeshFileStl(
22752275
}
22762276

22772277
rigidbody::Mesh mesh;
2278+
mesh.setPath(path);
22782279
if (isBinary){
22792280
// Know the number of points
22802281
char headerChar[80] = "";
@@ -2284,7 +2285,6 @@ rigidbody::Mesh Reader::readMeshFileStl(
22842285
file.readFromBinary(nbTrianglesChar, 4);
22852286
size_t nbTriangles = static_cast<size_t>(*((unsigned int*) nbTrianglesChar));
22862287

2287-
mesh.setPath(path);
22882288
utils::Vector3d normal;
22892289
utils::Vector3d vertex;
22902290
for (int i = 0; i<nbTriangles; ++i){

src/RigidBody/Mesh.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ utils::Vector3d &rigidbody::Mesh::color() const
7878
return *m_patchColor;
7979
}
8080

81+
bool rigidbody::Mesh::hasMesh() const {
82+
return m_vertex->size() > 0;
83+
}
8184
void rigidbody::Mesh::addPoint(const utils::Vector3d &node)
8285
{
8386
m_vertex->push_back(node);

0 commit comments

Comments
 (0)