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

fix osx 10.13 error #577

Merged
merged 3 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions bindings/python/manifold3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,9 @@ NB_MODULE(manifold3d, m) {
std::optional<nb::ndarray<uint32_t, nb::shape<3>>> &normalIdx) {
glm::ivec3 v(0);
if (normalIdx.has_value()) {
if (normalIdx.value().ndim() != 1 ||
normalIdx.value().shape(0) != 3)
if (normalIdx->ndim() != 1 || normalIdx->shape(0) != 3)
throw std::runtime_error("Invalid vector shape, expected (3)");
auto value = normalIdx.value();
auto value = *normalIdx;
v = glm::ivec3(value(0), value(1), value(2));
}
return self.GetMeshGL(v);
Expand Down Expand Up @@ -624,7 +623,7 @@ NB_MODULE(manifold3d, m) {
runOriginalID->size());

if (runTransform.has_value()) {
auto runTransform1 = runTransform.value();
auto runTransform1 = *runTransform;
if (runTransform1.ndim() != 3 || runTransform1.shape(1) != 4 ||
runTransform1.shape(2) != 3)
throw std::runtime_error(
Expand All @@ -637,7 +636,7 @@ NB_MODULE(manifold3d, m) {
out.faceID = toVector<uint32_t>(faceID->data(), faceID->size());

if (halfedgeTangent.has_value()) {
auto halfedgeTangent1 = halfedgeTangent.value();
auto halfedgeTangent1 = *halfedgeTangent;
if (halfedgeTangent1.ndim() != 3 ||
halfedgeTangent1.shape(1) != 3 ||
halfedgeTangent1.shape(2) != 4)
Expand Down
6 changes: 3 additions & 3 deletions src/manifold/src/csg_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ using SharedImpl = std::variant<std::shared_ptr<const Manifold::Impl>,
struct GetImplPtr {
const Manifold::Impl *operator()(const SharedImpl &p) {
if (std::holds_alternative<std::shared_ptr<const Manifold::Impl>>(p)) {
return std::get<std::shared_ptr<const Manifold::Impl>>(p).get();
return std::get_if<std::shared_ptr<const Manifold::Impl>>(&p)->get();
} else {
return std::get<std::shared_ptr<Manifold::Impl>>(p).get();
return std::get_if<std::shared_ptr<Manifold::Impl>>(&p)->get();
}
};
};
Expand Down Expand Up @@ -495,7 +495,7 @@ std::shared_ptr<Manifold::Impl> CsgOpNode::BatchBoolean(
group.run_and_wait(process);
SharedImpl r;
queue.try_pop(r);
return std::get<std::shared_ptr<Manifold::Impl>>(r);
return *std::get_if<std::shared_ptr<Manifold::Impl>>(&r);
}
#endif
// apply boolean operations starting from smaller meshes
Expand Down