close
Skip to content

We hope the next version will support INT64.  #70

Description

@KevinWang-kk

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 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions