Skip to content

Commit

Permalink
Update per comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
kbongort committed Jan 13, 2024
1 parent d5b3fa1 commit eee2335
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/draco/io/ply_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ Status PlyDecoder::DecodeTexCoordData(const PlyElement *face_element) {

// Triangulate polygon assuming the polygon is convex.
const int64_t num_triangles = uv_list_size / 2 - 2;
pushTexcoordPair(uv_list_offset, 0);

for (int64_t ti = 0; ti < num_triangles; ++ti) {
pushTexcoordPair(uv_list_offset, 0);
for (int64_t c = 1; c < 3; ++c) {
pushTexcoordPair(uv_list_offset, ti + c);
}
Expand All @@ -193,7 +194,6 @@ Status PlyDecoder::DecodeTexCoordData(const PlyElement *face_element) {
}
// I don't think it works to have this as the only point-mapped attribute
// while the rest of the attributes are identity-mapped.
out_mesh_->set_num_points(num_corners);
out_mesh_->AddAttributeWithConnectivity(std::move(attr), corner_map);
return OkStatus();
}
Expand Down
2 changes: 1 addition & 1 deletion src/draco/io/ply_decoder_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ TEST_F(PlyDecoderTest, TestPlyTexCoords) {
ASSERT_EQ(att->size(), 4); // 4 unique texture coordinate values.
float vertex_0_tex_coord[2];
att->GetValue(AttributeValueIndex(0), vertex_0_tex_coord);
ASSERT_EQ(vertex_0_tex_coord[0], 0);
ASSERT_EQ(vertex_0_tex_coord[0], 1);
ASSERT_EQ(vertex_0_tex_coord[1], 1);
}

Expand Down

0 comments on commit eee2335

Please sign in to comment.