-
Notifications
You must be signed in to change notification settings - Fork 27
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
Adds Trimming Curve Support for primal::NURBSPatch
#1503
base: develop
Are you sure you want to change the base?
Conversation
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.
Thanks @jcs15c for another great PR!
/*! | ||
* \file primal_nurbs_patch.cpp | ||
* \brief This file tests primal's NURBS patch functionality | ||
*/ |
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.
copy/paste: Please update this for primal_trimming_curves
// Add simple trimming curves | ||
nPatch.makeTriviallyTrimmed(); | ||
EXPECT_TRUE(nPatch.isTrimmed()); | ||
EXPECT_EQ(nPatch.getNumTrimmingCurves(), 4); | ||
|
||
// Remove all trimming curves, while staying trimmed | ||
nPatch.clearTrimmingCurves(); | ||
EXPECT_TRUE(nPatch.isTrimmed()); | ||
EXPECT_EQ(nPatch.getNumTrimmingCurves(), 0); | ||
|
||
// Remove all trimming curves | ||
nPatch.makeUntrimmed(); | ||
EXPECT_FALSE(nPatch.isTrimmed()); | ||
|
||
// Mark as trimmed, but empty vector of trimming curves | ||
nPatch.makeTrimmed(); | ||
EXPECT_TRUE(nPatch.isTrimmed()); | ||
EXPECT_EQ(nPatch.getNumTrimmingCurves(), 0); |
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.
Do you think users might get tripped up by
NURBSPatch::makeTriviallyTrimmed(); // adds trimming curves for boundaries
NURBSPatch::makeTrimmed(); // does not add trimming curves; presumably entire surface is trimmed away
I'm not sure if I have a good suggestion other than maybe markAsTrimmed()
instead of makeTrimmed()
(following your comment)
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.
markAsTrimmed()
makes sense to me, sounds more intuitive than setTrimmed()
@@ -1000,6 +1000,7 @@ bool intersect(const Ray<T, 3>& ray, | |||
axom::Array<T>& v, | |||
double tol = 1e-8, | |||
double EPS = 1e-8, | |||
bool isTrimmed = true, |
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.
How does this parameter relate to NURBSPatch::isTrimmed()
?
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.
There are some cases where a patch is trimmed, but you want to find intersections with the untrimmed patch, like recording "near-misses" with the visible portion. I should rename this variable to make that more clear, maybe to treatAsTrimmed
or reverse the implementation and have it be treatAsUntrimmed
/considerUntrimmed
?
@@ -7,7 +7,7 @@ | |||
* \file winding_number.hpp | |||
* | |||
* \brief Consists of methods to compute the generalized winding number (GWN) | |||
* for points with respect to various geometric objects. | |||
* for points with respect to various 2D geometric objects. |
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.
Clarification: This file has both 2D and 3D functions, right?
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.
Whoops! Fixed that.
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.
Some additional minor comments
Summary
primal::NURBSPatch
class to maintain and manipulate an unstructured array ofprimal::NURBSCurve
objects to be used for trimming the parameter space of the original patch.EvenOdd
rule on the resulting decimal value. These features are tested in theprimal_trimming_curves.cpp
file.