-
Notifications
You must be signed in to change notification settings - Fork 114
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
removed RotateUp and uint #1000
Conversation
manifold::Manifold rotated_cyl = | ||
origin_cyl.Transform(manifold::RotateUp(evec)); | ||
manifold::Manifold right = rotated_cyl.Translate(ev1); | ||
quat q = rotation_quat(normalize(evec), vec3(0, 0, 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pca006132 I was a little suprised I didn't need la::rotation_quat
or manifold::la::rotation_quat
. I recall you made a comment about my namespacing - did I do it wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a weird thing called Argument-dependent lookup for functions, which basically adds the argument type namespaces into the lookup search path. I don't think we have anything wrong with our namespacing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that's cool! Thanks for the explanation.
On second thought, considering the very non-obvious behavior from #996, perhaps we should add assertions on all our transform inputs that they are finite. |
I'll try it out when I get a chance, but the first thing to do is remove the "if (len < 0.03) continue;" test with the TODO comment from the offset test, if that's not already removed - that was hitting the issue for me. |
Confirmed - removing the len < 0.03 filter still results in successful running of the offset test. |
@elalish did you want to remove that workaround as part of this PR, or as a separate one? |
Yeah, I'll deal with it here. |
if (inQ_.status_ != Manifold::Error::NoError) { | ||
auto impl = Manifold::Impl(); | ||
impl.status_ = inQ_.status_; | ||
return impl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to pass through the input error instead of changing it, which I think makes it a be easier to deduce what went wrong first.
include/manifold/manifold.h
Outdated
case Manifold::Error::FaceIDWrongLength: | ||
return stream << "Face ID Wrong Length"; | ||
case Manifold::Error::InvalidConstruction: | ||
return stream << "Invalid Construction"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got tired of not being able to see what the error was. I really wish C++ had a way to turn enums into strings automatically, but apparently we need this lovely boiler plate instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel that a more general approach would be to implement this as a toString
function.
@@ -513,6 +513,10 @@ Manifold::Impl Manifold::Impl::Transform(const mat3x4& transform_) const { | |||
result.status_ = status_; | |||
return result; | |||
} | |||
if (!all(isfinite(transform_))) { | |||
result.MarkFailure(Error::NonFiniteVertex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this to catch any kind of bad transform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently we need to make it explicit, i.e. all(la::isfinite(transform_))
to make msvc happy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw, in BRL-CAD when we use C++ we generally are explicit with the namespaces to avoid lookup surprises. It's definitely a readability tradeoff though.
|
||
bool operator()(size_t edge) const { | ||
const Halfedge halfedge = halfedges[edge]; | ||
if (halfedge.startVert == -1 || halfedge.endVert == -1) return true; | ||
if (halfedge.pairedHalfedge == -1) return false; | ||
|
||
if (!std::isfinite(vertPos[halfedge.startVert][0])) return false; | ||
if (!std::isfinite(vertPos[halfedge.endVert][0])) return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure when this showed up, but we have a dedicated IsFinite
method which was being elided by this throwing a NonManifold error, which was pretty unclear.
@pca006132 I think this one is ready to merge, but I have no idea why the Windows compiler is suddenly pissed - doesn't look like the spew has anything to do with these changes. Thoughts? |
From the error message:
Apparently it is some weird header in MSVC (TM) that tries to match for every |
* removed RotateUp and uint * avoid new API * simplify * change error reporting * fixed error reporting * fix compile * addressing feedback
Fixes #999
Fixes #996
@starseeker I don't have exactly your repro, but I believe this should fix the problem you reported. Would you mind verifying that?