Skip to content

Commit c98d4ac

Browse files
authored
Merge pull request #1558 from LLNL/feature/spainhour/trimming_curve_subdivision
Add methods for NURBS patch subdivision with Trimming Curves
2 parents 1adf5b8 + 152a3a4 commit c98d4ac

19 files changed

+3406
-1507
lines changed

RELEASE-NOTES.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/
5252
- Adds optional dependency on [Open Cascade](https://dev.opencascade.org). The initial intention is
5353
to use Open Cascade's file I/O capabilities in support of Quest applications.
5454
- Adds `primal::NURBSCurve` and `primal::NURBSPatch` classes, supported by `primal::KnotVector`.
55+
- Adds trimming curve support for `primal::NURBSPatch` via an array of parameter space `primal::NURBSCurve` objects,
56+
where portions of the surface not bound by trimming curves in parameter space are invisible.
5557
- Adds a Quest example that reads in a STEP file using Open Cascade and processes its geometry
5658
- Adds a piecewise method to load external data using `sidre::IOManager`. This adds new overloaded methods
5759
of `loadExternalData` in `sidre::IOManager` and `sidre::Group`.
@@ -88,7 +90,7 @@ to use Open Cascade's file I/O capabilities in support of Quest applications.
8890
- Fixes compilation issue with [email protected] on 32-bit Windows configurations.
8991
This required a [RAJA fix to avoid 64-bit intrinsics](https://github.com/LLNL/RAJA/pull/1746),
9092
as well as support for 32-bit `Word`s in Slam's `BitSet` class.
91-
- Minor bugfix to `primal::intersect(segment, ray)` to better handle cases when segment and ray overlap.
93+
- Minor bugfix to `primal::intersect(segment, ray)` to better handle cases when segment and ray overlap or are nearly parallel.
9294
- Fixes a memory leak in `axom::Array` copy constructor.
9395
- Fixes robustness issue with the `axom::primal::clip` overload for clipping a 2D polygon against another 2D polygon.
9496

src/axom/primal/geometry/BezierCurve.hpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class BezierCurve
392392
* \param [out] eval The value of the curve at \a t
393393
* \param [out] Dt The tangent vector of the curve at \a t
394394
*/
395-
void evaluate_first_derivative(T t, PointType& eval, VectorType& Dt) const
395+
void evaluateFirstDerivative(T t, PointType& eval, VectorType& Dt) const
396396
{
397397
using axom::utilities::lerp;
398398
VectorType val;
@@ -458,8 +458,8 @@ class BezierCurve
458458
Point<T, 1> W;
459459
Vector<T, 1> W_t;
460460

461-
projective.evaluate_first_derivative(t, P, P_t);
462-
weights.evaluate_first_derivative(t, W, W_t);
461+
projective.evaluateFirstDerivative(t, P, P_t);
462+
weights.evaluateFirstDerivative(t, W, W_t);
463463

464464
for(int i = 0; i < NDIMS; ++i)
465465
{
@@ -543,8 +543,8 @@ class BezierCurve
543543
Point<T, 1> W;
544544
Vector<T, 1> W_t;
545545

546-
projective.evaluate_first_derivative(t, P, P_t);
547-
weights.evaluate_first_derivative(t, W, W_t);
546+
projective.evaluateFirstDerivative(t, P, P_t);
547+
weights.evaluateFirstDerivative(t, W, W_t);
548548

549549
for(int i = 0; i < NDIMS; ++i)
550550
{
@@ -562,7 +562,7 @@ class BezierCurve
562562
* \param [out] eval The value of the curve at \a t
563563
* \param [out] Dt The tangent vector of the curve at \a t
564564
*/
565-
void evaluate_second_derivative(T t, PointType& eval, VectorType& Dt, VectorType& DtDt) const
565+
void evaluateSecondDerivative(T t, PointType& eval, VectorType& Dt, VectorType& DtDt) const
566566
{
567567
using axom::utilities::lerp;
568568
VectorType val;
@@ -637,8 +637,8 @@ class BezierCurve
637637
Point<T, 1> W;
638638
Vector<T, 1> W_t, W_tt;
639639

640-
projective.evaluate_second_derivative(t, P, P_t, P_tt);
641-
weights.evaluate_second_derivative(t, W, W_t, W_tt);
640+
projective.evaluateSecondDerivative(t, P, P_t, P_tt);
641+
weights.evaluateSecondDerivative(t, W, W_t, W_tt);
642642

643643
for(int i = 0; i < NDIMS; ++i)
644644
{
@@ -723,8 +723,8 @@ class BezierCurve
723723
Point<T, 1> W;
724724
Vector<T, 1> W_t, W_tt;
725725

726-
projective.evaluate_second_derivative(t, P, P_t, P_tt);
727-
weights.evaluate_second_derivative(t, W, W_t, W_tt);
726+
projective.evaluateSecondDerivative(t, P, P_t, P_tt);
727+
weights.evaluateSecondDerivative(t, W, W_t, W_tt);
728728

729729
for(int i = 0; i < NDIMS; ++i)
730730
{

src/axom/primal/geometry/BezierPatch.hpp

+22-22
Original file line numberDiff line numberDiff line change
@@ -801,11 +801,11 @@ class BezierPatch
801801
*
802802
* \note We typically evaluate the patch at \a u and \a v between 0 and 1
803803
*/
804-
void evaluate_first_derivatives(T u,
805-
T v,
806-
Point<T, NDIMS>& eval,
807-
Vector<T, NDIMS>& Du,
808-
Vector<T, NDIMS>& Dv) const
804+
void evaluateFirstDerivatives(T u,
805+
T v,
806+
Point<T, NDIMS>& eval,
807+
Vector<T, NDIMS>& Du,
808+
Vector<T, NDIMS>& Dv) const
809809
{
810810
using axom::utilities::lerp;
811811
const int ord_u = getOrder_u();
@@ -948,8 +948,8 @@ class BezierPatch
948948
Point<T, 1> W;
949949
Vector<T, 1> W_u, W_v, W_uu, W_vv, W_uv;
950950

951-
projective.evaluate_second_derivatives(u, v, P, P_u, P_v, P_uu, P_vv, P_uv);
952-
weights.evaluate_second_derivatives(u, v, W, W_u, W_v, W_uu, W_vv, W_uv);
951+
projective.evaluateSecondDerivatives(u, v, P, P_u, P_v, P_uu, P_vv, P_uv);
952+
weights.evaluateSecondDerivatives(u, v, W, W_u, W_v, W_uu, W_vv, W_uv);
953953

954954
for(int i = 0; i < NDIMS; ++i)
955955
{
@@ -1124,8 +1124,8 @@ class BezierPatch
11241124
Point<T, 1> W;
11251125
Vector<T, 1> W_u, W_v, W_uu, W_vv, W_uv;
11261126

1127-
projective.evaluate_second_derivatives(u, v, P, P_u, P_v, P_uu, P_vv, P_uv);
1128-
weights.evaluate_second_derivatives(u, v, W, W_u, W_v, W_uu, W_vv, W_uv);
1127+
projective.evaluateSecondDerivatives(u, v, P, P_u, P_v, P_uu, P_vv, P_uv);
1128+
weights.evaluateSecondDerivatives(u, v, W, W_u, W_v, W_uu, W_vv, W_uv);
11291129

11301130
for(int i = 0; i < NDIMS; ++i)
11311131
{
@@ -1151,14 +1151,14 @@ class BezierPatch
11511151
*
11521152
* \note We typically evaluate the patch at \a u and \a v between 0 and 1
11531153
*/
1154-
void evaluate_second_derivatives(T u,
1155-
T v,
1156-
Point<T, NDIMS>& eval,
1157-
Vector<T, NDIMS>& Du,
1158-
Vector<T, NDIMS>& Dv,
1159-
Vector<T, NDIMS>& DuDu,
1160-
Vector<T, NDIMS>& DvDv,
1161-
Vector<T, NDIMS>& DuDv) const
1154+
void evaluateSecondDerivatives(T u,
1155+
T v,
1156+
Point<T, NDIMS>& eval,
1157+
Vector<T, NDIMS>& Du,
1158+
Vector<T, NDIMS>& Dv,
1159+
Vector<T, NDIMS>& DuDu,
1160+
Vector<T, NDIMS>& DvDv,
1161+
Vector<T, NDIMS>& DuDv) const
11621162
{
11631163
using axom::utilities::lerp;
11641164
const int ord_u = getOrder_u();
@@ -1385,8 +1385,8 @@ class BezierPatch
13851385
Point<T, 1> W;
13861386
Vector<T, 1> W_u, W_v, W_uu, W_vv, W_uv;
13871387

1388-
projective.evaluate_second_derivatives(u, v, P, P_u, P_v, P_uu, P_vv, P_uv);
1389-
weights.evaluate_second_derivatives(u, v, W, W_u, W_v, W_uu, W_vv, W_uv);
1388+
projective.evaluateSecondDerivatives(u, v, P, P_u, P_v, P_uu, P_vv, P_uv);
1389+
weights.evaluateSecondDerivatives(u, v, W, W_u, W_v, W_uu, W_vv, W_uv);
13901390

13911391
for(int i = 0; i < NDIMS; ++i)
13921392
{
@@ -1628,7 +1628,7 @@ class BezierPatch
16281628
{
16291629
Point<T, NDIMS> eval;
16301630
Vector<T, NDIMS> Du, Dv;
1631-
evaluate_first_derivatives(u, v, eval, Du, Dv);
1631+
evaluateFirstDerivatives(u, v, eval, Du, Dv);
16321632
return VectorType::cross_product(Du, Dv);
16331633
}
16341634

@@ -2020,7 +2020,7 @@ class BezierPatch
20202020
Segment<T, 3> seg(m_controlPoints(p, 0), m_controlPoints(p, ord_v));
20212021
for(int q = 1; q < ord_v; ++q)
20222022
{
2023-
if(squared_distance(m_controlPoints(p, q), seg))
2023+
if(squared_distance(m_controlPoints(p, q), seg) > sq_tol)
20242024
{
20252025
return false;
20262026
}
@@ -2032,7 +2032,7 @@ class BezierPatch
20322032
Segment<T, 3> seg(m_controlPoints(0, q), m_controlPoints(ord_u, q));
20332033
for(int p = 1; p < ord_u; ++p)
20342034
{
2035-
if(squared_distance(m_controlPoints(p, q), seg))
2035+
if(squared_distance(m_controlPoints(p, q), seg) > sq_tol)
20362036
{
20372037
return false;
20382038
}

0 commit comments

Comments
 (0)