Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We hope the next version will support INT64. #70

Open
KevinWang-kk opened this issue Dec 20, 2024 · 0 comments
Open

We hope the next version will support INT64. #70

KevinWang-kk opened this issue Dec 20, 2024 · 0 comments

Comments

@KevinWang-kk
Copy link

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 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant