Skip to content

Commit ace7925

Browse files
committed
fix faces bug
1 parent 655612f commit ace7925

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def read(fname):
5353

5454
setup(
5555
name='DracoPy',
56-
version='0.0.18',
56+
version='0.0.19',
5757
description = 'Python wrapper for Google\'s Draco Mesh Compression Library',
5858
author = 'Manuel Castro',
5959
author_email = '[email protected]',

src/DracoPy.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ namespace DracoFunctions {
6161
meshObject.faces.reserve(3 * mesh->num_faces());
6262
const auto *const pos_att = mesh->attribute(pos_att_id);
6363
std::array<float, 3> pos_val;
64-
for (draco::AttributeValueIndex i(0); i < static_cast<uint32_t>(pos_att->size()); ++i) {
65-
if (!pos_att->ConvertValue<float, 3>(i, &pos_val[0])) {
64+
for (draco::PointIndex v(0); v < mesh->num_points(); ++v) {
65+
if (!pos_att->ConvertValue<float, 3>(pos_att->mapped_index(v), &pos_val[0])) {
6666
meshObject.decode_status = no_position_attribute;
6767
return meshObject;
6868
}
@@ -115,8 +115,8 @@ namespace DracoFunctions {
115115
pointCloudObject.points.reserve(3 * point_cloud->num_points());
116116
const auto *const pos_att = point_cloud->attribute(pos_att_id);
117117
std::array<float, 3> pos_val;
118-
for (draco::AttributeValueIndex i(0); i < static_cast<uint32_t>(pos_att->size()); ++i) {
119-
if (!pos_att->ConvertValue<float, 3>(i, &pos_val[0])) {
118+
for (draco::PointIndex v(0); v < point_cloud->num_points(); ++v) {
119+
if (!pos_att->ConvertValue<float, 3>(pos_att->mapped_index(v), &pos_val[0])) {
120120
pointCloudObject.decode_status = no_position_attribute;
121121
return pointCloudObject;
122122
}

0 commit comments

Comments
 (0)