changeset 12667:1411b4cf3c81 octave-forge

Check that the curves formed a closed surface
author rafavzqz
date Tue, 28 Jul 2015 10:24:42 +0000
parents fc325d64210b
children 7623d14dd29c
files extra/nurbs/inst/nrbcoons.m
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/extra/nurbs/inst/nrbcoons.m	Wed Jul 08 13:58:00 2015 +0000
+++ b/extra/nurbs/inst/nrbcoons.m	Tue Jul 28 10:24:42 2015 +0000
@@ -89,6 +89,15 @@
   error('Incorrect number of input arguments');
 end
 
+if (max (abs (nrbeval (u1, u1.knots(1)) - nrbeval (v1, v1.knots(1)))) > 1e-10 || ...
+    max (abs (nrbeval (u1, u1.knots(end)) - nrbeval (v2, v2.knots(1)))) > 1e-10 || ...
+    max (abs (nrbeval (u2, u2.knots(1)) - nrbeval (v1, v1.knots(end)))) > 1e-10 || ...
+    max (abs (nrbeval (u2, u2.knots(end)) - nrbeval (v2, v2.knots(end)))) > 1e-10)
+  error ('The four curves do not define a closed boundary')
+end
+
+
+
 r1 = nrbruled(u1, u2);
 r2 = nrbtransp(nrbruled(v1, v2));
 t  = nrb4surf(u1.coefs(:,1), u1.coefs(:,end), u2.coefs(:,1), u2.coefs(:,end));