Diff of the two buildlogs: -- --- b1/build.log 2024-04-28 07:57:54.153873518 +0000 +++ b2/build.log 2024-04-28 08:06:49.647046632 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Sat Apr 27 19:42:13 -12 2024 -I: pbuilder-time-stamp: 1714290133 +I: Current time: Sun Apr 28 21:58:22 +14 2024 +I: pbuilder-time-stamp: 1714291102 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/unstable-reproducible-base.tgz] I: copying local configuration @@ -26,52 +26,84 @@ dpkg-source: info: unpacking octave-nurbs_1.4.3-3.debian.tar.xz I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/22893/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/26826/tmp/hooks/D01_modify_environment starting +debug: Running on virt32b. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 Apr 28 07:58 /bin/sh -> /bin/bash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/26826/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/26826/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build/reproducible-path' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='armhf' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=3 ' - DISTRIBUTION='unstable' - HOME='/root' - HOST_ARCH='armhf' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="21" [3]="1" [4]="release" [5]="arm-unknown-linux-gnueabihf") + BASH_VERSION='5.2.21(1)-release' + BUILDDIR=/build/reproducible-path + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=armhf + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=4 ' + DIRSTACK=() + DISTRIBUTION=unstable + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=arm + HOST_ARCH=armhf IFS=' ' - INVOCATION_ID='659fcc678158479c8bfd8183bd4d3aeb' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='22893' - PS1='# ' - PS2='> ' + INVOCATION_ID=261fd361d65643eead560a84b5fe0b7e + LANG=C + LANGUAGE=it_CH:it + LC_ALL=C + MACHTYPE=arm-unknown-linux-gnueabihf + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnueabihf + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=26826 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.XPTFJxkU/pbuilderrc_LU7O --distribution unstable --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.XPTFJxkU/b1 --logfile b1/build.log octave-nurbs_1.4.3-3.dsc' - SUDO_GID='114' - SUDO_UID='108' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://10.0.0.15:3142/' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.XPTFJxkU/pbuilderrc_ghd4 --distribution unstable --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.XPTFJxkU/b2 --logfile b2/build.log octave-nurbs_1.4.3-3.dsc' + SUDO_GID=112 + SUDO_UID=106 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://10.0.0.15:3142/ I: uname -a - Linux virt64a 6.1.0-20-arm64 #1 SMP Debian 6.1.85-1 (2024-04-11) aarch64 GNU/Linux + Linux i-capture-the-hostname 6.1.0-20-armmp-lpae #1 SMP Debian 6.1.85-1 (2024-04-11) armv7l GNU/Linux I: ls -l /bin - lrwxrwxrwx 1 root root 7 Apr 27 07:43 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/22893/tmp/hooks/D02_print_environment finished + lrwxrwxrwx 1 root root 7 Apr 25 07:43 /bin -> usr/bin +I: user script /srv/workspace/pbuilder/26826/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -616,7 +648,7 @@ Get: 505 http://deb.debian.org/debian unstable/main armhf gfortran armhf 4:13.2.0-7 [1432 B] Get: 506 http://deb.debian.org/debian unstable/main armhf octave-dev armhf 8.4.0-1+b4 [951 kB] Get: 507 http://deb.debian.org/debian unstable/main armhf dh-octave all 1.8.0 [22.7 kB] -Fetched 176 MB in 5s (37.7 MB/s) +Fetched 176 MB in 6s (27.8 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package netbase. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19443 files and directories currently installed.) @@ -2700,7 +2732,11 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/reproducible-path/octave-nurbs-1.4.3/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../octave-nurbs_1.4.3-3_source.changes +I: user script /srv/workspace/pbuilder/26826/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for unstable +I: user script /srv/workspace/pbuilder/26826/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/reproducible-path/octave-nurbs-1.4.3/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../octave-nurbs_1.4.3-3_source.changes dpkg-buildpackage: info: source package octave-nurbs dpkg-buildpackage: info: source version 1.4.3-3 dpkg-buildpackage: info: source distribution unstable @@ -2740,37 +2776,37 @@ g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security low_level_functions.cc -o low_level_functions.o /usr/bin/mkoctfile --verbose basisfun.cc low_level_functions.o /usr/bin/mkoctfile --verbose basisfunder.cc low_level_functions.o -g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security basisfun.cc -o /tmp/oct-WKQ0GY.o -g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security basisfunder.cc -o /tmp/oct-INOla3.o /usr/bin/mkoctfile --verbose bspderiv.cc low_level_functions.o -g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security bspderiv.cc -o /tmp/oct-BU8DwK.o /usr/bin/mkoctfile --verbose bspeval.cc low_level_functions.o -g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security bspeval.cc -o /tmp/oct-3lOO3G.o -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o basisfunder.oct low_level_functions.o /tmp/oct-INOla3.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security basisfun.cc -o /tmp/oct-4ZHyHd.o +g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security basisfunder.cc -o /tmp/oct-vsGmLV.o +g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security bspderiv.cc -o /tmp/oct-eMwWSa.o +g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security bspeval.cc -o /tmp/oct-mte0BK.o +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o basisfun.oct low_level_functions.o /tmp/oct-4ZHyHd.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o bspderiv.oct low_level_functions.o /tmp/oct-eMwWSa.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o bspeval.oct low_level_functions.o /tmp/oct-mte0BK.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o basisfunder.oct low_level_functions.o /tmp/oct-vsGmLV.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro /usr/bin/mkoctfile --verbose curvederivcpts.cc low_level_functions.o -g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security curvederivcpts.cc -o /tmp/oct-VVOLpS.o -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o basisfun.oct low_level_functions.o /tmp/oct-WKQ0GY.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security curvederivcpts.cc -o /tmp/oct-ihAtyS.o /usr/bin/mkoctfile --verbose nrb_srf_basisfun__.cc low_level_functions.o -g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security nrb_srf_basisfun__.cc -o /tmp/oct-5IqGnb.o -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o bspeval.oct low_level_functions.o /tmp/oct-3lOO3G.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security nrb_srf_basisfun__.cc -o /tmp/oct-zKhkhT.o /usr/bin/mkoctfile --verbose nrb_srf_basisfun_der__.cc low_level_functions.o -g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security nrb_srf_basisfun_der__.cc -o /tmp/oct-21J1iI.o -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o bspderiv.oct low_level_functions.o /tmp/oct-BU8DwK.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security nrb_srf_basisfun_der__.cc -o /tmp/oct-ZsV3lF.o /usr/bin/mkoctfile --verbose nrbsurfderiveval.cc low_level_functions.o -g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security nrbsurfderiveval.cc -o /tmp/oct-MJxu2O.o -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o curvederivcpts.oct low_level_functions.o /tmp/oct-VVOLpS.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security nrbsurfderiveval.cc -o /tmp/oct-jsnjIz.o +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o curvederivcpts.oct low_level_functions.o /tmp/oct-ihAtyS.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro /usr/bin/mkoctfile --verbose surfderivcpts.cc low_level_functions.o -g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security surfderivcpts.cc -o /tmp/oct-NggsBE.o -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o nrbsurfderiveval.oct low_level_functions.o /tmp/oct-MJxu2O.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o surfderivcpts.oct low_level_functions.o /tmp/oct-NggsBE.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security surfderivcpts.cc -o /tmp/oct-Tvl4ZR.o +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o nrbsurfderiveval.oct low_level_functions.o /tmp/oct-jsnjIz.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro /usr/bin/mkoctfile --verbose surfderiveval.cc low_level_functions.o -g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security surfderiveval.cc -o /tmp/oct-TqlaRa.o +g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security surfderiveval.cc -o /tmp/oct-KUVYC1.o +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o nrb_srf_basisfun__.oct low_level_functions.o /tmp/oct-zKhkhT.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro /usr/bin/mkoctfile --verbose tbasisfun.cc low_level_functions.o -g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security tbasisfun.cc -o /tmp/oct-EnDcY4.o -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o nrb_srf_basisfun__.oct low_level_functions.o /tmp/oct-5IqGnb.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o nrb_srf_basisfun_der__.oct low_level_functions.o /tmp/oct-21J1iI.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o surfderiveval.oct low_level_functions.o /tmp/oct-TqlaRa.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro -g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o tbasisfun.oct low_level_functions.o /tmp/oct-EnDcY4.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security tbasisfun.cc -o /tmp/oct-eXghK1.o +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o nrb_srf_basisfun_der__.oct low_level_functions.o /tmp/oct-ZsV3lF.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o surfderivcpts.oct low_level_functions.o /tmp/oct-Tvl4ZR.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o surfderiveval.oct low_level_functions.o /tmp/oct-KUVYC1.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-8.4.0/octave/.. -I/usr/include/octave-8.4.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-nurbs-1.4.3=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o tbasisfun.oct low_level_functions.o /tmp/oct-eXghK1.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -flto=auto -ffat-lto-objects -Wl,-z,relro make[1]: Leaving directory '/build/reproducible-path/octave-nurbs-1.4.3/src' copyfile /build/reproducible-path/octave-nurbs-1.4.3/./src/basisfun.oct /build/reproducible-path/octave-nurbs-1.4.3/./src/basisfunder.oct /build/reproducible-path/octave-nurbs-1.4.3/./src/bspderiv.oct /build/reproducible-path/octave-nurbs-1.4.3/./src/bspeval.oct /build/reproducible-path/octave-nurbs-1.4.3/./src/curvederivcpts.oct /build/reproducible-path/octave-nurbs-1.4.3/./src/nrb_srf_basisfun__.oct /build/reproducible-path/octave-nurbs-1.4.3/./src/nrb_srf_basisfun_der__.oct /build/reproducible-path/octave-nurbs-1.4.3/./src/nrbsurfderiveval.oct /build/reproducible-path/octave-nurbs-1.4.3/./src/surfderivcpts.oct /build/reproducible-path/octave-nurbs-1.4.3/./src/surfderiveval.oct /build/reproducible-path/octave-nurbs-1.4.3/./src/tbasisfun.oct /build/reproducible-path/octave-nurbs-1.4.3/./src/basisfun.cc-tst /build/reproducible-path/octave-nurbs-1.4.3/./src/curvederivcpts.cc-tst /build/reproducible-path/octave-nurbs-1.4.3/./src/nrbsurfderiveval.cc-tst /build/reproducible-path/octave-nurbs-1.4.3/./src/surfderivcpts.cc-tst /build/reproducible-path/octave-nurbs-1.4.3/./src/surfderiveval.cc-tst /build/reproducible-path/octave-nurbs-1.4.3/./src/tbasisfun.cc-tst /build/reproducible-path/octave-nurbs-1.4.3/./inst/arm-unknown-linux-gnueabihf-api-v58 For information about changes from previous versions of the nurbs package, run 'news nurbs'. @@ -2778,336 +2814,53 @@ Checking package... Run the unit tests... Checking m files ... -[inst/nrbsurfderiveval.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbsurfderiveval.m -***** test - k = [0 0 1 1]; - c = [0 1]; - [coef(2,:,:), coef(1,:,:)] = meshgrid (c, c); - coef(3,:,:) = coef(1,:,:); - srf = nrbmak (coef, {k, k}); - [u, v] = meshgrid (linspace(0,1,11)); - uv = [u(:)';v(:)']; - skl = nrbsurfderiveval (srf, uv, 0); - aux = nrbeval(srf,uv); - assert (squeeze (skl (1:2,1,1,:)), aux(1:2,:), 1e3*eps) +[inst/curvederiveval.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/curvederiveval.m ***** test - k = [0 0 1 1]; - c = [0 1]; - [coef(2,:,:), coef(1,:,:)] = meshgrid (c, c); - coef(3,:,:) = coef(1,:,:); - srf = nrbmak (coef, {k, k}); - srf = nrbkntins (srf, {[], rand(2,1)}); - [u, v] = meshgrid (linspace(0,1,11)); - uv = [u(:)';v(:)']; - skl = nrbsurfderiveval (srf, uv, 0); - aux = nrbeval(srf,uv); - assert (squeeze (skl (1:2,1,1,:)), aux(1:2,:), 1e3*eps) -***** shared srf, uv -***** test k = [0 0 0 1 1 1]; - c = [0 1/2 1]; - [coef(1,:,:), coef(2,:,:)] = meshgrid (c, c); - coef(3,:,:) = coef(1,:,:); - srf = nrbmak (coef, {k, k}); - ders= nrbderiv (srf); - [u, v] = meshgrid (linspace(0,1,11)); - uv = [u(:)';v(:)']; - skl = nrbsurfderiveval (srf, uv, 1); - [fun, der] = nrbdeval (srf, ders, uv); - assert (squeeze (skl (1:2,1,1,:)), fun(1:2,:), 1e3*eps) - assert (squeeze (skl (1:2,2,1,:)), der{1}(1:2,:), 1e3*eps) - assert (squeeze (skl (1:2,1,2,:)), der{2}(1:2,:), 1e3*eps) - -***** test - srf = nrbdegelev (srf, [3, 1]); - ders= nrbderiv (srf); - [fun, der] = nrbdeval (srf, ders, uv); - skl = nrbsurfderiveval (srf, uv, 1); - assert (squeeze (skl (1:2,1,1,:)), fun(1:2,:), 1e3*eps) - assert (squeeze (skl (1:2,2,1,:)), der{1}(1:2,:), 1e3*eps) - assert (squeeze (skl (1:2,1,2,:)), der{2}(1:2,:), 1e3*eps) -***** shared uv -***** test - k = [0 0 0 1 1 1]; - c = [0 1/2 1]; - [coef(2,:,:), coef(1,:,:)] = meshgrid (c, c); - coef(3,:,:) = coef(1,:,:); - srf = nrbmak (coef, {k, k}); - ders= nrbderiv (srf); - [u, v] = meshgrid (linspace(0,1,11)); - uv = [u(:)';v(:)']; - skl = nrbsurfderiveval (srf, uv, 1); - [fun, der] = nrbdeval (srf, ders, uv); - assert (squeeze (skl (1:2,1,1,:)), fun(1:2,:), 1e3*eps) - assert (squeeze (skl (1:2,2,1,:)), der{1}(1:2,:), 1e3*eps) - assert (squeeze (skl (1:2,1,2,:)), der{2}(1:2,:), 1e3*eps) - -***** test - p = 3; q = 3; - mcp = 5; ncp = 5; - Lx = 10*rand(1); Ly = Lx; - srf = nrbdegelev (nrb4surf ([0 0], [Lx, 0], [0 Ly], [Lx Ly]), [p-1, q-1]); - %%srf = nrbkntins (srf, {linspace(0,1,mcp-p+2)(2:end-1), linspace(0,1,ncp-q+2)(2:end-1)}); - %%srf.coefs = permute (srf.coefs, [1 3 2]); - ders= nrbderiv (srf); - [fun, der] = nrbdeval (srf, ders, uv); - skl = nrbsurfderiveval (srf, uv, 1); - assert (squeeze (skl (1:2,1,1,:)), fun(1:2,:), 1e3*eps) - assert (squeeze (skl (1:2,2,1,:)), der{1}(1:2,:), 1e3*eps) - assert (squeeze (skl (1:2,1,2,:)), der{2}(1:2,:), 1e3*eps) -***** shared srf, uv, P, dPdx, d2Pdx2, c1, c2 + coefs(:,1) = [0;0;0;1]; + coefs(:,2) = [1;0;1;1]; + coefs(:,3) = [1;1;1;1]; + crv = nrbmak (coefs, k); + ck = curvederiveval (crv.number-1, crv.order-1, crv.knots, squeeze (crv.coefs(1,:,:)), 0.5, 2); + assert(ck, [0.75; 1; -2]); + ck = curvederiveval (crv.number-1, crv.order-1, crv.knots, squeeze (crv.coefs(2,:,:)), 0.5, 2); + assert(ck, [0.25; 1; 2]); + ck = curvederiveval (crv.number-1, crv.order-1, crv.knots, squeeze (crv.coefs(3,:,:)), 0.5, 2); + assert(ck, [0.75; 1; -2]); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/findspan.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/findspan.m ***** test - [u, v] = meshgrid (linspace(0,1,10)); - uv = [u(:)';v(:)']; - c1 = nrbmak([0 1/2 1; 0 1 0],[0 0 0 1 1 1]); - c1 = nrbtform (c1, vecrotx (pi/2)); - c2 = nrbtform(c1, vectrans([0 1 0])); - srf = nrbdegelev (nrbruled (c1, c2), [3, 1]); - skl = nrbsurfderiveval (srf, uv, 2); - P = squeeze(skl(:,1,1,:)); - dPdx = squeeze(skl(:,2,1,:)); - d2Pdx2 = squeeze(skl(:,3,1,:)); -***** assert(P(3,:), 2*(P(1,:)-P(1,:).^2),100*eps) -***** assert(dPdx(3,:), 2-4*P(1,:), 100*eps) -***** assert(d2Pdx2(3,:), -4+0*P(1,:), 100*eps) - srf = nrbdegelev (nrbruled (c1, c2), [5, 6]); - skl = nrbsurfderiveval (srf, uv, 2); - P = squeeze(skl(:,1,1,:)); - dPdx = squeeze(skl(:,2,1,:)); - d2Pdx2 = squeeze(skl(:,3,1,:)); - aux = nrbeval(srf,uv); - assert (squeeze (skl (1:2,1,1,:)), aux(1:2,:), 1e3*eps) -***** assert(P(3,:), 2*(P(1,:)-P(1,:).^2),100*eps) -***** assert(dPdx(3,:), 2-4*P(1,:), 100*eps) -***** assert(d2Pdx2(3,:), -4+0*P(1,:), 100*eps) - + n = 3; + U = [0 0 0 1/2 1 1 1]; + p = 2; + u = linspace(0, 1, 10); + s = findspan (n, p, u, U); + assert (s, [2*ones(1, 5) 3*ones(1, 5)]); ***** test - skl = nrbsurfderiveval (srf, uv, 0); - aux = nrbeval (srf, uv); - assert (squeeze (skl (1:2,1,1,:)), aux(1:2,:), 1e3*eps) -***** shared dPdu, d2Pdu2, P, srf, uv + p = 2; m = 7; n = m - p - 1; + U = [zeros(1,p) linspace(0,1,m+1-2*p) ones(1,p)]; + u = [ 0 0.11880 0.55118 0.93141 0.40068 0.35492 0.44392 0.88360 0.35414 0.92186 0.83085 1]; + s = [2 2 3 4 3 3 3 4 3 4 4 4]; + assert (findspan (n, p, u, U), s, 1e-10); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/nrbinverse.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbinverse.m ***** test - [u, v] = meshgrid (linspace(0,1,10)); - uv = [u(:)';v(:)']; - c1 = nrbmak([0 1/2 1; 0.1 1.6 1.1; 0 0 0],[0 0 0 1 1 1]); - c2 = nrbmak([0 1/2 1; 0.1 1.6 1.1; 1 1 1],[0 0 0 1 1 1]); - srf = nrbdegelev (nrbruled (c1, c2), [0, 1]); - skl = nrbsurfderiveval (srf, uv, 2); - P = squeeze(skl(:,1,1,:)); - dPdu = squeeze(skl(:,2,1,:)); - dPdv = squeeze(skl(:,1,2,:)); - d2Pdu2 = squeeze(skl(:,3,1,:)); - aux = nrbeval(srf,uv); - assert (squeeze (skl (1:2,1,1,:)), aux(1:2,:), 1e3*eps) -***** assert(dPdu(2,:), 3-4*P(1,:),100*eps) -***** assert(d2Pdu2(2,:), -4+0*P(1,:),100*eps) + nrb = nrb4surf ([0 0], [1 0], [2 3], [5 4]); + p = nrbeval (nrb, {.25 .75}); + u = nrbinverse (nrb, p, 'Display', false); + assert (norm (u - [.25; .75]) < 1e-8); ***** test - skl = nrbsurfderiveval (srf, uv, 0); - aux = nrbeval(srf,uv); - assert (squeeze (skl (1:2,1,1,:)), aux(1:2,:), 1e3*eps) -***** test - srf = nrb4surf([0 0], [1 0], [0 1], [1 1]); - geo = nrbdegelev (srf, [3 3]); - geo = nrbkntins (geo, {[.1:.1:.9], [.2:.2:.8]}); - [u, v] = meshgrid (linspace(0,1,10)); - uv = [u(:)';v(:)']; - skl = nrbsurfderiveval (geo, uv, 2); - dgeo = nrbderiv (geo); - [pnts, ders] = nrbdeval (geo, dgeo, uv); - assert (ders{1}, squeeze(skl(:,2,1,:)), 1e-9) - assert (ders{2}, squeeze(skl(:,1,2,:)), 1e-9) -***** test - crv = nrbline ([1 0], [2 0]); - srf = nrbrevolve (crv, [0 0 0], [0 0 1], pi/2); - srf = nrbtransp (srf); - [v, u] = meshgrid (linspace (0, 1, 11)); - uv = [u(:)'; v(:)']; - skl = nrbsurfderiveval (srf, uv, 2); - c = sqrt(2); - w = @(x, y) (2 - c)*y.^2 + (c-2)*y + 1; - dwdy = @(x, y) 2*(2-c)*y + c - 2; - d2wdy2 = @(x, y) 2*(2-c); - F1 = @(x, y) (x+1) .* ((1-y).^2 + c*y.*(1-y)) ./ w(x,y); - F2 = @(x, y) (x+1) .* (y.^2 + c*y.*(1-y)) ./ w(x,y); - dF1dx = @(x, y) ((1-y).^2 + c*y.*(1-y)) ./ w(x,y); - dF2dx = @(x, y) (y.^2 + c*y.*(1-y)) ./ w(x,y); - dF1dy = @(x, y) (x+1) .* ((2 - 2*c)*y + c - 2) ./ w(x,y) - (x+1) .* ((1-y).^2 + c*y.*(1-y)) .* dwdy(x,y) ./ w(x,y).^2; - dF2dy = @(x, y) (x+1) .* ((2 - 2*c)*y + c) ./ w(x,y) - (x+1) .* (y.^2 + c*y.*(1-y)) .* dwdy(x,y) ./ w(x,y).^2; - d2F1dx2 = @(x, y) zeros (size (x)); - d2F2dx2 = @(x, y) zeros (size (x)); - d2F1dxdy = @(x, y) ((2 - 2*c)*y + c - 2) ./ w(x,y) - ((1-y).^2 + c*y.*(1-y)) .* dwdy(x,y) ./ w(x,y).^2; - d2F2dxdy = @(x, y) ((2 - 2*c)*y + c) ./ w(x,y) - (y.^2 + c*y.*(1-y)) .* dwdy(x,y) ./ w(x,y).^2; - d2F1dy2 = @(x, y) (x+1)*(2 - 2*c) ./ w(x,y) - 2*(x+1) .* ((2 - 2*c)*y + c - 2) .* dwdy(x,y) ./ w(x,y).^2 - ... - (x+1) .* ((1-y).^2 + c*y.*(1-y)) * d2wdy2(x,y) ./ w(x,y).^2 + ... - 2 * (x+1) .* ((1-y).^2 + c*y.*(1-y)) .* w(x,y) .*dwdy(x,y).^2 ./ w(x,y).^4; - d2F2dy2 = @(x, y) (x+1)*(2 - 2*c) ./ w(x,y) - 2*(x+1) .* ((2 - 2*c)*y + c) .* dwdy(x,y) ./ w(x,y).^2 - ... - (x+1) .* (y.^2 + c*y.*(1-y)) * d2wdy2(x,y) ./ w(x,y).^2 + ... - 2 * (x+1) .* (y.^2 + c*y.*(1-y)) .* w(x,y) .*dwdy(x,y).^2 ./ w(x,y).^4; - assert ([F1(u(:),v(:)), F2(u(:),v(:))], squeeze(skl(1:2,1,1,:))', 1e2*eps); - assert ([dF1dx(u(:),v(:)), dF2dx(u(:),v(:))], squeeze(skl(1:2,2,1,:))', 1e2*eps); - assert ([dF1dy(u(:),v(:)), dF2dy(u(:),v(:))], squeeze(skl(1:2,1,2,:))', 1e2*eps); - assert ([d2F1dx2(u(:),v(:)), d2F2dx2(u(:),v(:))], squeeze(skl(1:2,3,1,:))', 1e2*eps); - assert ([d2F1dxdy(u(:),v(:)), d2F2dxdy(u(:),v(:))], squeeze(skl(1:2,2,2,:))', 1e2*eps); - assert ([d2F1dy2(u(:),v(:)), d2F2dy2(u(:),v(:))], squeeze(skl(1:2,1,3,:))', 1e2*eps); -***** test - knots = {[0 0 1 1] [0 0 1 1]}; - coefs(:,1,1) = [0;0;0;1]; - coefs(:,2,1) = [1;0;0;1]; - coefs(:,1,2) = [0;1;0;1]; - coefs(:,2,2) = [1;1;1;2]; - srf = nrbmak (coefs, knots); - [v, u] = meshgrid (linspace (0, 1, 3)); - uv = [u(:)'; v(:)']; - skl = nrbsurfderiveval (srf, uv, 2); - w = @(x, y) x.*y + 1; - F1 = @(x, y) x ./ w(x,y); - F2 = @(x, y) y ./ w(x,y); - F3 = @(x, y) x .* y ./ w(x,y); - dF1dx = @(x, y) 1./w(x,y) - x.*y./w(x,y).^2; - dF1dy = @(x, y) - x.^2./w(x,y).^2; - dF2dx = @(x, y) - y.^2./w(x,y).^2; - dF2dy = @(x, y) 1./w(x,y) - x.*y./w(x,y).^2; - dF3dx = @(x, y) y./w(x,y) - x.*(y./w(x,y)).^2; - dF3dy = @(x, y) x./w(x,y) - y.*(x./w(x,y)).^2; - d2F1dx2 = @(x, y) -2*y./w(x,y).^2 + 2*x.*y.^2./w(x,y).^3; - d2F1dy2 = @(x, y) 2*x.^3./w(x,y).^3; - d2F1dxdy = @(x, y) -x./w(x,y).^2 - x./w(x,y).^2 + 2*x.^2.*y./w(x,y).^3; - d2F2dx2 = @(x, y) 2*y.^3./w(x,y).^3; - d2F2dy2 = @(x, y) -2*x./w(x,y).^2 + 2*y.*x.^2./w(x,y).^3; - d2F2dxdy = @(x, y) -y./w(x,y).^2 - y./w(x,y).^2 + 2*y.^2.*x./w(x,y).^3; - d2F3dx2 = @(x, y) -2*y.^2./w(x,y).^2 + 2*x.*y.^3./w(x,y).^3; - d2F3dy2 = @(x, y) -2*x.^2./w(x,y).^2 + 2*y.*x.^3./w(x,y).^3; - d2F3dxdy = @(x, y) 1./w(x,y) - 3*x.*y./w(x,y).^2 + 2*(x.*y).^2./w(x,y).^3; - assert ([F1(u(:),v(:)), F2(u(:),v(:)), F3(u(:),v(:))], squeeze(skl(1:3,1,1,:))', 1e2*eps); - assert ([dF1dx(u(:),v(:)), dF2dx(u(:),v(:)), dF3dx(u(:),v(:))], squeeze(skl(1:3,2,1,:))', 1e2*eps); - assert ([dF1dy(u(:),v(:)), dF2dy(u(:),v(:)), dF3dy(u(:),v(:))], squeeze(skl(1:3,1,2,:))', 1e2*eps); - assert ([d2F1dx2(u(:),v(:)), d2F2dx2(u(:),v(:)), d2F3dx2(u(:),v(:))], squeeze(skl(1:3,3,1,:))', 1e2*eps); - assert ([d2F1dy2(u(:),v(:)), d2F2dy2(u(:),v(:)), d2F3dy2(u(:),v(:))], squeeze(skl(1:3,1,3,:))', 1e2*eps); - assert ([d2F1dxdy(u(:),v(:)), d2F2dxdy(u(:),v(:)), d2F3dxdy(u(:),v(:))], squeeze(skl(1:3,2,2,:))', 1e2*eps); -21 tests, 21 passed, 0 known failure, 0 skipped -[inst/nrbbasisfun.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbbasisfun.m -***** demo - U = [0 0 0 0 1 1 1 1]; - x = [0 1/3 2/3 1] ; - y = [0 0 0 0]; - w = [1 1 1 1]; - nrb = nrbmak ([x;y;y;w], U); - u = linspace(0, 1, 30); - B = nrbbasisfun (u, nrb); - xplot = sum(bsxfun(@(x,y) x.*y, B, x),2); - plot(xplot, B) - title('Cubic Bernstein polynomials') - hold off -***** test - U = [0 0 0 0 1 1 1 1]; - x = [0 1/3 2/3 1] ; - y = [0 0 0 0]; - w = rand(1,4); - nrb = nrbmak ([x;y;y;w], U); - u = linspace(0, 1, 30); - B = nrbbasisfun (u, nrb); - xplot = sum(bsxfun(@(x,y) x.*y, B, x),2); - - yy = y; yy(1) = 1; - nrb2 = nrbmak ([x.*w;yy;y;w], U); - aux = nrbeval(nrb2,u); - %figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).') - assert(B(:,1), w(1)*aux(2,:).', 1e-6) - - yy = y; yy(2) = 1; - nrb2 = nrbmak ([x.*w;yy;y;w], U); - aux = nrbeval(nrb2, u); - %figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).') - assert(B(:,2), w(2)*aux(2,:).', 1e-6) - - yy = y; yy(3) = 1; - nrb2 = nrbmak ([x.*w;yy;y;w], U); - aux = nrbeval(nrb2,u); - %figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).') - assert(B(:,3), w(3)*aux(2,:).', 1e-6) + nrb = nrb4surf ([0 0], [1 0], [2 3], [5 4]); + nrb = nrbdegelev (nrbextrude (nrb, [0 2 1]), [3 3 3]); + p = nrbeval (nrb, {.25 .75 .05}); + u = nrbinverse (nrb, p, 'Display', false, 'TolX', 1e-12, 'TolFun', 1e-10); + assert (norm (u - [.25; .75; .05]) < 1e-8); - yy = y; yy(4) = 1; - nrb2 = nrbmak ([x.*w;yy;y;w], U); - aux = nrbeval(nrb2,u); - %figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).') - assert(B(:,4), w(4)*aux(2,:).', 1e-6) -***** test - p = 2; q = 3; m = 4; n = 5; - Lx = 1; Ly = 1; - nrb = nrb4surf ([0 0], [1 0], [0 1], [1 1]); - nrb = nrbdegelev (nrb, [p-1, q-1]); - aux1 = linspace(0,1,m); aux2 = linspace(0,1,n); - nrb = nrbkntins (nrb, {aux1(2:end-1), aux2(2:end-1)}); - u = rand (1, 30); v = rand (1, 10); - u = u - min (u); u = u / max (u); - v = v - min (v); v = v / max (v); - [B, N] = nrbbasisfun ({u, v}, nrb); - assert (sum(B, 2), ones(300, 1), 1e-6) - assert (all (all (B<=1)), true) - assert (all (all (B>=0)), true) - assert (all (all (N>0)), true) - assert (all (all (N <= prod (nrb.number))), true) - assert (max (max (N)),prod (nrb.number)) - assert (min (min (N)),1) -***** test - p1 = 2; p2 = 3; p3 = 2; - n1 = 4; n2 = 5; n3 = 4; - Lx = 1; Ly = 1; Lz = 1; - crv = nrbline([1 0], [2 0]); - nrb = nrbtransp (nrbrevolve (crv, [], [0 0 1], pi/2)); - nrb = nrbextrude (nrb, [0 0 1]); - nrb = nrbdegelev (nrb, [p1-1, p2-2, p3-1]); - aux1 = linspace(0,1,n1); aux2 = linspace(0,1,n2); aux3 = linspace(0,1,n3); - nrb = nrbkntins (nrb, {aux1(2:end-1), aux2(2:end-1), aux3(2:end-1)}); - - u = rand (1, 12); v = rand (1, 10); w = rand (1, 15); - u = u - min (u); u = u / max (u); - v = v - min (v); v = v / max (v); - w = w - min (w); w = w / max (w); - [B, N] = nrbbasisfun ({u, v, w}, nrb); - assert (all(sum(B, 2) - ones(numel(u)*numel(v)*numel(w),1) < 1e-6)) - assert (all (all (B <= 1)) == true) - assert (all (all (B >= 0)) == true) - assert (all (all (N > 0)) == true) - assert (all (all (N <= prod (nrb.number))) == true) - assert (max (max (N)) == prod (nrb.number)) - assert (min (min (N))== 1) -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/curvederivcpts.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/curvederivcpts.m -***** test - line = nrbmak([0.0 1.5; 0.0 3.0],[0.0 0.0 1.0 1.0]); - pk = curvederivcpts (line.number-1, line.order-1, line.knots,... - line.coefs(1,:), 2); - assert (pk, [0 3/2; 3/2 0], 100*eps); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/nrbmeasure.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbmeasure.m -***** test - c = nrbcirc (1, [0 0], 0, pi/3); - l = nrbmeasure(c, 0, 1, 1e-7); - assert (l, pi/3, 1e-7) -***** test - c = nrbcirc (1, [0 0], 0, pi/2); - s = zeros (1, 100); e = linspace (0, 1, 100); - for ii = 1:100 - l(ii) = nrbmeasure (c, s(ii), e(ii), 1e-7); - endfor - xx = nrbeval (c, e); - theta = atan2 (xx(2,:), xx(1,:)); - assert (l, theta, 1e-7) -***** test - c = nrbcirc (1, [0 0], 0, pi/2); - s = 0; e = linspace (0, 1, 100); - for ii = 1:100 - l(ii) = nrbmeasure (c, s, e(ii), 1e-7); - endfor - l2 = nrbmeasure (c, s, e, 1e-7); - assert (l, l2, eps) -3 tests, 3 passed, 0 known failure, 0 skipped +2 tests, 2 passed, 0 known failure, 0 skipped [inst/nrbsquare.m] >>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbsquare.m ***** test @@ -3183,201 +2936,6 @@ [y.^3 x.^2 z]'; assert(points,[y.^3 x.^2 z]',1e-10); 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/nrbnumbasisfun.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbnumbasisfun.m -***** test - p = 2; q = 3; m = 4; n = 5; - Lx = 1; Ly = 1; - nrb = nrb4surf ([0 0], [1 0], [0 1], [1 1]); - nrb = nrbdegelev (nrb, [p-1, q-1]); - ikx = linspace(0,1,m); iky = linspace(0,1,n); - nrb = nrbkntins (nrb, {ikx(2:end-1), iky(2:end-1)}); - nrb.coefs (4,:,:) = nrb.coefs (4,:,:) + rand (size (nrb.coefs (4,:,:))); - u = rand (1, 30); v = rand (1, 10); - u = (u-min (u))/max (u-min (u)); - v = (v-min (v))/max (v-min (v)); - N = nrbnumbasisfun ({u, v}, nrb); - assert (all (all (N>0)), true) - assert (all (all (N <= prod (nrb.number))), true) - assert (max (max (N)), prod (nrb.number)) - assert (min (min (N)), 1) -1 test, 1 passed, 0 known failure, 0 skipped -[inst/surfderiveval.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/surfderiveval.m -***** shared srf -***** test - k = [0 0 0 1 1 1]; - c = [0 1/2 1]; - [coef(2,:,:), coef(1,:,:)] = meshgrid (c, c); - srf = nrbmak (coef, {k, k}); - skl = surfderiveval (srf.number(1)-1, ... - srf.order(1)-1, ... - srf.knots{1}, ... - srf.number(2)-1, ... - srf.order(2)-1, ... - srf.knots{2},... - squeeze(srf.coefs(1,:,:)), .5, .5, 1) ; - assert (skl, [.5 0; 1 0]) -***** test - srf = nrbkntins (srf, {[], rand(1,2)}); - skl = surfderiveval (srf.number(1)-1,... - srf.order(1)-1, ... - srf.knots{1},... - srf.number(2)-1,... - srf.order(2)-1, ... - srf.knots{2},... - squeeze(srf.coefs(1,:,:)), .5, .5, 1) ; - assert (skl, [.5 0; 1 0], 100*eps) -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/aveknt.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/aveknt.m -***** test - knt = [0 0 0 0.5 1 1 1]; - pts = aveknt (knt, 3); - assert (pts - [0 1/4 3/4 1] < 1e-14) - -***** test - knt = {[0 0 0 0.5 1 1 1] [0 0 0 0 1/3 2/3 1 1 1 1]}; - pts = aveknt (knt, [3 4]); - assert (pts{1} - [0 1/4 3/4 1] < 1e-14); - assert (pts{2} - [0 1/9 1/3 2/3 8/9 1] < 1e-14); - -***** test - nrb = nrb4surf([0 0], [1 0], [0 1], [1 1]); - nrb = nrbkntins (nrbdegelev (nrb, [1 2]), {[1/2] [1/3 2/3]}); - pts = aveknt (nrb); - assert (pts{1} - [0 1/4 3/4 1] < 1e-14); - assert (pts{2} - [0 1/9 1/3 2/3 8/9 1] < 1e-14); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/surfderivcpts.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/surfderivcpts.m -***** test - coefs = cat(3,[0 0; 0 1],[1 1; 0 1]); - knots = {[0 0 1 1] [0 0 1 1]}; - plane = nrbmak(coefs,knots); - pkl = surfderivcpts (plane.number(1)-1, plane.order(1)-1,... - plane.knots{1}, plane.number(2)-1,... - plane.order(2)-1, plane.knots{2}, ... - squeeze (plane.coefs(1,:,:)), 1); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/kntbrkdegmult.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/kntbrkdegmult.m -***** test - breaks = [0 1 2 3 4]; - degree = 3; - knots = kntbrkdegmult (breaks, degree); - assert (knots, [0 0 0 0 1 2 3 4 4 4 4]) -***** test - breaks = [0 1 2 3 4]; - degree = 3; - mult = 2; - knots = kntbrkdegmult (breaks, degree, mult); - assert (knots, [0 0 0 0 1 1 2 2 3 3 4 4 4 4]) -***** test - breaks = [0 1 2 3 4]; - degree = 3; - mult = [1 2 3]; - knots = kntbrkdegmult (breaks, degree, mult); - assert (knots, [0 0 0 0 1 2 2 3 3 3 4 4 4 4]) -***** test - breaks = {[0 1 2 3 4] [0 1 2 3]}; - degree = [3 2]; - mult = {[1 2 3] 2}; - knots = kntbrkdegmult (breaks, degree, mult); - assert (knots, {[0 0 0 0 1 2 2 3 3 3 4 4 4 4] [0 0 0 1 1 2 2 3 3 3]}) -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/tbasisfun.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/tbasisfun.m -***** demo - U = {[0 0 1/2 1 1], [0 0 0 1 1]}; - p = [3, 3]; - [X, Y] = meshgrid (linspace(0, 1, 30)); - u = [X(:), Y(:)]'; - N = tbasisfun (u, p, U); - surf (X, Y, reshape (N, size(X))) - title('Basis function associated to a local knot vector') - hold off -***** test - U = [0 1/2 1]; - p = 1; - u = [0.3 0.4 0.6 0.7]; - [N, Nder] = tbasisfun (u, p, U); - assert (N, [0.6 0.8 0.8 0.6], 1e-12); - assert (Nder, [2 2 -2 -2], 1e-12); -***** test - U = {[0 1/2 1] [0 1/2 1]}; - p = [1 1]; - u = [0.3 0.4 0.6 0.7; 0.3 0.4 0.6 0.7]; - [N, Nder] = tbasisfun (u, p, U); - assert (N, [0.36 0.64 0.64 0.36], 1e-12); - assert (Nder, [1.2 1.6 -1.6 -1.2; 1.2 1.6 -1.6 -1.2], 1e-12); -***** test - U = {[0 1/2 1] [0 1/2 1] [0 1/2 1]}; - p = [1 1 1]; - u = [0.4 0.4 0.6 0.6; 0.4 0.4 0.6 0.6; 0.4 0.6 0.4 0.6]; - [N, Nder] = tbasisfun (u, p, U); - assert (N, [0.512 0.512 0.512 0.512], 1e-12); - assert (Nder, [1.28 1.28 -1.28 -1.28; 1.28 1.28 -1.28 -1.28; 1.28 -1.28 1.28 -1.28], 1e-12); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/nrbtransp.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbtransp.m -***** demo - srf = nrb4surf([0 0 0], [1 0 1], [0 1 1], [1 1 2]); - nrbplot(srf,[20 5]); - title('Plane surface and its transposed (translated)') - hold on - srf.coefs(3,:,:) = srf.coefs(3,:,:) + 10; - srf = nrbtransp(srf); - nrbplot(srf,[20 5]); - hold off -***** test - srf = nrbrevolve(nrbline([1 0],[2 0]), [0 0 0], [0 0 1], pi/2); - srft = nrbtransp(srf); - assert (srf.number, fliplr(srft.number)); - assert (srf.order, fliplr(srft.order)); - assert (srf.knots, fliplr(srft.knots)); - assert (srf.coefs, permute(srft.coefs, [1 3 2])); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/nrbcrvderiveval.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbcrvderiveval.m -***** test - knots = [0 0 0 1 1 1]; - coefs(:,1) = [0; 0; 0; 1]; - coefs(:,2) = [1; 0; 1; 1]; - coefs(:,3) = [1; 1; 1; 2]; - crv = nrbmak (coefs, knots); - u = linspace (0, 1, 100); - ck = nrbcrvderiveval (crv, u, 2); - w = @(x) 1 + x.^2; - dw = @(x) 2*x; - F1 = @(x) (2*x - x.^2)./w(x); - F2 = @(x) x.^2./w(x); - F3 = @(x) (2*x - x.^2)./w(x); - dF1 = @(x) (2 - 2*x)./w(x) - 2*(2*x - x.^2).*x./w(x).^2; - dF2 = @(x) 2*x./w(x) - 2*x.^3./w(x).^2; - dF3 = @(x) (2 - 2*x)./w(x) - 2*(2*x - x.^2).*x./w(x).^2; - d2F1 = @(x) -2./w(x) - 2*x.*(2-2*x)./w(x).^2 - (8*x-6*x.^2)./w(x).^2 + 8*x.^2.*(2*x-x.^2)./w(x).^3; - d2F2 = @(x) 2./w(x) - 4*x.^2./w(x).^2 - 6*x.^2./w(x).^2 + 8*x.^4./w(x).^3; - d2F3 = @(x) -2./w(x) - 2*x.*(2-2*x)./w(x).^2 - (8*x-6*x.^2)./w(x).^2 + 8*x.^2.*(2*x-x.^2)./w(x).^3; - assert ([F1(u); F2(u); F3(u)], squeeze(ck(:, 1, :)), 1e2*eps); - assert ([dF1(u); dF2(u); dF3(u)], squeeze(ck(:, 2, :)), 1e2*eps); - assert ([d2F1(u); d2F2(u); d2F3(u)], squeeze(ck(:, 3, :)), 1e2*eps); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/crvkntremove.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/crvkntremove.m -***** test - crv = nrbdegelev (nrbline (), 3); - acrv = nrbkntins (crv, [.11 .11 .11]); - [rcrv, t] = crvkntremove (acrv, .11, 8, 3, 3, 1e-10); - assert (crv.knots, rcrv.knots, 1e-10); - assert (t, 3); -***** test - crv = nrbcirc (); - acrv = nrbkntins (crv, [.3 .3]); - [rcrv, t] = crvkntremove (acrv, .3, 7, 2, 2, 1e-10); - assert (crv.knots, rcrv.knots, 1e-10); - assert (t, 2); -2 tests, 2 passed, 0 known failure, 0 skipped [inst/basisfun.m] >>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/basisfun.m ***** test @@ -3399,116 +2957,6 @@ B = basisfun (s, u, p, U); assert (B, Bref, 1e-5); 1 test, 1 passed, 0 known failure, 0 skipped -[inst/numbasisfun.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/numbasisfun.m -***** test - n = 3; - U = [0 0 0 1/2 1 1 1]; - p = 2; - u = linspace (0, 1, 10); - s = findspan (n, p, u, U); - Bref = [0 0 0 0 0 1 1 1 1 1; ... - 1 1 1 1 1 2 2 2 2 2; ... - 2 2 2 2 2 3 3 3 3 3].'; - B = numbasisfun (s, u, p, U); - assert (B, Bref) -1 test, 1 passed, 0 known failure, 0 skipped -[inst/nrbeval_der_w.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbeval_der_w.m -***** test % 1D - nrb = nrbkntins (nrbcirc (1, [0 0], 0, pi/2), .5); - u = linspace (0, 1, 11); - delta_w = .01; - n = nrb.number; - der_ex = zeros (3, numel (u), n); - der_fd = zeros (3, numel (u), n); - for iw = 1:n - new_w1 = nrb.coefs (4, iw) + delta_w; - new_w2 = nrb.coefs (4, iw) - delta_w; - nrb1 = nrbmodw (nrb, new_w1, iw); - nrb2 = nrbmodw (nrb, new_w2, iw); - der_ex(:,:,iw) = nrbeval_der_w (nrb, iw, u); - p2 = nrbeval (nrb2, u); - p1 = nrbeval (nrb1, u); - der_fd(:,:,iw) = -(p2 - p1) ./ (2*delta_w); - end - error = max (abs (der_ex(:) - der_fd(:))); - assert (error < 1.e-4) - -***** test %2D - crv = nrbline([1 0], [2 0]); - nrb = nrbtransp (nrbrevolve (crv, [], [0 0 1], pi/2)); - new_knots = linspace (1/9, 8/9, 8); - nrb = nrbkntins (nrb, {new_knots, new_knots}); - u = linspace (0, 1, 5); - v = u; - delta_w = .01; - n = nrb.number(1) * nrb.number(2); - der_ex = zeros (3, numel(u)* numel(v), n); - der_fd = zeros (3, numel(u)* numel(v), n); - for iw = 1:prod(nrb.number) - new_w1 = nrb.coefs (4, iw) + delta_w; - new_w2 = nrb.coefs (4, iw) - delta_w; - nrb1 = nrbmodw (nrb, new_w1, iw); - nrb2 = nrbmodw (nrb, new_w2, iw); - der_ex(:,:,iw) = nrbeval_der_w (nrb, iw, {u v}); - p2 = nrbeval (nrb2, {u v}); - p1 = nrbeval (nrb1, {u v}); - der_fd(:,:,iw) = reshape (-(p2 - p1) ./ (2*delta_w), 3, []); - end - error = max (abs (der_ex(:) - der_fd(:))); - assert (error < 1.e-5) - -***** test % 3D - crv = nrbline([1 0], [2 0]); - nrb = nrbtransp (nrbrevolve (crv, [], [0 0 1], pi/2)); - nrb = nrbextrude (nrb, [0 0 1]); - u = 0:.33:.99; - v = 0:.1:.9; - w = [.25 .5 .75]; - delta_w = .01; - n = nrb.number(1) * nrb.number(2) * nrb.number(3); - der_ex = zeros (3, numel(u)*numel(v)*numel(w), n); - der_fd = zeros (3, numel(u)*numel(v)*numel(w), n); - for iw = 1:prod(nrb.number) - new_w1 = nrb.coefs (4, iw) + delta_w; - new_w2 = nrb.coefs (4, iw) - delta_w; - nrb1 = nrbmodw (nrb, new_w1, iw); - nrb2 = nrbmodw (nrb, new_w2, iw); - der_ex(:,:,iw) = nrbeval_der_w (nrb, iw, {u v w}); - p2 = nrbeval (nrb2, {u v w}); - p1 = nrbeval (nrb1, {u v w}); - der_fd(:,:,iw) = reshape (-(p2 - p1) ./ (2*delta_w), 3, []); - end - error = max (max (squeeze (max (abs (der_ex - der_fd))))); - assert (error < 1.e-4) -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/nrbpermute.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbpermute.m -***** demo - vol = nrbrevolve (nrb4surf ([1 0], [2 0], [1 1], [2 1]), [0 0 0], [0 1 0], pi/8); - nrbplot(vol,[5 10 20]); - title('NURBS volume and the same after reordering the directions') - hold on - vol.coefs(1,:,:) = vol.coefs(1,:,:) + 2; - vol = nrbpermute(vol,[2 3 1]); - nrbplot(vol,[5 10 20]); - hold off -***** test - vol = nrbrevolve (nrb4surf ([1 0], [2 0], [1 1], [2 1]), [0 0 0], [0 1 0], pi/8); - perm1 = [1 3 2]; - perm2 = [2 1 3]; - vol2 = nrbpermute (vol, perm1); - vol3 = nrbpermute (vol, perm2); - assert (vol.number(perm1), vol2.number) - assert (vol.order(perm1), vol2.order) - assert ({vol.knots{perm1}}, vol2.knots) - assert (permute(vol.coefs, [1, perm1+1]), vol2.coefs) - assert (vol.number(perm2), vol3.number) - assert (vol.order(perm2), vol3.order) - assert ({vol.knots{perm2}}, vol3.knots) - assert (permute(vol.coefs, [1, perm2+1]), vol3.coefs) -1 test, 1 passed, 0 known failure, 0 skipped [inst/nrbderiv.m] >>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbderiv.m ***** demo @@ -4018,6 +3466,468 @@ d2Fdww(2,:,:,:) = (40.*x.*y.^2.*(x - 1).*(y - 1).*(4.*x.^2.*y.^2 - 4.*x.^2.*y - 4.*x.*y.^2 + 4.*x.*y + 5) + 40.*x.*y.^2.*z.^2.*(x - 1).*(y - 1).*(12.*x.^2.*y.^2 - 12.*x.^2.*y - 12.*x.*y.^2 + 12.*x.*y) - 40.*x.*y.^2.*z.*(x - 1).*(y - 1).*(12.*x.^2.*y.^2 - 12.*x.^2.*y - 12.*x.*y.^2 + 12.*x.*y))./(- 4.*x.^2.*y.^2.*z.^2 + 4.*x.^2.*y.^2.*z + 4.*x.^2.*y.*z.^2 - 4.*x.^2.*y.*z + 4.*x.*y.^2.*z.^2 - 4.*x.*y.^2.*z - 4.*x.*y.*z.^2 + 4.*x.*y.*z + 5).^3; d2Fdww(3,:,:,:) = (40.*x.*y.*(x - 1).*(y - 1).*(4.*x.^2.*y.^2.*z.^3 - 4.*x.^2.*y.*z.^3 - 4.*x.*y.^2.*z.^3 + 4.*x.*y.*z.^3 + 15.*z - 5))./(- 4.*x.^2.*y.^2.*z.^2 + 4.*x.^2.*y.^2.*z + 4.*x.^2.*y.*z.^2 - 4.*x.^2.*y.*z + 4.*x.*y.^2.*z.^2 - 4.*x.*y.^2.*z - 4.*x.*y.*z.^2 + 4.*x.*y.*z + 5).^3; 8 tests, 8 passed, 0 known failure, 0 skipped +[inst/nrbbasisfunder.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbbasisfunder.m +***** demo + U = [0 0 0 0 1 1 1 1]; + x = [0 1/3 2/3 1] ; + y = [0 0 0 0]; + w = [1 1 1 1]; + nrb = nrbmak ([x;y;y;w], U); + u = linspace(0, 1, 30); + [Bu, id] = nrbbasisfunder (u, nrb); + plot(u, Bu) + title('Derivatives of the cubic Bernstein polynomials') + hold off +***** test + U = [0 0 0 0 1 1 1 1]; + x = [0 1/3 2/3 1] ; + y = [0 0 0 0]; + w = rand(1,4); + nrb = nrbmak ([x;y;y;w], U); + u = linspace(0, 1, 30); + [Bu, id] = nrbbasisfunder (u, nrb); + #plot(u, Bu) + assert (sum(Bu, 2), zeros(numel(u), 1), 1e-10), +***** test + U = [0 0 0 0 1/2 1 1 1 1]; + x = [0 1/4 1/2 3/4 1] ; + y = [0 0 0 0 0]; + w = rand(1,5); + nrb = nrbmak ([x;y;y;w], U); + u = linspace(0, 1, 300); + [Bu, id] = nrbbasisfunder (u, nrb); + assert (sum(Bu, 2), zeros(numel(u), 1), 1e-10) +***** test + p = 2; q = 3; m = 4; n = 5; + Lx = 1; Ly = 1; + nrb = nrb4surf ([0 0], [1 0], [0 1], [1 1]); + nrb = nrbdegelev (nrb, [p-1, q-1]); + aux1 = linspace(0,1,m); aux2 = linspace(0,1,n); + nrb = nrbkntins (nrb, {aux1(2:end-1), aux2(2:end-1)}); + nrb.coefs (4,:,:) = nrb.coefs(4,:,:) + rand (size (nrb.coefs (4,:,:))); + [Bu, Bv, N] = nrbbasisfunder ({rand(1, 20), rand(1, 20)}, nrb); + #plot3(squeeze(u(1,:,:)), squeeze(u(2,:,:)), reshape(Bu(:,10), 20, 20),'o') + assert (sum (Bu, 2), zeros(20^2, 1), 1e-10) +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/surfderiveval.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/surfderiveval.m +***** shared srf +***** test + k = [0 0 0 1 1 1]; + c = [0 1/2 1]; + [coef(2,:,:), coef(1,:,:)] = meshgrid (c, c); + srf = nrbmak (coef, {k, k}); + skl = surfderiveval (srf.number(1)-1, ... + srf.order(1)-1, ... + srf.knots{1}, ... + srf.number(2)-1, ... + srf.order(2)-1, ... + srf.knots{2},... + squeeze(srf.coefs(1,:,:)), .5, .5, 1) ; + assert (skl, [.5 0; 1 0]) +***** test + srf = nrbkntins (srf, {[], rand(1,2)}); + skl = surfderiveval (srf.number(1)-1,... + srf.order(1)-1, ... + srf.knots{1},... + srf.number(2)-1,... + srf.order(2)-1, ... + srf.knots{2},... + squeeze(srf.coefs(1,:,:)), .5, .5, 1) ; + assert (skl, [.5 0; 1 0], 100*eps) +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/nrbsurfderiveval.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbsurfderiveval.m +***** test + k = [0 0 1 1]; + c = [0 1]; + [coef(2,:,:), coef(1,:,:)] = meshgrid (c, c); + coef(3,:,:) = coef(1,:,:); + srf = nrbmak (coef, {k, k}); + [u, v] = meshgrid (linspace(0,1,11)); + uv = [u(:)';v(:)']; + skl = nrbsurfderiveval (srf, uv, 0); + aux = nrbeval(srf,uv); + assert (squeeze (skl (1:2,1,1,:)), aux(1:2,:), 1e3*eps) +***** test + k = [0 0 1 1]; + c = [0 1]; + [coef(2,:,:), coef(1,:,:)] = meshgrid (c, c); + coef(3,:,:) = coef(1,:,:); + srf = nrbmak (coef, {k, k}); + srf = nrbkntins (srf, {[], rand(2,1)}); + [u, v] = meshgrid (linspace(0,1,11)); + uv = [u(:)';v(:)']; + skl = nrbsurfderiveval (srf, uv, 0); + aux = nrbeval(srf,uv); + assert (squeeze (skl (1:2,1,1,:)), aux(1:2,:), 1e3*eps) +***** shared srf, uv +***** test + k = [0 0 0 1 1 1]; + c = [0 1/2 1]; + [coef(1,:,:), coef(2,:,:)] = meshgrid (c, c); + coef(3,:,:) = coef(1,:,:); + srf = nrbmak (coef, {k, k}); + ders= nrbderiv (srf); + [u, v] = meshgrid (linspace(0,1,11)); + uv = [u(:)';v(:)']; + skl = nrbsurfderiveval (srf, uv, 1); + [fun, der] = nrbdeval (srf, ders, uv); + assert (squeeze (skl (1:2,1,1,:)), fun(1:2,:), 1e3*eps) + assert (squeeze (skl (1:2,2,1,:)), der{1}(1:2,:), 1e3*eps) + assert (squeeze (skl (1:2,1,2,:)), der{2}(1:2,:), 1e3*eps) + +***** test + srf = nrbdegelev (srf, [3, 1]); + ders= nrbderiv (srf); + [fun, der] = nrbdeval (srf, ders, uv); + skl = nrbsurfderiveval (srf, uv, 1); + assert (squeeze (skl (1:2,1,1,:)), fun(1:2,:), 1e3*eps) + assert (squeeze (skl (1:2,2,1,:)), der{1}(1:2,:), 1e3*eps) + assert (squeeze (skl (1:2,1,2,:)), der{2}(1:2,:), 1e3*eps) +***** shared uv +***** test + k = [0 0 0 1 1 1]; + c = [0 1/2 1]; + [coef(2,:,:), coef(1,:,:)] = meshgrid (c, c); + coef(3,:,:) = coef(1,:,:); + srf = nrbmak (coef, {k, k}); + ders= nrbderiv (srf); + [u, v] = meshgrid (linspace(0,1,11)); + uv = [u(:)';v(:)']; + skl = nrbsurfderiveval (srf, uv, 1); + [fun, der] = nrbdeval (srf, ders, uv); + assert (squeeze (skl (1:2,1,1,:)), fun(1:2,:), 1e3*eps) + assert (squeeze (skl (1:2,2,1,:)), der{1}(1:2,:), 1e3*eps) + assert (squeeze (skl (1:2,1,2,:)), der{2}(1:2,:), 1e3*eps) + +***** test + p = 3; q = 3; + mcp = 5; ncp = 5; + Lx = 10*rand(1); Ly = Lx; + srf = nrbdegelev (nrb4surf ([0 0], [Lx, 0], [0 Ly], [Lx Ly]), [p-1, q-1]); + %%srf = nrbkntins (srf, {linspace(0,1,mcp-p+2)(2:end-1), linspace(0,1,ncp-q+2)(2:end-1)}); + %%srf.coefs = permute (srf.coefs, [1 3 2]); + ders= nrbderiv (srf); + [fun, der] = nrbdeval (srf, ders, uv); + skl = nrbsurfderiveval (srf, uv, 1); + assert (squeeze (skl (1:2,1,1,:)), fun(1:2,:), 1e3*eps) + assert (squeeze (skl (1:2,2,1,:)), der{1}(1:2,:), 1e3*eps) + assert (squeeze (skl (1:2,1,2,:)), der{2}(1:2,:), 1e3*eps) +***** shared srf, uv, P, dPdx, d2Pdx2, c1, c2 +***** test + [u, v] = meshgrid (linspace(0,1,10)); + uv = [u(:)';v(:)']; + c1 = nrbmak([0 1/2 1; 0 1 0],[0 0 0 1 1 1]); + c1 = nrbtform (c1, vecrotx (pi/2)); + c2 = nrbtform(c1, vectrans([0 1 0])); + srf = nrbdegelev (nrbruled (c1, c2), [3, 1]); + skl = nrbsurfderiveval (srf, uv, 2); + P = squeeze(skl(:,1,1,:)); + dPdx = squeeze(skl(:,2,1,:)); + d2Pdx2 = squeeze(skl(:,3,1,:)); +***** assert(P(3,:), 2*(P(1,:)-P(1,:).^2),100*eps) +***** assert(dPdx(3,:), 2-4*P(1,:), 100*eps) +***** assert(d2Pdx2(3,:), -4+0*P(1,:), 100*eps) + srf = nrbdegelev (nrbruled (c1, c2), [5, 6]); + skl = nrbsurfderiveval (srf, uv, 2); + P = squeeze(skl(:,1,1,:)); + dPdx = squeeze(skl(:,2,1,:)); + d2Pdx2 = squeeze(skl(:,3,1,:)); + aux = nrbeval(srf,uv); + assert (squeeze (skl (1:2,1,1,:)), aux(1:2,:), 1e3*eps) +***** assert(P(3,:), 2*(P(1,:)-P(1,:).^2),100*eps) +***** assert(dPdx(3,:), 2-4*P(1,:), 100*eps) +***** assert(d2Pdx2(3,:), -4+0*P(1,:), 100*eps) + +***** test + skl = nrbsurfderiveval (srf, uv, 0); + aux = nrbeval (srf, uv); + assert (squeeze (skl (1:2,1,1,:)), aux(1:2,:), 1e3*eps) +***** shared dPdu, d2Pdu2, P, srf, uv +***** test + [u, v] = meshgrid (linspace(0,1,10)); + uv = [u(:)';v(:)']; + c1 = nrbmak([0 1/2 1; 0.1 1.6 1.1; 0 0 0],[0 0 0 1 1 1]); + c2 = nrbmak([0 1/2 1; 0.1 1.6 1.1; 1 1 1],[0 0 0 1 1 1]); + srf = nrbdegelev (nrbruled (c1, c2), [0, 1]); + skl = nrbsurfderiveval (srf, uv, 2); + P = squeeze(skl(:,1,1,:)); + dPdu = squeeze(skl(:,2,1,:)); + dPdv = squeeze(skl(:,1,2,:)); + d2Pdu2 = squeeze(skl(:,3,1,:)); + aux = nrbeval(srf,uv); + assert (squeeze (skl (1:2,1,1,:)), aux(1:2,:), 1e3*eps) +***** assert(dPdu(2,:), 3-4*P(1,:),100*eps) +***** assert(d2Pdu2(2,:), -4+0*P(1,:),100*eps) + +***** test + skl = nrbsurfderiveval (srf, uv, 0); + aux = nrbeval(srf,uv); + assert (squeeze (skl (1:2,1,1,:)), aux(1:2,:), 1e3*eps) +***** test + srf = nrb4surf([0 0], [1 0], [0 1], [1 1]); + geo = nrbdegelev (srf, [3 3]); + geo = nrbkntins (geo, {[.1:.1:.9], [.2:.2:.8]}); + [u, v] = meshgrid (linspace(0,1,10)); + uv = [u(:)';v(:)']; + skl = nrbsurfderiveval (geo, uv, 2); + dgeo = nrbderiv (geo); + [pnts, ders] = nrbdeval (geo, dgeo, uv); + assert (ders{1}, squeeze(skl(:,2,1,:)), 1e-9) + assert (ders{2}, squeeze(skl(:,1,2,:)), 1e-9) +***** test + crv = nrbline ([1 0], [2 0]); + srf = nrbrevolve (crv, [0 0 0], [0 0 1], pi/2); + srf = nrbtransp (srf); + [v, u] = meshgrid (linspace (0, 1, 11)); + uv = [u(:)'; v(:)']; + skl = nrbsurfderiveval (srf, uv, 2); + c = sqrt(2); + w = @(x, y) (2 - c)*y.^2 + (c-2)*y + 1; + dwdy = @(x, y) 2*(2-c)*y + c - 2; + d2wdy2 = @(x, y) 2*(2-c); + F1 = @(x, y) (x+1) .* ((1-y).^2 + c*y.*(1-y)) ./ w(x,y); + F2 = @(x, y) (x+1) .* (y.^2 + c*y.*(1-y)) ./ w(x,y); + dF1dx = @(x, y) ((1-y).^2 + c*y.*(1-y)) ./ w(x,y); + dF2dx = @(x, y) (y.^2 + c*y.*(1-y)) ./ w(x,y); + dF1dy = @(x, y) (x+1) .* ((2 - 2*c)*y + c - 2) ./ w(x,y) - (x+1) .* ((1-y).^2 + c*y.*(1-y)) .* dwdy(x,y) ./ w(x,y).^2; + dF2dy = @(x, y) (x+1) .* ((2 - 2*c)*y + c) ./ w(x,y) - (x+1) .* (y.^2 + c*y.*(1-y)) .* dwdy(x,y) ./ w(x,y).^2; + d2F1dx2 = @(x, y) zeros (size (x)); + d2F2dx2 = @(x, y) zeros (size (x)); + d2F1dxdy = @(x, y) ((2 - 2*c)*y + c - 2) ./ w(x,y) - ((1-y).^2 + c*y.*(1-y)) .* dwdy(x,y) ./ w(x,y).^2; + d2F2dxdy = @(x, y) ((2 - 2*c)*y + c) ./ w(x,y) - (y.^2 + c*y.*(1-y)) .* dwdy(x,y) ./ w(x,y).^2; + d2F1dy2 = @(x, y) (x+1)*(2 - 2*c) ./ w(x,y) - 2*(x+1) .* ((2 - 2*c)*y + c - 2) .* dwdy(x,y) ./ w(x,y).^2 - ... + (x+1) .* ((1-y).^2 + c*y.*(1-y)) * d2wdy2(x,y) ./ w(x,y).^2 + ... + 2 * (x+1) .* ((1-y).^2 + c*y.*(1-y)) .* w(x,y) .*dwdy(x,y).^2 ./ w(x,y).^4; + d2F2dy2 = @(x, y) (x+1)*(2 - 2*c) ./ w(x,y) - 2*(x+1) .* ((2 - 2*c)*y + c) .* dwdy(x,y) ./ w(x,y).^2 - ... + (x+1) .* (y.^2 + c*y.*(1-y)) * d2wdy2(x,y) ./ w(x,y).^2 + ... + 2 * (x+1) .* (y.^2 + c*y.*(1-y)) .* w(x,y) .*dwdy(x,y).^2 ./ w(x,y).^4; + assert ([F1(u(:),v(:)), F2(u(:),v(:))], squeeze(skl(1:2,1,1,:))', 1e2*eps); + assert ([dF1dx(u(:),v(:)), dF2dx(u(:),v(:))], squeeze(skl(1:2,2,1,:))', 1e2*eps); + assert ([dF1dy(u(:),v(:)), dF2dy(u(:),v(:))], squeeze(skl(1:2,1,2,:))', 1e2*eps); + assert ([d2F1dx2(u(:),v(:)), d2F2dx2(u(:),v(:))], squeeze(skl(1:2,3,1,:))', 1e2*eps); + assert ([d2F1dxdy(u(:),v(:)), d2F2dxdy(u(:),v(:))], squeeze(skl(1:2,2,2,:))', 1e2*eps); + assert ([d2F1dy2(u(:),v(:)), d2F2dy2(u(:),v(:))], squeeze(skl(1:2,1,3,:))', 1e2*eps); +***** test + knots = {[0 0 1 1] [0 0 1 1]}; + coefs(:,1,1) = [0;0;0;1]; + coefs(:,2,1) = [1;0;0;1]; + coefs(:,1,2) = [0;1;0;1]; + coefs(:,2,2) = [1;1;1;2]; + srf = nrbmak (coefs, knots); + [v, u] = meshgrid (linspace (0, 1, 3)); + uv = [u(:)'; v(:)']; + skl = nrbsurfderiveval (srf, uv, 2); + w = @(x, y) x.*y + 1; + F1 = @(x, y) x ./ w(x,y); + F2 = @(x, y) y ./ w(x,y); + F3 = @(x, y) x .* y ./ w(x,y); + dF1dx = @(x, y) 1./w(x,y) - x.*y./w(x,y).^2; + dF1dy = @(x, y) - x.^2./w(x,y).^2; + dF2dx = @(x, y) - y.^2./w(x,y).^2; + dF2dy = @(x, y) 1./w(x,y) - x.*y./w(x,y).^2; + dF3dx = @(x, y) y./w(x,y) - x.*(y./w(x,y)).^2; + dF3dy = @(x, y) x./w(x,y) - y.*(x./w(x,y)).^2; + d2F1dx2 = @(x, y) -2*y./w(x,y).^2 + 2*x.*y.^2./w(x,y).^3; + d2F1dy2 = @(x, y) 2*x.^3./w(x,y).^3; + d2F1dxdy = @(x, y) -x./w(x,y).^2 - x./w(x,y).^2 + 2*x.^2.*y./w(x,y).^3; + d2F2dx2 = @(x, y) 2*y.^3./w(x,y).^3; + d2F2dy2 = @(x, y) -2*x./w(x,y).^2 + 2*y.*x.^2./w(x,y).^3; + d2F2dxdy = @(x, y) -y./w(x,y).^2 - y./w(x,y).^2 + 2*y.^2.*x./w(x,y).^3; + d2F3dx2 = @(x, y) -2*y.^2./w(x,y).^2 + 2*x.*y.^3./w(x,y).^3; + d2F3dy2 = @(x, y) -2*x.^2./w(x,y).^2 + 2*y.*x.^3./w(x,y).^3; + d2F3dxdy = @(x, y) 1./w(x,y) - 3*x.*y./w(x,y).^2 + 2*(x.*y).^2./w(x,y).^3; + assert ([F1(u(:),v(:)), F2(u(:),v(:)), F3(u(:),v(:))], squeeze(skl(1:3,1,1,:))', 1e2*eps); + assert ([dF1dx(u(:),v(:)), dF2dx(u(:),v(:)), dF3dx(u(:),v(:))], squeeze(skl(1:3,2,1,:))', 1e2*eps); + assert ([dF1dy(u(:),v(:)), dF2dy(u(:),v(:)), dF3dy(u(:),v(:))], squeeze(skl(1:3,1,2,:))', 1e2*eps); + assert ([d2F1dx2(u(:),v(:)), d2F2dx2(u(:),v(:)), d2F3dx2(u(:),v(:))], squeeze(skl(1:3,3,1,:))', 1e2*eps); + assert ([d2F1dy2(u(:),v(:)), d2F2dy2(u(:),v(:)), d2F3dy2(u(:),v(:))], squeeze(skl(1:3,1,3,:))', 1e2*eps); + assert ([d2F1dxdy(u(:),v(:)), d2F2dxdy(u(:),v(:)), d2F3dxdy(u(:),v(:))], squeeze(skl(1:3,2,2,:))', 1e2*eps); +21 tests, 21 passed, 0 known failure, 0 skipped +[inst/nrbpermute.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbpermute.m +***** demo + vol = nrbrevolve (nrb4surf ([1 0], [2 0], [1 1], [2 1]), [0 0 0], [0 1 0], pi/8); + nrbplot(vol,[5 10 20]); + title('NURBS volume and the same after reordering the directions') + hold on + vol.coefs(1,:,:) = vol.coefs(1,:,:) + 2; + vol = nrbpermute(vol,[2 3 1]); + nrbplot(vol,[5 10 20]); + hold off +***** test + vol = nrbrevolve (nrb4surf ([1 0], [2 0], [1 1], [2 1]), [0 0 0], [0 1 0], pi/8); + perm1 = [1 3 2]; + perm2 = [2 1 3]; + vol2 = nrbpermute (vol, perm1); + vol3 = nrbpermute (vol, perm2); + assert (vol.number(perm1), vol2.number) + assert (vol.order(perm1), vol2.order) + assert ({vol.knots{perm1}}, vol2.knots) + assert (permute(vol.coefs, [1, perm1+1]), vol2.coefs) + assert (vol.number(perm2), vol3.number) + assert (vol.order(perm2), vol3.order) + assert ({vol.knots{perm2}}, vol3.knots) + assert (permute(vol.coefs, [1, perm2+1]), vol3.coefs) +1 test, 1 passed, 0 known failure, 0 skipped +[inst/tbasisfun.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/tbasisfun.m +***** demo + U = {[0 0 1/2 1 1], [0 0 0 1 1]}; + p = [3, 3]; + [X, Y] = meshgrid (linspace(0, 1, 30)); + u = [X(:), Y(:)]'; + N = tbasisfun (u, p, U); + surf (X, Y, reshape (N, size(X))) + title('Basis function associated to a local knot vector') + hold off +***** test + U = [0 1/2 1]; + p = 1; + u = [0.3 0.4 0.6 0.7]; + [N, Nder] = tbasisfun (u, p, U); + assert (N, [0.6 0.8 0.8 0.6], 1e-12); + assert (Nder, [2 2 -2 -2], 1e-12); +***** test + U = {[0 1/2 1] [0 1/2 1]}; + p = [1 1]; + u = [0.3 0.4 0.6 0.7; 0.3 0.4 0.6 0.7]; + [N, Nder] = tbasisfun (u, p, U); + assert (N, [0.36 0.64 0.64 0.36], 1e-12); + assert (Nder, [1.2 1.6 -1.6 -1.2; 1.2 1.6 -1.6 -1.2], 1e-12); +***** test + U = {[0 1/2 1] [0 1/2 1] [0 1/2 1]}; + p = [1 1 1]; + u = [0.4 0.4 0.6 0.6; 0.4 0.4 0.6 0.6; 0.4 0.6 0.4 0.6]; + [N, Nder] = tbasisfun (u, p, U); + assert (N, [0.512 0.512 0.512 0.512], 1e-12); + assert (Nder, [1.28 1.28 -1.28 -1.28; 1.28 1.28 -1.28 -1.28; 1.28 -1.28 1.28 -1.28], 1e-12); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/kntbrkdegreg.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/kntbrkdegreg.m +***** test + breaks = [0 1 2 3 4]; + degree = 3; + knots = kntbrkdegreg (breaks, degree); + assert (knots, [0 0 0 0 1 2 3 4 4 4 4]) +***** test + breaks = [0 1 2 3 4]; + degree = 3; + reg = 1; + knots = kntbrkdegreg (breaks, degree, reg); + assert (knots, [0 0 0 0 1 1 2 2 3 3 4 4 4 4]) +***** test + breaks = [0 1 2 3 4]; + degree = 3; + reg = [0 1 2]; + knots = kntbrkdegreg (breaks, degree, reg); + assert (knots, [0 0 0 0 1 1 1 2 2 3 4 4 4 4]) +***** test + breaks = {[0 1 2 3 4] [0 1 2 3]}; + degree = [3 2]; + reg = {[0 1 2] 0}; + knots = kntbrkdegreg (breaks, degree, reg); + assert (knots, {[0 0 0 0 1 1 1 2 2 3 4 4 4 4] [0 0 0 1 1 2 2 3 3 3]}) +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/nrbnumbasisfun.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbnumbasisfun.m +***** test + p = 2; q = 3; m = 4; n = 5; + Lx = 1; Ly = 1; + nrb = nrb4surf ([0 0], [1 0], [0 1], [1 1]); + nrb = nrbdegelev (nrb, [p-1, q-1]); + ikx = linspace(0,1,m); iky = linspace(0,1,n); + nrb = nrbkntins (nrb, {ikx(2:end-1), iky(2:end-1)}); + nrb.coefs (4,:,:) = nrb.coefs (4,:,:) + rand (size (nrb.coefs (4,:,:))); + u = rand (1, 30); v = rand (1, 10); + u = (u-min (u))/max (u-min (u)); + v = (v-min (v))/max (v-min (v)); + N = nrbnumbasisfun ({u, v}, nrb); + assert (all (all (N>0)), true) + assert (all (all (N <= prod (nrb.number))), true) + assert (max (max (N)), prod (nrb.number)) + assert (min (min (N)), 1) +1 test, 1 passed, 0 known failure, 0 skipped +[inst/nrbcrvderiveval.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbcrvderiveval.m +***** test + knots = [0 0 0 1 1 1]; + coefs(:,1) = [0; 0; 0; 1]; + coefs(:,2) = [1; 0; 1; 1]; + coefs(:,3) = [1; 1; 1; 2]; + crv = nrbmak (coefs, knots); + u = linspace (0, 1, 100); + ck = nrbcrvderiveval (crv, u, 2); + w = @(x) 1 + x.^2; + dw = @(x) 2*x; + F1 = @(x) (2*x - x.^2)./w(x); + F2 = @(x) x.^2./w(x); + F3 = @(x) (2*x - x.^2)./w(x); + dF1 = @(x) (2 - 2*x)./w(x) - 2*(2*x - x.^2).*x./w(x).^2; + dF2 = @(x) 2*x./w(x) - 2*x.^3./w(x).^2; + dF3 = @(x) (2 - 2*x)./w(x) - 2*(2*x - x.^2).*x./w(x).^2; + d2F1 = @(x) -2./w(x) - 2*x.*(2-2*x)./w(x).^2 - (8*x-6*x.^2)./w(x).^2 + 8*x.^2.*(2*x-x.^2)./w(x).^3; + d2F2 = @(x) 2./w(x) - 4*x.^2./w(x).^2 - 6*x.^2./w(x).^2 + 8*x.^4./w(x).^3; + d2F3 = @(x) -2./w(x) - 2*x.*(2-2*x)./w(x).^2 - (8*x-6*x.^2)./w(x).^2 + 8*x.^2.*(2*x-x.^2)./w(x).^3; + assert ([F1(u); F2(u); F3(u)], squeeze(ck(:, 1, :)), 1e2*eps); + assert ([dF1(u); dF2(u); dF3(u)], squeeze(ck(:, 2, :)), 1e2*eps); + assert ([d2F1(u); d2F2(u); d2F3(u)], squeeze(ck(:, 3, :)), 1e2*eps); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/kntbrkdegmult.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/kntbrkdegmult.m +***** test + breaks = [0 1 2 3 4]; + degree = 3; + knots = kntbrkdegmult (breaks, degree); + assert (knots, [0 0 0 0 1 2 3 4 4 4 4]) +***** test + breaks = [0 1 2 3 4]; + degree = 3; + mult = 2; + knots = kntbrkdegmult (breaks, degree, mult); + assert (knots, [0 0 0 0 1 1 2 2 3 3 4 4 4 4]) +***** test + breaks = [0 1 2 3 4]; + degree = 3; + mult = [1 2 3]; + knots = kntbrkdegmult (breaks, degree, mult); + assert (knots, [0 0 0 0 1 2 2 3 3 3 4 4 4 4]) +***** test + breaks = {[0 1 2 3 4] [0 1 2 3]}; + degree = [3 2]; + mult = {[1 2 3] 2}; + knots = kntbrkdegmult (breaks, degree, mult); + assert (knots, {[0 0 0 0 1 2 2 3 3 3 4 4 4 4] [0 0 0 1 1 2 2 3 3 3]}) +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/nrbtransp.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbtransp.m +***** demo + srf = nrb4surf([0 0 0], [1 0 1], [0 1 1], [1 1 2]); + nrbplot(srf,[20 5]); + title('Plane surface and its transposed (translated)') + hold on + srf.coefs(3,:,:) = srf.coefs(3,:,:) + 10; + srf = nrbtransp(srf); + nrbplot(srf,[20 5]); + hold off +***** test + srf = nrbrevolve(nrbline([1 0],[2 0]), [0 0 0], [0 0 1], pi/2); + srft = nrbtransp(srf); + assert (srf.number, fliplr(srft.number)); + assert (srf.order, fliplr(srft.order)); + assert (srf.knots, fliplr(srft.knots)); + assert (srf.coefs, permute(srft.coefs, [1 3 2])); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/curvederivcpts.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/curvederivcpts.m +***** test + line = nrbmak([0.0 1.5; 0.0 3.0],[0.0 0.0 1.0 1.0]); + pk = curvederivcpts (line.number-1, line.order-1, line.knots,... + line.coefs(1,:), 2); + assert (pk, [0 3/2; 3/2 0], 100*eps); +1 test, 1 passed, 0 known failure, 0 skipped [inst/kntrefine.m] >>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/kntrefine.m ***** shared nrbs @@ -4059,6 +3969,217 @@ rknots = kntrefine (knots, 1, 4, 3); assert (rknots, [0 0 0 0 0 0.2 0.4 0.4 0.45 0.5 0.5 0.5 0.55 0.6 0.6 0.6 0.6 0.8 1 1 1 1 1]); 6 tests, 6 passed, 0 known failure, 0 skipped +[inst/basisfunder.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/basisfunder.m +***** test + k = [0 0 0 0 1 1 1 1]; + p = 3; + u = rand (1); + i = findspan (numel(k)-p-2, p, u, k); + ders = basisfunder (i, p, u, k, 1); + sumders = sum (squeeze(ders), 2); + assert (sumders(1), 1, 1e-15); + assert (sumders(2:end), 0, 1e-15); +***** test + k = [0 0 0 0 1/3 2/3 1 1 1 1]; + p = 3; + u = rand (1); + i = findspan (numel(k)-p-2, p, u, k); + ders = basisfunder (i, p, u, k, 7); + sumders = sum (squeeze(ders), 2); + assert (sumders(1), 1, 1e-15); + assert (sumders(2:end), zeros(rows(squeeze(ders))-1, 1), 1e-13); +***** test + k = [0 0 0 0 1/3 2/3 1 1 1 1]; + p = 3; + u = rand (100, 1); + i = findspan (numel(k)-p-2, p, u, k); + ders = basisfunder (i, p, u, k, 7); + for ii=1:10 + sumders = sum (squeeze(ders(ii,:,:)), 2); + assert (sumders(1), 1, 1e-15); + assert (sumders(2:end), zeros(rows(squeeze(ders(ii,:,:)))-1, 1), 1e-13); + end + assert (ders(:, (p+2):end, :), zeros(numel(u), 8-p-1, p+1), 1e-13) + assert (all(all(ders(:, 1, :) <= 1)), true) +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/nrbeval_der_p.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbeval_der_p.m +***** test %% 1D + nrb = nrbkntins (nrbcirc (1, [0 0], 0, pi/2), .5); + u = 0:.1:.9; + index = 1:nrb.number; + e = zeros (numel (u), numel (index), 1); + for jj = 1:numel (index) + deltap = .1 * rand (3, 1); + nrb2 = nrbmodp (nrb, deltap, index(jj)); + der_ex = nrbeval_der_p (nrb, index(jj), u); + p2 = nrbeval (nrb2, u); + p1 = nrbeval (nrb, u); + der_fd = (p2 - p1) ./ deltap; + e(:,jj) = sqrt (sum ((repmat (der_ex, 3, 1) - der_fd).^2, 1)); + end + assert (max(e(:)) < 1.e-8); + +***** test %% 2D + crv = nrbline([1 0], [2 0]); + nrb = nrbtransp (nrbrevolve (crv, [], [0 0 1], pi/2)); + new_knots = linspace (1/9, 8/9, 8); + nrb = nrbkntins (nrb, {new_knots, new_knots}); + u = 0:.1:.9; + v = u; + e = zeros (nrb.number(1) * nrb.number(2), numel (u), numel (v)); + for index = 1:prod(nrb.number) + deltap = .1 * rand (3, 1); + nrb2 = nrbmodp (nrb, deltap, index); + der_ex = nrbeval_der_p (nrb, index, {u v}); + p2 = nrbeval (nrb2, {u v}); + p1 = nrbeval (nrb, {u v}); + der_fd = (p2 - p1) ./ deltap; + der_ex = reshape (repmat (der_ex, 3, 1), size(der_fd)); + e(index,:,:) = sqrt (sum ((der_ex - der_fd).^2, 1)); + end + assert (max(e(:)) < 1.e-8) + +***** test %% 3D + crv = nrbline([1 0], [2 0]); + nrb = nrbtransp (nrbrevolve (crv, [], [0 0 1], pi/2)); + nrb = nrbextrude (nrb, [0 0 1]); + u = 0:.1:.9; + v = u; + w = u; + e = zeros (nrb.number(1) * nrb.number(2) * nrb.number(3), numel(u), numel(v), numel(w)); + for index = 1:prod(nrb.number) + deltap = .1 * rand (3, 1); + nrb2 = nrbmodp (nrb, deltap, index); + der_ex = nrbeval_der_p (nrb, index, {u v w}); + p2 = nrbeval (nrb2, {u v w}); + p1 = nrbeval (nrb, {u v w}); + der_fd = (p2 - p1) ./ deltap; + der_ex = reshape (repmat (der_ex, 3, 1), size (der_fd)); + e(index,:,:,:) = sqrt (sum ((der_ex - der_fd).^2, 1)); + end + assert (max (e(:)) < 1.e-8); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/nrbeval_der_w.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbeval_der_w.m +***** test % 1D + nrb = nrbkntins (nrbcirc (1, [0 0], 0, pi/2), .5); + u = linspace (0, 1, 11); + delta_w = .01; + n = nrb.number; + der_ex = zeros (3, numel (u), n); + der_fd = zeros (3, numel (u), n); + for iw = 1:n + new_w1 = nrb.coefs (4, iw) + delta_w; + new_w2 = nrb.coefs (4, iw) - delta_w; + nrb1 = nrbmodw (nrb, new_w1, iw); + nrb2 = nrbmodw (nrb, new_w2, iw); + der_ex(:,:,iw) = nrbeval_der_w (nrb, iw, u); + p2 = nrbeval (nrb2, u); + p1 = nrbeval (nrb1, u); + der_fd(:,:,iw) = -(p2 - p1) ./ (2*delta_w); + end + error = max (abs (der_ex(:) - der_fd(:))); + assert (error < 1.e-4) + +***** test %2D + crv = nrbline([1 0], [2 0]); + nrb = nrbtransp (nrbrevolve (crv, [], [0 0 1], pi/2)); + new_knots = linspace (1/9, 8/9, 8); + nrb = nrbkntins (nrb, {new_knots, new_knots}); + u = linspace (0, 1, 5); + v = u; + delta_w = .01; + n = nrb.number(1) * nrb.number(2); + der_ex = zeros (3, numel(u)* numel(v), n); + der_fd = zeros (3, numel(u)* numel(v), n); + for iw = 1:prod(nrb.number) + new_w1 = nrb.coefs (4, iw) + delta_w; + new_w2 = nrb.coefs (4, iw) - delta_w; + nrb1 = nrbmodw (nrb, new_w1, iw); + nrb2 = nrbmodw (nrb, new_w2, iw); + der_ex(:,:,iw) = nrbeval_der_w (nrb, iw, {u v}); + p2 = nrbeval (nrb2, {u v}); + p1 = nrbeval (nrb1, {u v}); + der_fd(:,:,iw) = reshape (-(p2 - p1) ./ (2*delta_w), 3, []); + end + error = max (abs (der_ex(:) - der_fd(:))); + assert (error < 1.e-5) + +***** test % 3D + crv = nrbline([1 0], [2 0]); + nrb = nrbtransp (nrbrevolve (crv, [], [0 0 1], pi/2)); + nrb = nrbextrude (nrb, [0 0 1]); + u = 0:.33:.99; + v = 0:.1:.9; + w = [.25 .5 .75]; + delta_w = .01; + n = nrb.number(1) * nrb.number(2) * nrb.number(3); + der_ex = zeros (3, numel(u)*numel(v)*numel(w), n); + der_fd = zeros (3, numel(u)*numel(v)*numel(w), n); + for iw = 1:prod(nrb.number) + new_w1 = nrb.coefs (4, iw) + delta_w; + new_w2 = nrb.coefs (4, iw) - delta_w; + nrb1 = nrbmodw (nrb, new_w1, iw); + nrb2 = nrbmodw (nrb, new_w2, iw); + der_ex(:,:,iw) = nrbeval_der_w (nrb, iw, {u v w}); + p2 = nrbeval (nrb2, {u v w}); + p1 = nrbeval (nrb1, {u v w}); + der_fd(:,:,iw) = reshape (-(p2 - p1) ./ (2*delta_w), 3, []); + end + error = max (max (squeeze (max (abs (der_ex - der_fd))))); + assert (error < 1.e-4) +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/surfderivcpts.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/surfderivcpts.m +***** test + coefs = cat(3,[0 0; 0 1],[1 1; 0 1]); + knots = {[0 0 1 1] [0 0 1 1]}; + plane = nrbmak(coefs,knots); + pkl = surfderivcpts (plane.number(1)-1, plane.order(1)-1,... + plane.knots{1}, plane.number(2)-1,... + plane.order(2)-1, plane.knots{2}, ... + squeeze (plane.coefs(1,:,:)), 1); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/numbasisfun.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/numbasisfun.m +***** test + n = 3; + U = [0 0 0 1/2 1 1 1]; + p = 2; + u = linspace (0, 1, 10); + s = findspan (n, p, u, U); + Bref = [0 0 0 0 0 1 1 1 1 1; ... + 1 1 1 1 1 2 2 2 2 2; ... + 2 2 2 2 2 3 3 3 3 3].'; + B = numbasisfun (s, u, p, U); + assert (B, Bref) +1 test, 1 passed, 0 known failure, 0 skipped +[inst/nrbmeasure.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbmeasure.m +***** test + c = nrbcirc (1, [0 0], 0, pi/3); + l = nrbmeasure(c, 0, 1, 1e-7); + assert (l, pi/3, 1e-7) +***** test + c = nrbcirc (1, [0 0], 0, pi/2); + s = zeros (1, 100); e = linspace (0, 1, 100); + for ii = 1:100 + l(ii) = nrbmeasure (c, s(ii), e(ii), 1e-7); + endfor + xx = nrbeval (c, e); + theta = atan2 (xx(2,:), xx(1,:)); + assert (l, theta, 1e-7) +***** test + c = nrbcirc (1, [0 0], 0, pi/2); + s = 0; e = linspace (0, 1, 100); + for ii = 1:100 + l(ii) = nrbmeasure (c, s, e(ii), 1e-7); + endfor + l2 = nrbmeasure (c, s, e, 1e-7); + assert (l, l2, eps) +3 tests, 3 passed, 0 known failure, 0 skipped [inst/nrbclamp.m] >>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbclamp.m ***** test @@ -4087,48 +4208,104 @@ assert(srf1.knots, {[-2.75 -2 -1.75 -1 -0.75 0 0.25 1 1.25 2 2.25 3 3.25] [0 0 0 0 1 1 1 1]}) assert (nrbeval(srf, {xx xx}), nrbeval(srf1, {xx xx}), 1e-14); 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/kntbrkdegreg.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/kntbrkdegreg.m -***** test - breaks = [0 1 2 3 4]; - degree = 3; - knots = kntbrkdegreg (breaks, degree); - assert (knots, [0 0 0 0 1 2 3 4 4 4 4]) -***** test - breaks = [0 1 2 3 4]; - degree = 3; - reg = 1; - knots = kntbrkdegreg (breaks, degree, reg); - assert (knots, [0 0 0 0 1 1 2 2 3 3 4 4 4 4]) +[inst/nrbreverse.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbreverse.m +***** demo + pnts = [0.5 1.5 3.0 7.5 8.5; + 3.0 5.5 1.5 4.0 4.5; + 0.0 0.0 0.0 0.0 0.0]; + crv1 = nrbmak(pnts,[0 0 0 1/2 3/4 1 1 1]); + crv2 = nrbreverse(crv1); + fprintf('Knots of the original curve\n') + disp(crv1.knots) + fprintf('Knots of the reversed curve\n') + disp(crv2.knots) + fprintf('Control points of the original curve\n') + disp(crv1.coefs(1:2,:)) + fprintf('Control points of the reversed curve\n') + disp(crv2.coefs(1:2,:)) + nrbplot(crv1,100) + hold on + nrbplot(crv2,100) + title('The curve and its reverse are the same') + hold off ***** test - breaks = [0 1 2 3 4]; - degree = 3; - reg = [0 1 2]; - knots = kntbrkdegreg (breaks, degree, reg); - assert (knots, [0 0 0 0 1 1 1 2 2 3 4 4 4 4]) + srf = nrbrevolve(nrbline([1 0],[2 0]), [0 0 0], [0 0 1], pi/2); + srf = nrbkntins (srf, {0.3, 0.6}); + srf2 = nrbreverse (srf); + assert (srf.knots, cellfun(@(x) sort(1-x), srf2.knots, 'UniformOutput', false), 1e-15) + assert (srf.coefs, srf2.coefs(:,end:-1:1,end:-1:1)) ***** test - breaks = {[0 1 2 3 4] [0 1 2 3]}; - degree = [3 2]; - reg = {[0 1 2] 0}; - knots = kntbrkdegreg (breaks, degree, reg); - assert (knots, {[0 0 0 0 1 1 1 2 2 3 4 4 4 4] [0 0 0 1 1 2 2 3 3 3]}) -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/nrbinverse.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbinverse.m + srf = nrbrevolve(nrbline([1 0],[2 0]), [0 0 0], [0 0 1], pi/2); + srf = nrbkntins (srf, {0.3, 0.6}); + srf2 = nrbreverse (srf, 1); + knt{1} = sort(1-srf2.knots{1}); knt{2} = srf2.knots{2}; + assert (srf.knots, knt, 1e-15) + assert (srf.coefs, srf2.coefs(:,end:-1:1,:)) + srf2 = nrbreverse (srf, 2); + knt{1} = srf2.knots{1}; knt{2} = sort(1-srf2.knots{2}); + assert (srf.knots, knt, 1e-15) + assert (srf.coefs, srf2.coefs(:,:,end:-1:1)) +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/aveknt.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/aveknt.m ***** test - nrb = nrb4surf ([0 0], [1 0], [2 3], [5 4]); - p = nrbeval (nrb, {.25 .75}); - u = nrbinverse (nrb, p, 'Display', false); - assert (norm (u - [.25; .75]) < 1e-8); + knt = [0 0 0 0.5 1 1 1]; + pts = aveknt (knt, 3); + assert (pts - [0 1/4 3/4 1] < 1e-14) ***** test - nrb = nrb4surf ([0 0], [1 0], [2 3], [5 4]); - nrb = nrbdegelev (nrbextrude (nrb, [0 2 1]), [3 3 3]); - p = nrbeval (nrb, {.25 .75 .05}); - u = nrbinverse (nrb, p, 'Display', false, 'TolX', 1e-12, 'TolFun', 1e-10); - assert (norm (u - [.25; .75; .05]) < 1e-8); + knt = {[0 0 0 0.5 1 1 1] [0 0 0 0 1/3 2/3 1 1 1 1]}; + pts = aveknt (knt, [3 4]); + assert (pts{1} - [0 1/4 3/4 1] < 1e-14); + assert (pts{2} - [0 1/9 1/3 2/3 8/9 1] < 1e-14); +***** test + nrb = nrb4surf([0 0], [1 0], [0 1], [1 1]); + nrb = nrbkntins (nrbdegelev (nrb, [1 2]), {[1/2] [1/3 2/3]}); + pts = aveknt (nrb); + assert (pts{1} - [0 1/4 3/4 1] < 1e-14); + assert (pts{2} - [0 1/9 1/3 2/3 8/9 1] < 1e-14); +3 tests, 3 passed, 0 known failure, 0 skipped +[inst/crvkntremove.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/crvkntremove.m +***** test + crv = nrbdegelev (nrbline (), 3); + acrv = nrbkntins (crv, [.11 .11 .11]); + [rcrv, t] = crvkntremove (acrv, .11, 8, 3, 3, 1e-10); + assert (crv.knots, rcrv.knots, 1e-10); + assert (t, 3); +***** test + crv = nrbcirc (); + acrv = nrbkntins (crv, [.3 .3]); + [rcrv, t] = crvkntremove (acrv, .3, 7, 2, 2, 1e-10); + assert (crv.knots, rcrv.knots, 1e-10); + assert (t, 2); 2 tests, 2 passed, 0 known failure, 0 skipped +[inst/nrbunclamp.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbunclamp.m +***** demo + crv = nrbcirc (1,[],0,2*pi/3); + crv = nrbdegelev (crv, 2); + figure + nrbctrlplot (crv); hold on + nrbctrlplot (nrbtform (nrbunclamp (crv, 1), vectrans([-0.4, -0.4]))); + nrbctrlplot (nrbtform (nrbunclamp (crv, 2), vectrans([-0.8, -0.8]))); + nrbctrlplot (nrbtform (nrbunclamp (crv, 3), vectrans([-1.6, -1.6]))); + title ('Original curve and unclamped versions') +***** test + crv = nrbdegelev (nrbtestcrv,2); + x = linspace (0, 1, 100); + F = nrbeval (crv, x); + ucrv = nrbunclamp (crv, 0); + assert (F, nrbeval(ucrv, x)); + ucrv = nrbunclamp (crv, 1); + assert (F, nrbeval(ucrv, x), 1e-14); + ucrv = nrbunclamp (crv, 2); + assert (F, nrbeval(ucrv, x), 1e-14); + ucrv = nrbunclamp (crv, 3); + assert (F, nrbeval(ucrv, x), 1e-14); +1 test, 1 passed, 0 known failure, 0 skipped [inst/nrbdeval.m] >>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbdeval.m ***** demo @@ -4216,97 +4393,8 @@ assert(jac{1}(2,:,:),2*x',1e-12) assert(jac{3}(3,:,:),ones(size(z')),1e-12) 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/nrbeval_der_p.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbeval_der_p.m -***** test %% 1D - nrb = nrbkntins (nrbcirc (1, [0 0], 0, pi/2), .5); - u = 0:.1:.9; - index = 1:nrb.number; - e = zeros (numel (u), numel (index), 1); - for jj = 1:numel (index) - deltap = .1 * rand (3, 1); - nrb2 = nrbmodp (nrb, deltap, index(jj)); - der_ex = nrbeval_der_p (nrb, index(jj), u); - p2 = nrbeval (nrb2, u); - p1 = nrbeval (nrb, u); - der_fd = (p2 - p1) ./ deltap; - e(:,jj) = sqrt (sum ((repmat (der_ex, 3, 1) - der_fd).^2, 1)); - end - assert (max(e(:)) < 1.e-8); - -***** test %% 2D - crv = nrbline([1 0], [2 0]); - nrb = nrbtransp (nrbrevolve (crv, [], [0 0 1], pi/2)); - new_knots = linspace (1/9, 8/9, 8); - nrb = nrbkntins (nrb, {new_knots, new_knots}); - u = 0:.1:.9; - v = u; - e = zeros (nrb.number(1) * nrb.number(2), numel (u), numel (v)); - for index = 1:prod(nrb.number) - deltap = .1 * rand (3, 1); - nrb2 = nrbmodp (nrb, deltap, index); - der_ex = nrbeval_der_p (nrb, index, {u v}); - p2 = nrbeval (nrb2, {u v}); - p1 = nrbeval (nrb, {u v}); - der_fd = (p2 - p1) ./ deltap; - der_ex = reshape (repmat (der_ex, 3, 1), size(der_fd)); - e(index,:,:) = sqrt (sum ((der_ex - der_fd).^2, 1)); - end - assert (max(e(:)) < 1.e-8) - -***** test %% 3D - crv = nrbline([1 0], [2 0]); - nrb = nrbtransp (nrbrevolve (crv, [], [0 0 1], pi/2)); - nrb = nrbextrude (nrb, [0 0 1]); - u = 0:.1:.9; - v = u; - w = u; - e = zeros (nrb.number(1) * nrb.number(2) * nrb.number(3), numel(u), numel(v), numel(w)); - for index = 1:prod(nrb.number) - deltap = .1 * rand (3, 1); - nrb2 = nrbmodp (nrb, deltap, index); - der_ex = nrbeval_der_p (nrb, index, {u v w}); - p2 = nrbeval (nrb2, {u v w}); - p1 = nrbeval (nrb, {u v w}); - der_fd = (p2 - p1) ./ deltap; - der_ex = reshape (repmat (der_ex, 3, 1), size (der_fd)); - e(index,:,:,:) = sqrt (sum ((der_ex - der_fd).^2, 1)); - end - assert (max (e(:)) < 1.e-8); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/curvederiveval.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/curvederiveval.m -***** test - k = [0 0 0 1 1 1]; - coefs(:,1) = [0;0;0;1]; - coefs(:,2) = [1;0;1;1]; - coefs(:,3) = [1;1;1;1]; - crv = nrbmak (coefs, k); - ck = curvederiveval (crv.number-1, crv.order-1, crv.knots, squeeze (crv.coefs(1,:,:)), 0.5, 2); - assert(ck, [0.75; 1; -2]); - ck = curvederiveval (crv.number-1, crv.order-1, crv.knots, squeeze (crv.coefs(2,:,:)), 0.5, 2); - assert(ck, [0.25; 1; 2]); - ck = curvederiveval (crv.number-1, crv.order-1, crv.knots, squeeze (crv.coefs(3,:,:)), 0.5, 2); - assert(ck, [0.75; 1; -2]); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/findspan.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/findspan.m -***** test - n = 3; - U = [0 0 0 1/2 1 1 1]; - p = 2; - u = linspace(0, 1, 10); - s = findspan (n, p, u, U); - assert (s, [2*ones(1, 5) 3*ones(1, 5)]); -***** test - p = 2; m = 7; n = m - p - 1; - U = [zeros(1,p) linspace(0,1,m+1-2*p) ones(1,p)]; - u = [ 0 0.11880 0.55118 0.93141 0.40068 0.35492 0.44392 0.88360 0.35414 0.92186 0.83085 1]; - s = [2 2 3 4 3 3 3 4 3 4 4 4]; - assert (findspan (n, p, u, U), s, 1e-10); -2 tests, 2 passed, 0 known failure, 0 skipped -[inst/nrbbasisfunder.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbbasisfunder.m +[inst/nrbbasisfun.m] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbbasisfun.m ***** demo U = [0 0 0 0 1 1 1 1]; x = [0 1/3 2/3 1] ; @@ -4314,9 +4402,10 @@ w = [1 1 1 1]; nrb = nrbmak ([x;y;y;w], U); u = linspace(0, 1, 30); - [Bu, id] = nrbbasisfunder (u, nrb); - plot(u, Bu) - title('Derivatives of the cubic Bernstein polynomials') + B = nrbbasisfun (u, nrb); + xplot = sum(bsxfun(@(x,y) x.*y, B, x),2); + plot(xplot, B) + title('Cubic Bernstein polynomials') hold off ***** test U = [0 0 0 0 1 1 1 1]; @@ -4325,18 +4414,32 @@ w = rand(1,4); nrb = nrbmak ([x;y;y;w], U); u = linspace(0, 1, 30); - [Bu, id] = nrbbasisfunder (u, nrb); - #plot(u, Bu) - assert (sum(Bu, 2), zeros(numel(u), 1), 1e-10), -***** test - U = [0 0 0 0 1/2 1 1 1 1]; - x = [0 1/4 1/2 3/4 1] ; - y = [0 0 0 0 0]; - w = rand(1,5); - nrb = nrbmak ([x;y;y;w], U); - u = linspace(0, 1, 300); - [Bu, id] = nrbbasisfunder (u, nrb); - assert (sum(Bu, 2), zeros(numel(u), 1), 1e-10) + B = nrbbasisfun (u, nrb); + xplot = sum(bsxfun(@(x,y) x.*y, B, x),2); + + yy = y; yy(1) = 1; + nrb2 = nrbmak ([x.*w;yy;y;w], U); + aux = nrbeval(nrb2,u); + %figure, plot(xplot, B(:,1), aux(1,:).', w(1)*aux(2,:).') + assert(B(:,1), w(1)*aux(2,:).', 1e-6) + + yy = y; yy(2) = 1; + nrb2 = nrbmak ([x.*w;yy;y;w], U); + aux = nrbeval(nrb2, u); + %figure, plot(xplot, B(:,2), aux(1,:).', w(2)*aux(2,:).') + assert(B(:,2), w(2)*aux(2,:).', 1e-6) + + yy = y; yy(3) = 1; + nrb2 = nrbmak ([x.*w;yy;y;w], U); + aux = nrbeval(nrb2,u); + %figure, plot(xplot, B(:,3), aux(1,:).', w(3)*aux(2,:).') + assert(B(:,3), w(3)*aux(2,:).', 1e-6) + + yy = y; yy(4) = 1; + nrb2 = nrbmak ([x.*w;yy;y;w], U); + aux = nrbeval(nrb2,u); + %figure, plot(xplot, B(:,4), aux(1,:).', w(4)*aux(2,:).') + assert(B(:,4), w(4)*aux(2,:).', 1e-6) ***** test p = 2; q = 3; m = 4; n = 5; Lx = 1; Ly = 1; @@ -4344,160 +4447,42 @@ nrb = nrbdegelev (nrb, [p-1, q-1]); aux1 = linspace(0,1,m); aux2 = linspace(0,1,n); nrb = nrbkntins (nrb, {aux1(2:end-1), aux2(2:end-1)}); - nrb.coefs (4,:,:) = nrb.coefs(4,:,:) + rand (size (nrb.coefs (4,:,:))); - [Bu, Bv, N] = nrbbasisfunder ({rand(1, 20), rand(1, 20)}, nrb); - #plot3(squeeze(u(1,:,:)), squeeze(u(2,:,:)), reshape(Bu(:,10), 20, 20),'o') - assert (sum (Bu, 2), zeros(20^2, 1), 1e-10) -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/nrbunclamp.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbunclamp.m -***** demo - crv = nrbcirc (1,[],0,2*pi/3); - crv = nrbdegelev (crv, 2); - figure - nrbctrlplot (crv); hold on - nrbctrlplot (nrbtform (nrbunclamp (crv, 1), vectrans([-0.4, -0.4]))); - nrbctrlplot (nrbtform (nrbunclamp (crv, 2), vectrans([-0.8, -0.8]))); - nrbctrlplot (nrbtform (nrbunclamp (crv, 3), vectrans([-1.6, -1.6]))); - title ('Original curve and unclamped versions') -***** test - crv = nrbdegelev (nrbtestcrv,2); - x = linspace (0, 1, 100); - F = nrbeval (crv, x); - ucrv = nrbunclamp (crv, 0); - assert (F, nrbeval(ucrv, x)); - ucrv = nrbunclamp (crv, 1); - assert (F, nrbeval(ucrv, x), 1e-14); - ucrv = nrbunclamp (crv, 2); - assert (F, nrbeval(ucrv, x), 1e-14); - ucrv = nrbunclamp (crv, 3); - assert (F, nrbeval(ucrv, x), 1e-14); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/basisfunder.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/basisfunder.m -***** test - k = [0 0 0 0 1 1 1 1]; - p = 3; - u = rand (1); - i = findspan (numel(k)-p-2, p, u, k); - ders = basisfunder (i, p, u, k, 1); - sumders = sum (squeeze(ders), 2); - assert (sumders(1), 1, 1e-15); - assert (sumders(2:end), 0, 1e-15); -***** test - k = [0 0 0 0 1/3 2/3 1 1 1 1]; - p = 3; - u = rand (1); - i = findspan (numel(k)-p-2, p, u, k); - ders = basisfunder (i, p, u, k, 7); - sumders = sum (squeeze(ders), 2); - assert (sumders(1), 1, 1e-15); - assert (sumders(2:end), zeros(rows(squeeze(ders))-1, 1), 1e-13); + u = rand (1, 30); v = rand (1, 10); + u = u - min (u); u = u / max (u); + v = v - min (v); v = v / max (v); + [B, N] = nrbbasisfun ({u, v}, nrb); + assert (sum(B, 2), ones(300, 1), 1e-6) + assert (all (all (B<=1)), true) + assert (all (all (B>=0)), true) + assert (all (all (N>0)), true) + assert (all (all (N <= prod (nrb.number))), true) + assert (max (max (N)),prod (nrb.number)) + assert (min (min (N)),1) ***** test - k = [0 0 0 0 1/3 2/3 1 1 1 1]; - p = 3; - u = rand (100, 1); - i = findspan (numel(k)-p-2, p, u, k); - ders = basisfunder (i, p, u, k, 7); - for ii=1:10 - sumders = sum (squeeze(ders(ii,:,:)), 2); - assert (sumders(1), 1, 1e-15); - assert (sumders(2:end), zeros(rows(squeeze(ders(ii,:,:)))-1, 1), 1e-13); - end - assert (ders(:, (p+2):end, :), zeros(numel(u), 8-p-1, p+1), 1e-13) - assert (all(all(ders(:, 1, :) <= 1)), true) + p1 = 2; p2 = 3; p3 = 2; + n1 = 4; n2 = 5; n3 = 4; + Lx = 1; Ly = 1; Lz = 1; + crv = nrbline([1 0], [2 0]); + nrb = nrbtransp (nrbrevolve (crv, [], [0 0 1], pi/2)); + nrb = nrbextrude (nrb, [0 0 1]); + nrb = nrbdegelev (nrb, [p1-1, p2-2, p3-1]); + aux1 = linspace(0,1,n1); aux2 = linspace(0,1,n2); aux3 = linspace(0,1,n3); + nrb = nrbkntins (nrb, {aux1(2:end-1), aux2(2:end-1), aux3(2:end-1)}); + + u = rand (1, 12); v = rand (1, 10); w = rand (1, 15); + u = u - min (u); u = u / max (u); + v = v - min (v); v = v / max (v); + w = w - min (w); w = w / max (w); + [B, N] = nrbbasisfun ({u, v, w}, nrb); + assert (all(sum(B, 2) - ones(numel(u)*numel(v)*numel(w),1) < 1e-6)) + assert (all (all (B <= 1)) == true) + assert (all (all (B >= 0)) == true) + assert (all (all (N > 0)) == true) + assert (all (all (N <= prod (nrb.number))) == true) + assert (max (max (N)) == prod (nrb.number)) + assert (min (min (N))== 1) 3 tests, 3 passed, 0 known failure, 0 skipped -[inst/nrbreverse.m] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/inst/nrbreverse.m -***** demo - pnts = [0.5 1.5 3.0 7.5 8.5; - 3.0 5.5 1.5 4.0 4.5; - 0.0 0.0 0.0 0.0 0.0]; - crv1 = nrbmak(pnts,[0 0 0 1/2 3/4 1 1 1]); - crv2 = nrbreverse(crv1); - fprintf('Knots of the original curve\n') - disp(crv1.knots) - fprintf('Knots of the reversed curve\n') - disp(crv2.knots) - fprintf('Control points of the original curve\n') - disp(crv1.coefs(1:2,:)) - fprintf('Control points of the reversed curve\n') - disp(crv2.coefs(1:2,:)) - nrbplot(crv1,100) - hold on - nrbplot(crv2,100) - title('The curve and its reverse are the same') - hold off -***** test - srf = nrbrevolve(nrbline([1 0],[2 0]), [0 0 0], [0 0 1], pi/2); - srf = nrbkntins (srf, {0.3, 0.6}); - srf2 = nrbreverse (srf); - assert (srf.knots, cellfun(@(x) sort(1-x), srf2.knots, 'UniformOutput', false), 1e-15) - assert (srf.coefs, srf2.coefs(:,end:-1:1,end:-1:1)) -***** test - srf = nrbrevolve(nrbline([1 0],[2 0]), [0 0 0], [0 0 1], pi/2); - srf = nrbkntins (srf, {0.3, 0.6}); - srf2 = nrbreverse (srf, 1); - knt{1} = sort(1-srf2.knots{1}); knt{2} = srf2.knots{2}; - assert (srf.knots, knt, 1e-15) - assert (srf.coefs, srf2.coefs(:,end:-1:1,:)) - srf2 = nrbreverse (srf, 2); - knt{1} = srf2.knots{1}; knt{2} = sort(1-srf2.knots{2}); - assert (srf.knots, knt, 1e-15) - assert (srf.coefs, srf2.coefs(:,:,end:-1:1)) -2 tests, 2 passed, 0 known failure, 0 skipped Checking C++ files ... -[src/surfderiveval.cc] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/src/surfderiveval.cc -***** shared srf -***** test - k = [0 0 0 1 1 1]; - c = [0 1/2 1]; - [coef(2,:,:), coef(1,:,:)] = meshgrid (c, c); - srf = nrbmak (coef, {k, k}); - skl = surfderiveval (srf.number(1)-1, - srf.order(1)-1, - srf.knots{1}, - srf.number(2)-1, - srf.order(2)-1, - srf.knots{2}, - squeeze(srf.coefs(1,:,:)), .5, .5, 1) ; - assert (skl, [.5 0; 1 0]) -***** test - srf = nrbkntins (srf, {[], rand(1,2)}); - skl = surfderiveval (srf.number(1)-1, - srf.order(1)-1, - srf.knots{1}, - srf.number(2)-1, - srf.order(2)-1, - srf.knots{2}, - squeeze(srf.coefs(1,:,:)), .5, .5, 1) ; - assert (skl, [.5 0; 1 0], 100*eps) -2 tests, 2 passed, 0 known failure, 0 skipped -[src/basisfun.cc] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/src/basisfun.cc -***** shared n, U, p, u, s -***** test - n = 3; - U = [0 0 0 1/2 1 1 1]; - p = 2; - u = linspace(0, 1, 10); - s = findspan(n, p, u, U); - assert (s, [2*ones(1, 5) 3*ones(1, 5)]); -***** test - Bref = [1.00000 0.00000 0.00000 - 0.60494 0.37037 0.02469 - 0.30864 0.59259 0.09877 - 0.11111 0.66667 0.22222 - 0.01235 0.59259 0.39506 - 0.39506 0.59259 0.01235 - 0.22222 0.66667 0.11111 - 0.09877 0.59259 0.30864 - 0.02469 0.37037 0.60494 - 0.00000 0.00000 1.00000]; - B = basisfun(s, u, p, U); - assert (B, Bref, 1e-5); -2 tests, 2 passed, 0 known failure, 0 skipped [src/nrbsurfderiveval.cc] >>>>> /build/reproducible-path/octave-nurbs-1.4.3/src/nrbsurfderiveval.cc ***** test @@ -4753,6 +4738,26 @@ assert ([d2F1dy2(u(:),v(:)), d2F2dy2(u(:),v(:)), d2F3dy2(u(:),v(:))], squeeze(skl(1:3,1,3,:))', 1e2*eps); assert ([d2F1dxdy(u(:),v(:)), d2F2dxdy(u(:),v(:)), d2F3dxdy(u(:),v(:))], squeeze(skl(1:3,2,2,:))', 1e2*eps); 23 tests, 23 passed, 0 known failure, 0 skipped +[src/surfderivcpts.cc] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/src/surfderivcpts.cc +***** test + plane = nrbdegelev(nrb4surf([0 0], [0 1], [1 0], [1 1]), [1, 1]); + + pkl = surfderivcpts (plane.number(1)-1, plane.order(1)-1, + plane.knots{1}, plane.number(2)-1, + plane.order(2)-1, plane.knots{2}, + squeeze (plane.coefs(1,:,:)), 2); + + + pkl2 = [ 0 0 0 1 0 0 0 0 0 0 0 0 1 0 ... + 0 0 0 0 0 0 0 1 0 0 0 0 0 0.5 0 ... + 0 1 0 0 0 0 0 0.5 0 0 1 0 0 0 0 ... + 0 0.5 0 0 1 0 0 0 0 0 1 0 0 0 0 ... + 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 ... + 0 0 0 0 0 0 0]'; + + assert (pkl(:),pkl2); +1 test, 1 passed, 0 known failure, 0 skipped [src/tbasisfun.cc] >>>>> /build/reproducible-path/octave-nurbs-1.4.3/src/tbasisfun.cc ***** demo @@ -4794,26 +4799,57 @@ line.coefs(1,:), 2); assert (pk, [0 3/2; 3/2 0], 100*eps); 1 test, 1 passed, 0 known failure, 0 skipped -[src/surfderivcpts.cc] ->>>>> /build/reproducible-path/octave-nurbs-1.4.3/src/surfderivcpts.cc +[src/basisfun.cc] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/src/basisfun.cc +***** shared n, U, p, u, s ***** test - plane = nrbdegelev(nrb4surf([0 0], [0 1], [1 0], [1 1]), [1, 1]); - - pkl = surfderivcpts (plane.number(1)-1, plane.order(1)-1, - plane.knots{1}, plane.number(2)-1, - plane.order(2)-1, plane.knots{2}, - squeeze (plane.coefs(1,:,:)), 2); - - - pkl2 = [ 0 0 0 1 0 0 0 0 0 0 0 0 1 0 ... - 0 0 0 0 0 0 0 1 0 0 0 0 0 0.5 0 ... - 0 1 0 0 0 0 0 0.5 0 0 1 0 0 0 0 ... - 0 0.5 0 0 1 0 0 0 0 0 1 0 0 0 0 ... - 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 ... - 0 0 0 0 0 0 0]'; - - assert (pkl(:),pkl2); -1 test, 1 passed, 0 known failure, 0 skipped + n = 3; + U = [0 0 0 1/2 1 1 1]; + p = 2; + u = linspace(0, 1, 10); + s = findspan(n, p, u, U); + assert (s, [2*ones(1, 5) 3*ones(1, 5)]); +***** test + Bref = [1.00000 0.00000 0.00000 + 0.60494 0.37037 0.02469 + 0.30864 0.59259 0.09877 + 0.11111 0.66667 0.22222 + 0.01235 0.59259 0.39506 + 0.39506 0.59259 0.01235 + 0.22222 0.66667 0.11111 + 0.09877 0.59259 0.30864 + 0.02469 0.37037 0.60494 + 0.00000 0.00000 1.00000]; + B = basisfun(s, u, p, U); + assert (B, Bref, 1e-5); +2 tests, 2 passed, 0 known failure, 0 skipped +[src/surfderiveval.cc] +>>>>> /build/reproducible-path/octave-nurbs-1.4.3/src/surfderiveval.cc +***** shared srf +***** test + k = [0 0 0 1 1 1]; + c = [0 1/2 1]; + [coef(2,:,:), coef(1,:,:)] = meshgrid (c, c); + srf = nrbmak (coef, {k, k}); + skl = surfderiveval (srf.number(1)-1, + srf.order(1)-1, + srf.knots{1}, + srf.number(2)-1, + srf.order(2)-1, + srf.knots{2}, + squeeze(srf.coefs(1,:,:)), .5, .5, 1) ; + assert (skl, [.5 0; 1 0]) +***** test + srf = nrbkntins (srf, {[], rand(1,2)}); + skl = surfderiveval (srf.number(1)-1, + srf.order(1)-1, + srf.knots{1}, + srf.number(2)-1, + srf.order(2)-1, + srf.knots{2}, + squeeze(srf.coefs(1,:,:)), .5, .5, 1) ; + assert (skl, [.5 0; 1 0], 100*eps) +2 tests, 2 passed, 0 known failure, 0 skipped Done running the unit tests. Summary: 127 tests, 127 passed, 0 known failures, 0 skipped dh_installdocs -O--buildsystem=octave @@ -4838,8 +4874,8 @@ dpkg-gencontrol: warning: package octave-nurbs: substitution variable ${octave:Upstream-Description} unused, but is defined dh_md5sums -O--buildsystem=octave dh_builddeb -O--buildsystem=octave -dpkg-deb: building package 'octave-nurbs-dbgsym' in '../octave-nurbs-dbgsym_1.4.3-3_armhf.deb'. dpkg-deb: building package 'octave-nurbs' in '../octave-nurbs_1.4.3-3_armhf.deb'. +dpkg-deb: building package 'octave-nurbs-dbgsym' in '../octave-nurbs-dbgsym_1.4.3-3_armhf.deb'. dpkg-genbuildinfo --build=binary -O../octave-nurbs_1.4.3-3_armhf.buildinfo dpkg-genchanges --build=binary -O../octave-nurbs_1.4.3-3_armhf.changes dpkg-genchanges: info: binary-only upload (no source code included) @@ -4847,12 +4883,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: not including original source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/26826/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/26826/tmp/hooks/B01_cleanup finished I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env -I: removing directory /srv/workspace/pbuilder/22893 and its subdirectories -I: Current time: Sat Apr 27 19:57:43 -12 2024 -I: pbuilder-time-stamp: 1714291063 +I: removing directory /srv/workspace/pbuilder/26826 and its subdirectories +I: Current time: Sun Apr 28 22:06:43 +14 2024 +I: pbuilder-time-stamp: 1714291603