Skip to content

Commit

Permalink
model_color_idx
Browse files Browse the repository at this point in the history
  • Loading branch information
liuhong committed Nov 10, 2021
1 parent 9752561 commit 2d07323
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions thumbnail/thumbnail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,11 @@ void thumbnail_trimesh(trimesh::TriMesh* mesh, int width, int height, unsigned c
thumbnail_trimeshes(meshes, width, height, data);
}

bool thumbnail_trimeshs(const std::vector<trimesh::TriMesh*>& meshes, int width, int height, const char* filePath)
bool thumbnail_trimeshs(const std::vector<trimesh::TriMesh*>& meshes, int width, int height, int model_color_idx,const char* filePath)
{
if (width <= 0 || height <= 0 || !filePath)
return false;
int model_color_idx = 1;
if (model_color_idx < 0 || model_color_idx >= (int)(sizeof(model_colors) / sizeof(Vec3)))
if (model_color_idx < 0 || model_color_idx >= (int)(sizeof(model_colors) / sizeof(Vec3)))
{
model_color_idx = rand() % 5;
}
Expand Down Expand Up @@ -137,7 +136,7 @@ bool thumbnail_trimeshs(const std::vector<trimesh::TriMesh*>& meshes, int width,
}
return true;
}
bool thumbnail_trimesh(trimesh::TriMesh* mesh, int width, int height, const char* filePath)
bool thumbnail_trimesh(trimesh::TriMesh* mesh, int width, int height, int model_color_idx, const char* filePath)
{
return thumbnail_trimeshs({ mesh }, width, height, filePath);
return thumbnail_trimeshs({ mesh }, width, height, model_color_idx,filePath);
}
4 changes: 2 additions & 2 deletions thumbnail/thumbnail.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ namespace trimesh
THUMBNAIL_API void thumbnail_trimeshes(const std::vector<trimesh::TriMesh*>& meshes, int width, int height, unsigned char* data);
THUMBNAIL_API void thumbnail_trimesh(trimesh::TriMesh* mesh, int width, int height, unsigned char* data);

THUMBNAIL_API bool thumbnail_trimeshs(const std::vector<trimesh::TriMesh*>& meshes, int width, int height, const char* filePath);
THUMBNAIL_API bool thumbnail_trimesh(trimesh::TriMesh* mesh, int width, int height, const char* filePath);
THUMBNAIL_API bool thumbnail_trimeshs(const std::vector<trimesh::TriMesh*>& meshes, int width, int height, int model_color_idx, const char* filePath);
THUMBNAIL_API bool thumbnail_trimesh(trimesh::TriMesh* mesh, int width, int height, int model_color_idx, const char* filePath);
#endif // _THUMBNAIL_1635927924764_H

0 comments on commit 2d07323

Please sign in to comment.