fix osx 10.13 error (#577)
* fix osx 10.13 error * errors regarding std::optional * format
This commit is contained in:
@@ -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);
|
||||
@@ -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(
|
||||
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user