# HG changeset patch # User rafavzqz # Date 1405529167 0 # Node ID 3da251f2ae4b5f796522d0a6171916daaa46c6cb # Parent ea796fbdadf7a3f5dbd68da2d6a9dc87eac61a54 Added error message diff -r ea796fbdadf7 -r 3da251f2ae4b extra/nurbs/inst/nrbextract.m --- a/extra/nurbs/inst/nrbextract.m Tue Jul 15 16:54:30 2014 +0000 +++ b/extra/nurbs/inst/nrbextract.m Wed Jul 16 16:46:07 2014 +0000 @@ -2,6 +2,7 @@ % % NRBEXTRACT: construct NURBS curves by extracting the boundaries of a NURBS surface, or NURBS surfaces by extracting the boundary of a NURBS volume. +% It only works for geometries constructed with open knot vectors. % % Calling Sequence: % @@ -28,7 +29,7 @@ % 5: W = 0 (only for volumes) % 6: W = 1 (only for volumes) % -% Copyright (C) 2010 Rafael Vazquez +% Copyright (C) 2010,2014 Rafael Vazquez % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by @@ -44,7 +45,15 @@ % along with this program. If not, see . if (~iscell (srf.knots)) - error('The boundary information is only extracted for NURBS surfaces or volumes'); + error('The boundary information is only extracted for NURBS surfaces or volumes'); +end + +for idim = 1:numel(srf.knots) + ord = srf.order(idim); + if (srf.knots{idim}(1) ~= srf.knots{idim}(ord) || ... + srf.knots{idim}(end) ~= srf.knots{idim}(end-ord+1)) + error ('nrbextract: only working for open knot vectors') + end end if (numel (srf.knots) == 2)