Skip to content

Commit

Permalink
Fixed position types from float to double
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrocortesark committed Oct 17, 2024
1 parent a7270fe commit 1e972e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bindings/bnd_pointcloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,14 +813,14 @@ BND_PointCloud* BND_PointCloud::CreateFromThreejsJSON(BND_DICT json)
emscripten::val::undefined() == attributes["position"]["array"])
return nullptr;

std::vector<float> position_array = emscripten::vecFromJSArray<float>(attributes["position"]["array"]);
std::vector<double> position_array = emscripten::vecFromJSArray<double>(attributes["position"]["array"]);

ON_PointCloud* pc = new ON_PointCloud();

const int vertex_count = position_array.size() / 3;
pc->m_V.SetCapacity(vertex_count);
pc->m_V.SetCount(vertex_count);
memcpy(pc->m_V.Array(), position_array.data(), sizeof(float) * position_array.size());
memcpy(pc->m_V.Array(), position_array.data(), sizeof(double) * position_array.size());

ON_Xform rotation(1);
rotation.RotationZYX(0.0, 0.0, ON_PI / 2.0);
Expand Down

0 comments on commit 1e972e8

Please sign in to comment.