-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Description
On a 64-bit operating system, boost::graph_traits::vertex_descriptor is std::size_t, which is 64-bit. However, tinyply only supports a maximum integer size of INT32, leading to incorrect PLY file results. We hope the next version will support INT64.
std::vector<Point>vertices;
std::vector<std::pair<vertex_descriptor, vertex_descriptor>>edges;
for (auto vd : boost::make_iterator_range(boost::vertices(g))) {
vertices.push_back(g[vd]);
}
for (auto ed : boost::make_iterator_range(boost::edges(g))) {
auto src = boost::source(ed, g);
auto dst = boost::target(ed, g);
edges.emplace_back(src, dst);
}
cube_file.add_properties_to_element("vertex", { "x", "y", "z" },
Type::FLOAT64, vertices.size(), reinterpret_cast<uint8_t*>(vertices.data()), Type::INVALID, 0);
cube_file.add_properties_to_element("edge", { "vertex1", "vertex2" },
Type::INT32, edges.size(), reinterpret_cast<uint8_t*>(edges.data()), Type::INVALID, 0);//INT32 is wrong, we need INT64
Metadata
Metadata
Assignees
Labels
No labels