bugGNU Octave - Bugs: bug #45295, Division by Zero in 2nd derivative...

 
 

bug #45295: Division by Zero in 2nd derivative of NURBS surface

Submitted by:  None
Submitted on:  Wed 10 Jun 2015 12:50:42 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: NoneAssigned to: Carlo de Falco <cdf>
Originator Name: SvenOriginator Email: -unavailable-
Open/Closed: ClosedRelease: other
Operating System: Any

Discussion locked!

 

(Jump to the original submission Jump to the original submission)

Fri 02 Oct 2015 04:07:29 PM UTC, comment #7:

Rafa, is this issue fixed in the new release of NURBS?
Can I close the bug?
c.

Carlo de Falco <cdf>
Project MemberIn charge of this item.
Mon 15 Jun 2015 01:36:27 PM UTC, comment #6:

Hi,

thanks for your replies.

@Carlo: What I've done is the following; take the initial NURBS surface, insert knots until i have Bezier patches and then extract those patches. Bezier patches have C_inf continuity. This should also be true for the rational case.

@Rafa: I have had the same impression. I wasn't sure though. I was a bit irritated by the NaN and Inf entries and the issued warnings.

In order to resolve this issue, maybe outputting a warning would be the best way to go. What do you think?

Sven

Sven <sven>
Mon 15 Jun 2015 12:13:53 PM UTC, comment #5:

Hi Sven,
although you get some invalid control points (Inf and Nan) in the structure for the second derivative, those invalid points should only affect the knot of the discontinuity. I have tried the examples and the computations in the interior of the elements using nrbdeval work correctly, both for curves and surfaces.

Regards,
Rafa

Anonymous
Mon 15 Jun 2015 11:43:25 AM UTC, comment #4:

Hi,

nrbderiv is based on bspderiv that implements
the algorith A3.3 on page 98 of the book:

Piegl, Les and Tiller, Wayne
The Nurbs Book
Springer, New York, 1997 (2nd ed.)

which assumes the input knot vector has at most
p repetitions per knot, p being the degree,
corresponding to C0 continuity.

therefore you can compute the first derivative of a C0
curve but not its second derivative.

On the other hand, I believe that, if you take the C(-1) curve
obtained by performing the first derivative,
the knots and control points of each knot span
should define a Bezier curve.

So if you have a BSpline curve you should be able to
compute the second derivative by cycling over each knotspan
and taking the local knotvector.

I am not sure how this works for rational BSplines,
maybe Rafael can comment on this.

c.

Carlo de Falco <cdf>
Project MemberIn charge of this item.
Mon 15 Jun 2015 10:34:20 AM UTC, comment #3:

Hi Carlo,

yes, my surface has only C0 continuity. Therefore the derivatives at the knots are undefined in general. However, if I am correctly informed, the derivatives are defined inside the knot spans as the function is a (piecewise) polynomial. So shouldn't it be possible to compute the derivative values inside the knot spans or would I have to separate the surface patch first?

Best regards,
Sven

Sven <sven>
Mon 15 Jun 2015 10:23:06 AM UTC, comment #2:

Hi,

It seems that the example geometry you provided has only C0 regularity, so it is to be expected that the 2nd order derivatives be undefined.

using the knots and control points along the first direction
given in your example you can try the following univariate example:

notice the discontinuities in the first derivative are clearly visible in the plot,
we are considering whether it makes sense to add a check and an error message in cases like this.

Do you have an example where computing derivatives fails with a more regular geometry?

Carlo de Falco <cdf>
Project MemberIn charge of this item.
Mon 15 Jun 2015 09:18:01 AM UTC, comment #1:

This is probably related to computing the second derivatives in a surface that is not smooth enough, due to knot repetitions.

Can you try to reproduce the error in a simpler example? A surface of order 3 (degree 2) with one repeated internal knot should be enough. In the example, can you also include the points where you evaluate?

Anonymous
Wed 10 Jun 2015 12:50:42 PM UTC, original submission:

When I try to calculate the 2nd derivatives (Hessian) of my NURBS surface, I get several divisions by Zero, that happen in bspderiv (the difference of the subtracted knots is zero). This results in several (+-) Inf and NaN entries in the Hessian.

I have attached my example data + the commands that lead to the error.

Anonymous

 

Attached Files
file #34194:  nrb.m added by None (167KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by sven (Posted a comment)
  • -unavailable- added by cdf (Updated the item)
  • -unavailable- added by cdf
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 02 Oct 2015 04:30:25 PM UTCcdfOpen/ClosedOpen=>Closed
      Discussion LockUnlocked=>Locked
    Fri 12 Jun 2015 05:46:25 AM UTCcdfAssigned toNone=>cdf
      Carbon-Copy-=>Added -unavailable-
    Wed 10 Jun 2015 12:50:42 PM UTCNoneAttached File-=>Added nrb.m, #34194

    Back to the top


    Powered by Savane 3.1-cleanup1