Skip to content

Commit

Permalink
fix gsKnotVector::degreeDecrease to remove interior knots as needed
Browse files Browse the repository at this point in the history
  • Loading branch information
filiatra committed May 12, 2023
1 parent a6eafe4 commit e60d9e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gsNurbs/gsKnotVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,9 @@ class gsKnotVector : public gsDomain<T>
remove( ubegin() , i );
remove( uend() - 1, i );
m_deg -= i;
for (uiterator itr = ubegin()+1; itr != uend()-1; ++itr)
if ( itr.multiplicity() > m_deg )
remove( itr, itr.multiplicity() - m_deg );
}

/// Increase the multiplicity of all the knots by \a i. If \a
Expand Down

2 comments on commit e60d9e7

@weinmueller
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello all,
I am not sure, if I like this changes:
Assume we have the following multiplicity vector (for an open-knotvector): (4 1 3 1 4). Then using the new degreeDecrease(1) gives us (3 1 2 1 3) right?
Anyway, I would expect from using degreeDecrease that it returns (3 1 3 1 3), even when the knotvector is "discontinuous".
But I am open what you think.
Greetings
Pascal

@filiatra
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Pascal, the problem was when decreasing from (4 1 3 1 4), using degreeDecrease(2), then one was getting (2 1 3 1 2) which is actually an invalid knot vector.
One possibility is to also have the old way by adding a boolean flag, eg.degreeDecrease(int i, bool updateInterior), so that we can get both results.
But I would still keep the default value to "true", to avoid invalid knotvectors. What do you think ?

Please sign in to comment.