Diff of the two buildlogs: -- --- b1/build.log 2023-06-05 20:14:35.452798955 +0000 +++ b2/build.log 2023-06-05 20:21:01.179902870 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Mon Jun 5 08:02:58 -12 2023 -I: pbuilder-time-stamp: 1685995378 +I: Current time: Tue Jun 6 10:14:55 +14 2023 +I: pbuilder-time-stamp: 1685996095 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/bookworm-reproducible-base.tgz] I: copying local configuration @@ -16,7 +16,7 @@ I: copying [./octave-geometry_4.0.0.orig.tar.gz] I: copying [./octave-geometry_4.0.0-6.debian.tar.xz] I: Extracting source -gpgv: Signature made Sun Dec 4 22:26:50 2022 -12 +gpgv: Signature made Tue Dec 6 00:26:50 2022 +14 gpgv: using RSA key 3F464391498FE874BDB5D98F2124AA1983785C90 gpgv: issuer "rafael@debian.org" gpgv: Can't check signature: No public key @@ -30,135 +30,167 @@ dpkg-source: info: applying octave7.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/1677/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/11924/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 Jun 6 10:15 /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/11924/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/11924/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build' - 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=5 ' - DISTRIBUTION='bookworm' - 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]="15" [3]="1" [4]="release" [5]="arm-unknown-linux-gnueabihf") + BASH_VERSION='5.2.15(1)-release' + BUILDDIR=/build + 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=bookworm + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=arm + HOST_ARCH=armhf IFS=' ' - INVOCATION_ID='0ed093262d964c71bbd4e9e9054a4a09' - 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='1677' - PS1='# ' - PS2='> ' + INVOCATION_ID=f2e96b30506f4284b9468559fcfbc107 + 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=11924 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.UOytwDPw/pbuilderrc_c0On --distribution bookworm --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bookworm-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.UOytwDPw/b1 --logfile b1/build.log octave-geometry_4.0.0-6.dsc' - SUDO_GID='114' - SUDO_UID='109' - 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.UOytwDPw/pbuilderrc_TPyf --distribution bookworm --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bookworm-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.UOytwDPw/b2 --logfile b2/build.log --extrapackages usrmerge octave-geometry_4.0.0-6.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 ff64a 5.10.0-23-arm64 #1 SMP Debian 5.10.179-1 (2023-05-12) aarch64 GNU/Linux + Linux i-capture-the-hostname 5.10.0-23-armmp-lpae #1 SMP Debian 5.10.179-1 (2023-05-12) armv7l GNU/Linux I: ls -l /bin total 5072 - -rwxr-xr-x 1 root root 838488 Apr 23 09:24 bash - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bunzip2 - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bzcat - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzcmp -> bzdiff - -rwxr-xr-x 1 root root 2225 Sep 18 2022 bzdiff - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzegrep -> bzgrep - -rwxr-xr-x 1 root root 4893 Nov 27 2021 bzexe - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzfgrep -> bzgrep - -rwxr-xr-x 1 root root 3775 Sep 18 2022 bzgrep - -rwxr-xr-x 3 root root 67144 Sep 18 2022 bzip2 - -rwxr-xr-x 1 root root 67112 Sep 18 2022 bzip2recover - lrwxrwxrwx 1 root root 6 Sep 18 2022 bzless -> bzmore - -rwxr-xr-x 1 root root 1297 Sep 18 2022 bzmore - -rwxr-xr-x 1 root root 67632 Sep 20 2022 cat - -rwxr-xr-x 1 root root 67676 Sep 20 2022 chgrp - -rwxr-xr-x 1 root root 67644 Sep 20 2022 chmod - -rwxr-xr-x 1 root root 67684 Sep 20 2022 chown - -rwxr-xr-x 1 root root 133532 Sep 20 2022 cp - -rwxr-xr-x 1 root root 132868 Jan 5 01:20 dash - -rwxr-xr-x 1 root root 133220 Sep 20 2022 date - -rwxr-xr-x 1 root root 67732 Sep 20 2022 dd - -rwxr-xr-x 1 root root 68104 Sep 20 2022 df - -rwxr-xr-x 1 root root 133632 Sep 20 2022 dir - -rwxr-xr-x 1 root root 59128 Mar 22 21:02 dmesg - lrwxrwxrwx 1 root root 8 Dec 19 01:33 dnsdomainname -> hostname - lrwxrwxrwx 1 root root 8 Dec 19 01:33 domainname -> hostname - -rwxr-xr-x 1 root root 67560 Sep 20 2022 echo - -rwxr-xr-x 1 root root 41 Jan 24 02:43 egrep - -rwxr-xr-x 1 root root 67548 Sep 20 2022 false - -rwxr-xr-x 1 root root 41 Jan 24 02:43 fgrep - -rwxr-xr-x 1 root root 55748 Mar 22 21:02 findmnt - -rwsr-xr-x 1 root root 26208 Mar 22 20:15 fusermount - -rwxr-xr-x 1 root root 128608 Jan 24 02:43 grep - -rwxr-xr-x 2 root root 2346 Apr 9 2022 gunzip - -rwxr-xr-x 1 root root 6447 Apr 9 2022 gzexe - -rwxr-xr-x 1 root root 64220 Apr 9 2022 gzip - -rwxr-xr-x 1 root root 67032 Dec 19 01:33 hostname - -rwxr-xr-x 1 root root 67720 Sep 20 2022 ln - -rwxr-xr-x 1 root root 35132 Mar 22 21:51 login - -rwxr-xr-x 1 root root 133632 Sep 20 2022 ls - -rwxr-xr-x 1 root root 136808 Mar 22 21:02 lsblk - -rwxr-xr-x 1 root root 67800 Sep 20 2022 mkdir - -rwxr-xr-x 1 root root 67764 Sep 20 2022 mknod - -rwxr-xr-x 1 root root 67596 Sep 20 2022 mktemp - -rwxr-xr-x 1 root root 38504 Mar 22 21:02 more - -rwsr-xr-x 1 root root 38496 Mar 22 21:02 mount - -rwxr-xr-x 1 root root 9824 Mar 22 21:02 mountpoint - -rwxr-xr-x 1 root root 133532 Sep 20 2022 mv - lrwxrwxrwx 1 root root 8 Dec 19 01:33 nisdomainname -> hostname - lrwxrwxrwx 1 root root 14 Apr 2 18:25 pidof -> /sbin/killall5 - -rwxr-xr-x 1 root root 67608 Sep 20 2022 pwd - lrwxrwxrwx 1 root root 4 Apr 23 09:24 rbash -> bash - -rwxr-xr-x 1 root root 67600 Sep 20 2022 readlink - -rwxr-xr-x 1 root root 67672 Sep 20 2022 rm - -rwxr-xr-x 1 root root 67600 Sep 20 2022 rmdir - -rwxr-xr-x 1 root root 67400 Nov 2 2022 run-parts - -rwxr-xr-x 1 root root 133372 Jan 5 07:55 sed - lrwxrwxrwx 1 root root 4 Jan 5 01:20 sh -> dash - -rwxr-xr-x 1 root root 67584 Sep 20 2022 sleep - -rwxr-xr-x 1 root root 67644 Sep 20 2022 stty - -rwsr-xr-x 1 root root 50800 Mar 22 21:02 su - -rwxr-xr-x 1 root root 67584 Sep 20 2022 sync - -rwxr-xr-x 1 root root 336764 Apr 6 02:25 tar - -rwxr-xr-x 1 root root 67144 Nov 2 2022 tempfile - -rwxr-xr-x 1 root root 133224 Sep 20 2022 touch - -rwxr-xr-x 1 root root 67548 Sep 20 2022 true - -rwxr-xr-x 1 root root 9768 Mar 22 20:15 ulockmgr_server - -rwsr-xr-x 1 root root 22108 Mar 22 21:02 umount - -rwxr-xr-x 1 root root 67572 Sep 20 2022 uname - -rwxr-xr-x 2 root root 2346 Apr 9 2022 uncompress - -rwxr-xr-x 1 root root 133632 Sep 20 2022 vdir - -rwxr-xr-x 1 root root 42608 Mar 22 21:02 wdctl - lrwxrwxrwx 1 root root 8 Dec 19 01:33 ypdomainname -> hostname - -rwxr-xr-x 1 root root 1984 Apr 9 2022 zcat - -rwxr-xr-x 1 root root 1678 Apr 9 2022 zcmp - -rwxr-xr-x 1 root root 6460 Apr 9 2022 zdiff - -rwxr-xr-x 1 root root 29 Apr 9 2022 zegrep - -rwxr-xr-x 1 root root 29 Apr 9 2022 zfgrep - -rwxr-xr-x 1 root root 2081 Apr 9 2022 zforce - -rwxr-xr-x 1 root root 8103 Apr 9 2022 zgrep - -rwxr-xr-x 1 root root 2206 Apr 9 2022 zless - -rwxr-xr-x 1 root root 1842 Apr 9 2022 zmore - -rwxr-xr-x 1 root root 4577 Apr 9 2022 znew -I: user script /srv/workspace/pbuilder/1677/tmp/hooks/D02_print_environment finished + -rwxr-xr-x 1 root root 838488 Apr 24 11:24 bash + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bunzip2 + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bzcat + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzcmp -> bzdiff + -rwxr-xr-x 1 root root 2225 Sep 19 2022 bzdiff + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzegrep -> bzgrep + -rwxr-xr-x 1 root root 4893 Nov 28 2021 bzexe + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzfgrep -> bzgrep + -rwxr-xr-x 1 root root 3775 Sep 19 2022 bzgrep + -rwxr-xr-x 3 root root 67144 Sep 19 2022 bzip2 + -rwxr-xr-x 1 root root 67112 Sep 19 2022 bzip2recover + lrwxrwxrwx 1 root root 6 Sep 19 2022 bzless -> bzmore + -rwxr-xr-x 1 root root 1297 Sep 19 2022 bzmore + -rwxr-xr-x 1 root root 67632 Sep 21 2022 cat + -rwxr-xr-x 1 root root 67676 Sep 21 2022 chgrp + -rwxr-xr-x 1 root root 67644 Sep 21 2022 chmod + -rwxr-xr-x 1 root root 67684 Sep 21 2022 chown + -rwxr-xr-x 1 root root 133532 Sep 21 2022 cp + -rwxr-xr-x 1 root root 132868 Jan 6 03:20 dash + -rwxr-xr-x 1 root root 133220 Sep 21 2022 date + -rwxr-xr-x 1 root root 67732 Sep 21 2022 dd + -rwxr-xr-x 1 root root 68104 Sep 21 2022 df + -rwxr-xr-x 1 root root 133632 Sep 21 2022 dir + -rwxr-xr-x 1 root root 59128 Mar 23 23:02 dmesg + lrwxrwxrwx 1 root root 8 Dec 20 03:33 dnsdomainname -> hostname + lrwxrwxrwx 1 root root 8 Dec 20 03:33 domainname -> hostname + -rwxr-xr-x 1 root root 67560 Sep 21 2022 echo + -rwxr-xr-x 1 root root 41 Jan 25 04:43 egrep + -rwxr-xr-x 1 root root 67548 Sep 21 2022 false + -rwxr-xr-x 1 root root 41 Jan 25 04:43 fgrep + -rwxr-xr-x 1 root root 55748 Mar 23 23:02 findmnt + -rwsr-xr-x 1 root root 26208 Mar 23 22:15 fusermount + -rwxr-xr-x 1 root root 128608 Jan 25 04:43 grep + -rwxr-xr-x 2 root root 2346 Apr 10 2022 gunzip + -rwxr-xr-x 1 root root 6447 Apr 10 2022 gzexe + -rwxr-xr-x 1 root root 64220 Apr 10 2022 gzip + -rwxr-xr-x 1 root root 67032 Dec 20 03:33 hostname + -rwxr-xr-x 1 root root 67720 Sep 21 2022 ln + -rwxr-xr-x 1 root root 35132 Mar 23 23:51 login + -rwxr-xr-x 1 root root 133632 Sep 21 2022 ls + -rwxr-xr-x 1 root root 136808 Mar 23 23:02 lsblk + -rwxr-xr-x 1 root root 67800 Sep 21 2022 mkdir + -rwxr-xr-x 1 root root 67764 Sep 21 2022 mknod + -rwxr-xr-x 1 root root 67596 Sep 21 2022 mktemp + -rwxr-xr-x 1 root root 38504 Mar 23 23:02 more + -rwsr-xr-x 1 root root 38496 Mar 23 23:02 mount + -rwxr-xr-x 1 root root 9824 Mar 23 23:02 mountpoint + -rwxr-xr-x 1 root root 133532 Sep 21 2022 mv + lrwxrwxrwx 1 root root 8 Dec 20 03:33 nisdomainname -> hostname + lrwxrwxrwx 1 root root 14 Apr 3 20:25 pidof -> /sbin/killall5 + -rwxr-xr-x 1 root root 67608 Sep 21 2022 pwd + lrwxrwxrwx 1 root root 4 Apr 24 11:24 rbash -> bash + -rwxr-xr-x 1 root root 67600 Sep 21 2022 readlink + -rwxr-xr-x 1 root root 67672 Sep 21 2022 rm + -rwxr-xr-x 1 root root 67600 Sep 21 2022 rmdir + -rwxr-xr-x 1 root root 67400 Nov 3 2022 run-parts + -rwxr-xr-x 1 root root 133372 Jan 6 09:55 sed + lrwxrwxrwx 1 root root 9 Jun 6 10:15 sh -> /bin/bash + -rwxr-xr-x 1 root root 67584 Sep 21 2022 sleep + -rwxr-xr-x 1 root root 67644 Sep 21 2022 stty + -rwsr-xr-x 1 root root 50800 Mar 23 23:02 su + -rwxr-xr-x 1 root root 67584 Sep 21 2022 sync + -rwxr-xr-x 1 root root 336764 Apr 7 04:25 tar + -rwxr-xr-x 1 root root 67144 Nov 3 2022 tempfile + -rwxr-xr-x 1 root root 133224 Sep 21 2022 touch + -rwxr-xr-x 1 root root 67548 Sep 21 2022 true + -rwxr-xr-x 1 root root 9768 Mar 23 22:15 ulockmgr_server + -rwsr-xr-x 1 root root 22108 Mar 23 23:02 umount + -rwxr-xr-x 1 root root 67572 Sep 21 2022 uname + -rwxr-xr-x 2 root root 2346 Apr 10 2022 uncompress + -rwxr-xr-x 1 root root 133632 Sep 21 2022 vdir + -rwxr-xr-x 1 root root 42608 Mar 23 23:02 wdctl + lrwxrwxrwx 1 root root 8 Dec 20 03:33 ypdomainname -> hostname + -rwxr-xr-x 1 root root 1984 Apr 10 2022 zcat + -rwxr-xr-x 1 root root 1678 Apr 10 2022 zcmp + -rwxr-xr-x 1 root root 6460 Apr 10 2022 zdiff + -rwxr-xr-x 1 root root 29 Apr 10 2022 zegrep + -rwxr-xr-x 1 root root 29 Apr 10 2022 zfgrep + -rwxr-xr-x 1 root root 2081 Apr 10 2022 zforce + -rwxr-xr-x 1 root root 8103 Apr 10 2022 zgrep + -rwxr-xr-x 1 root root 2206 Apr 10 2022 zless + -rwxr-xr-x 1 root root 1842 Apr 10 2022 zmore + -rwxr-xr-x 1 root root 4577 Apr 10 2022 znew +I: user script /srv/workspace/pbuilder/11924/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -718,7 +750,7 @@ Get: 514 http://deb.debian.org/debian bookworm/main armhf libxslt1.1 armhf 1.1.35-1 [223 kB] Get: 515 http://deb.debian.org/debian bookworm/main armhf octave-matgeom all 1.2.3-3 [343 kB] Get: 516 http://deb.debian.org/debian bookworm/main armhf python3-lxml armhf 4.9.2-1+b1 [1082 kB] -Fetched 177 MB in 16s (11.1 MB/s) +Fetched 177 MB in 21s (8577 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libpython3.11-minimal:armhf. (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 ... 19324 files and directories currently installed.) @@ -2835,8 +2867,19 @@ Writing extended state information... Building tag database... -> Finished parsing the build-deps +Reading package lists... +Building dependency tree... +Reading state information... +usrmerge is already the newest version (35). +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. I: Building the package -I: Running cd /build/octave-geometry-4.0.0/ && 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-geometry_4.0.0-6_source.changes +I: user script /srv/workspace/pbuilder/11924/tmp/hooks/A99_set_merged_usr starting +Re-configuring usrmerge... +removed '/etc/unsupported-skip-usrmerge-conversion' +The system has been successfully converted. +I: user script /srv/workspace/pbuilder/11924/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/octave-geometry-4.0.0/ && 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-geometry_4.0.0-6_source.changes dpkg-buildpackage: info: source package octave-geometry dpkg-buildpackage: info: source version 4.0.0-6 dpkg-buildpackage: info: source distribution unstable @@ -2870,14 +2913,35 @@ make[1]: Entering directory '/build/octave-geometry-4.0.0/src' /usr/bin/mkoctfile --verbose -Wall -mex -g clipper.cpp mexclipper.cpp /usr/bin/mkoctfile --verbose -c connector.cpp -o connector.o -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security -g -Wall -I. -DMEX_DEBUG clipper.cpp -o /tmp/oct-EI8wwz.o -/usr/bin/mkoctfile --verbose -c martinez.cpp -o martinez.o +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security -g -Wall -I. -DMEX_DEBUG clipper.cpp -o /tmp/oct-YoOkLw.o g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security connector.cpp -o connector.o +/usr/bin/mkoctfile --verbose -c martinez.cpp -o martinez.o /usr/bin/mkoctfile --verbose -c polygon.cpp -o polygon.o g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security martinez.cpp -o martinez.o -/usr/bin/mkoctfile --verbose -c utilities.cpp -o utilities.o g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security polygon.cpp -o polygon.o -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security utilities.cpp -o utilities.o +In file included from connector.h:13, + from connector.cpp:9: +martinez.h:40:37: warning: 'template struct std::binary_function' is deprecated [-Wdeprecated-declarations] + 40 | struct SegmentComp : public binary_function { // for sorting edges in the sweep line + | ^~~~~~~~~~~~~~~ +In file included from /usr/include/c++/12/string:48, + from /usr/include/c++/12/bits/locale_classes.h:40, + from /usr/include/c++/12/bits/ios_base.h:41, + from /usr/include/c++/12/ios:42, + from /usr/include/c++/12/ostream:38, + from /usr/include/c++/12/iostream:39, + from point.h:16, + from segment.h:16, + from connector.h:12: +/usr/include/c++/12/bits/stl_function.h:131:12: note: declared here + 131 | struct binary_function + | ^~~~~~~~~~~~~~~ +martinez.h:67:40: warning: 'template struct std::binary_function' is deprecated [-Wdeprecated-declarations] + 67 | struct SweepEventComp : public binary_function { // for sortening events + | ^~~~~~~~~~~~~~~ +/usr/include/c++/12/bits/stl_function.h:131:12: note: declared here + 131 | struct binary_function + | ^~~~~~~~~~~~~~~ polygon.cpp:96:37: warning: 'template struct std::binary_function' is deprecated [-Wdeprecated-declarations] 96 | struct SegmentComp : public binary_function { | ^~~~~~~~~~~~~~~ @@ -2911,29 +2975,6 @@ /usr/include/c++/12/bits/stl_function.h:131:12: note: declared here 131 | struct binary_function | ^~~~~~~~~~~~~~~ -In file included from connector.h:13, - from connector.cpp:9: -martinez.h:40:37: warning: 'template struct std::binary_function' is deprecated [-Wdeprecated-declarations] - 40 | struct SegmentComp : public binary_function { // for sorting edges in the sweep line - | ^~~~~~~~~~~~~~~ -In file included from /usr/include/c++/12/string:48, - from /usr/include/c++/12/bits/locale_classes.h:40, - from /usr/include/c++/12/bits/ios_base.h:41, - from /usr/include/c++/12/ios:42, - from /usr/include/c++/12/ostream:38, - from /usr/include/c++/12/iostream:39, - from point.h:16, - from segment.h:16, - from connector.h:12: -/usr/include/c++/12/bits/stl_function.h:131:12: note: declared here - 131 | struct binary_function - | ^~~~~~~~~~~~~~~ -martinez.h:67:40: warning: 'template struct std::binary_function' is deprecated [-Wdeprecated-declarations] - 67 | struct SweepEventComp : public binary_function { // for sortening events - | ^~~~~~~~~~~~~~~ -/usr/include/c++/12/bits/stl_function.h:131:12: note: declared here - 131 | struct binary_function - | ^~~~~~~~~~~~~~~ clipper.cpp: In function 'void ClipperLib::InitEdge(TEdge*, TEdge*, TEdge*, const IntPoint&)': clipper.cpp:750:14: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct ClipperLib::TEdge'; use assignment or value-initialization instead [-Wclass-memaccess] 750 | std::memset(e, 0, sizeof(TEdge)); @@ -2972,6 +3013,8 @@ /usr/include/c++/12/bits/stl_vector.h:1287:28: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator >' changed in GCC 7.1 1287 | _M_realloc_insert(end(), __x); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ +/usr/bin/mkoctfile --verbose -c utilities.cpp -o utilities.o +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security utilities.cpp -o utilities.o In file included from /usr/include/c++/12/bits/stl_algo.h:60, from /usr/include/c++/12/functional:64, from clipper.hpp:88, @@ -2981,7 +3024,7 @@ 224 | __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, | ^~~~~~~~~~~~~ /usr/bin/mkoctfile --verbose connector.o martinez.o polygon.o utilities.o polybool_mrf.cc -o polybool_mrf.oct -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security polybool_mrf.cc -o /tmp/oct-68cWeh.o +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security polybool_mrf.cc -o /tmp/oct-EBJJ4H.o In file included from polybool_mrf.cc:21: martinez.h:40:37: warning: 'template struct std::binary_function' is deprecated [-Wdeprecated-declarations] 40 | struct SegmentComp : public binary_function { // for sorting edges in the sweep line @@ -3097,12 +3140,12 @@ /usr/include/c++/12/bits/stl_vector.h:1287:28: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator >' changed in GCC 7.1 1287 | _M_realloc_insert(end(), __x); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ +g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security -g -Wall -I. -DMEX_DEBUG mexclipper.cpp -o /tmp/oct-rIjxjg.o In file included from /usr/include/c++/12/vector:70: /usr/include/c++/12/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_realloc_insert(iterator, _Args&& ...) [with _Args = {const Point&}; _Tp = Point; _Alloc = std::allocator]': /usr/include/c++/12/bits/vector.tcc:439:7: note: parameter passing for argument of type 'std::vector::iterator' changed in GCC 7.1 439 | vector<_Tp, _Alloc>:: | ^~~~~~~~~~~~~~~~~~~ -g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security -g -Wall -I. -DMEX_DEBUG mexclipper.cpp -o /tmp/oct-ifGuz1.o In file included from /usr/include/c++/12/vector:64: In member function 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = Point; _Alloc = std::allocator]', inlined from 'void Contour::add(const Point&)' at polygon.h:41:47, @@ -3116,14 +3159,83 @@ /usr/include/c++/12/bits/stl_vector.h:1287:28: note: parameter passing for argument of type '__gnu_cxx::__normal_iterator >' changed in GCC 7.1 1287 | _M_realloc_insert(end(), __x); | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ -g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security -o polybool_mrf.oct connector.o martinez.o polygon.o utilities.o /tmp/oct-68cWeh.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro -g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security -g -Wall -o clipper.mex /tmp/oct-EI8wwz.o /tmp/oct-ifGuz1.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro +g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security -o polybool_mrf.oct connector.o martinez.o polygon.o utilities.o /tmp/oct-EBJJ4H.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro +g++ -I/usr/include/octave-7.3.0/octave/.. -I/usr/include/octave-7.3.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/octave-geometry-4.0.0=. -fstack-protector-strong -Wformat -Werror=format-security -g -Wall -o clipper.mex /tmp/oct-YoOkLw.o /tmp/oct-rIjxjg.o -shared -Wl,-Bsymbolic -Wl,-z,relro -L/usr/lib/arm-linux-gnueabihf -shared -Wl,-Bsymbolic -Wl,-z,relro make[1]: Leaving directory '/build/octave-geometry-4.0.0/src' copyfile /build/octave-geometry-4.0.0/./src/polybool_mrf.oct /build/octave-geometry-4.0.0/./src/clipper.mex /build/octave-geometry-4.0.0/./inst/arm-unknown-linux-gnueabihf-api-v57 For information about changes from previous versions of the geometry package, run 'news geometry'. dh_octave_check -O--buildsystem=octave Checking package... Checking m files ... +[inst/orientPolygon.m] +>>>>> /build/octave-geometry-4.0.0/inst/orientPolygon.m +***** shared pccw, pcw, pxccw, pyccw, pxnan, pynan, pnan + pccw = [0 0; 1 0; 1 1; 0 1]; + pcw = reversePolygon (pccw); + pxccw = pccw(:,1); + pyccw = pccw(:,2); + pxnan = [2; 2; 0; 0; NaN; 0; 0; 2]; + pynan = [0; 2; 2; 0; NaN; 0; 3; 0]; + pnan = [pxnan pynan]; +***** test + x = orientPolygon (pccw,[],"ccw"); + assert (x, pccw); +***** test + x = orientPolygon (pccw,[],"cw"); + assert (x, pcw); +***** test + x = orientPolygon (pcw,[],"ccw"); + assert (x, pccw); +***** test + x = orientPolygon (pcw,[],"cw"); + assert (x, pcw); +***** test + x = orientPolygon (pnan,[],"cw"); + y = splitPolygons (pnan); + y = joinPolygons ({reversePolygon(y{1}); y{2}}); + assert (x, y); +***** test + x = orientPolygon (pnan,[],"ccw"); + y = splitPolygons (pnan); + y = joinPolygons ({y{1}; reversePolygon(y{2})}); + assert (x, y); +***** test + [x y] = orientPolygon (pxccw,pyccw,"ccw"); + assert ([x y], pccw); +***** test + [x y] = orientPolygon (pxccw,pyccw,"cw"); + assert ([x y], pcw); +8 tests, 8 passed, 0 known failure, 0 skipped +[inst/shapeArea.m] +>>>>> /build/octave-geometry-4.0.0/inst/shapeArea.m +***** demo # non-convex piece-wise polynomial shape + boomerang = {[ 0 -2 1; ... + -4 4 0]; ... + [0.25 -1; ... + 0 0]; ... + [ 0 1.5 -0.75; ... + -3 3 0]; + [0.25 0.75; ... + 0 0]}; + A = shapeArea (boomerang) +***** test + warning('off', 'geom2d:cw-shape', 'local'); + triangle = {[1 0; 0 0]; [-0.5 1; 1 0]; [-0.5 0.5; -1 1]}; + A = shapeArea (triangle); + assert (0.5, A); +***** test + warning('off', 'geom2d:cw-shape', 'local'); + circle = {[1.715729 -6.715729 0 5; ... + -1.715729 -1.568542 8.284271 0]; ... + [1.715729 1.568542 -8.284271 0; ... + 1.715729 -6.715729 0 5]; ... + [-1.715729 6.715729 0 -5; ... + 1.715729 1.568542 -8.284271 0]; ... + [-1.715729 -1.568542 8.284271 0; ... + -1.715729 6.715729 0 -5]}; + A = shapeArea (circle); + assert (pi*5^2, A, 5e-2); +2 tests, 2 passed, 0 known failure, 0 skipped [inst/simplifyPolygon_geometry.m] >>>>> /build/octave-geometry-4.0.0/inst/simplifyPolygon_geometry.m ***** test @@ -3179,189 +3291,24 @@ be notified and will not update its internal list of open figure windows. The qt toolkit is recommended instead. 3 tests, 2 passed, 1 known failure, 0 skipped -[inst/polygon2shape.m] ->>>>> /build/octave-geometry-4.0.0/inst/polygon2shape.m -***** test - pp = [0 0; 1 0; 1 1; 0 1]; - s = polygon2shape (pp); -1 test, 1 passed, 0 known failure, 0 skipped -[inst/clipPolygon_mrf.m] ->>>>> /build/octave-geometry-4.0.0/inst/clipPolygon_mrf.m -***** test - pol1 = [-0.15 -0.15; 0.45 -0.15; 0.15 0.45]; - pol2 = [-0.05 -0.05; 0.15 0.35; 0.35 -0.05; NaN NaN; - 0.05 0.05; 0.25 0.05; 0.15 0.25]; - opol_0 = [0.15 0.25; 0.05 0.05; 0.25 0.05; NaN NaN; - 0.15 0.35; -0.05 -0.05; 0.35 -0.05; NaN NaN; - 0.15 0.45; -0.15 -0.15; 0.45 -0.15]; - npol_0 = 3; - opol_1= [0.15 0.25; 0.05 0.05; 0.25 0.05; NaN NaN; - 0.15 0.35; -0.05 -0.05; 0.35 -0.05]; - npol_1 = 2; - opol_2 = [0.15 0.25; 0.05 0.05; 0.25 0.05; NaN NaN; - 0.15 0.35; -0.05 -0.05; 0.35 -0.05; NaN NaN; - 0.15 0.45; -0.15 -0.15; 0.45 -0.15]; - npol_2 = 3; - opol_3 = [0.15 0.45; -0.15 -0.15; 0.45 -0.15]; - npol_3 = 1; - [opol npol] = clipPolygon_mrf (pol1, pol2, 0); - assert(opol, opol_0); - assert(npol, npol_0); - [opol npol] = clipPolygon_mrf (pol1, pol2, 1); - assert(opol, opol_1); - assert(npol, npol_1); - [opol npol] = clipPolygon_mrf (pol1, pol2, 2); - assert(opol, opol_2); - assert(npol, npol_2); - [opol npol] = clipPolygon_mrf (pol1, pol2, 3); - assert(opol, opol_3); - assert(npol, npol_3); -***** error clipPolygon_mrf([], [], 0); -***** error - pol1 = [0.15 0.15; 0.55 0.45; 0.15 0.75]; - pol2 = [0.35 0.45; 0.75 0.15; 0.75 0.75]; - clipPolygon_mrf(pol1, pol2, 4); -***** test ## Bug #56506 - subpol = [0 0; 5 5; 2.5 4;0 0]; - clppol2 = [10 1; 16 6; 13.5 5; 10 1]; - [a, b] = clipPolygon_mrf (subpol, clppol2, 1); - assert (a, []); - assert (b, 0); -***** demo - pol1 = [0.15 0.15; 0.55 0.45; 0.15 0.75]; - pol2 = [0.35 0.45; 0.75 0.15; 0.75 0.75]; - pol1a = polygon2patch(pol1); - pol2a = polygon2patch(pol2); - lw = 2; - subplot (2, 6, [2 3]) - patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'k', 'linewidth', lw); - axis image - grid on - title ("1. Subject polygon") - - subplot (2, 6, [4 5]) - patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'none'); - hold on - patch (pol2a(:, 1), pol2a(:, 2), 'facecolor', 'y', 'edgecolor', 'b', 'linewidth', lw); - axis image - grid on - title "2. Clip polygon" - - op = {"Sub -clip", "AND / Intersection", "Exclusive OR", "OR / Union"}; - for i=1:numel(op) - subplot (6, 4, [12 16]+i); - [opol, npol] = clipPolygon_mrf (pol1, pol2, i-1); - opol = polygon2patch (opol); - patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'none'); - hold on - patch (pol2a(:, 1), pol2a(:, 2), 'facecolor', 'y', 'edgecolor', 'none'); - patch (opol(:,1),opol(:,2), 'facecolor', 'g', 'edgecolor', 'r', ... - 'linewidth', lw); - axis image - grid on - title (sprintf("%d. %s", i+2, op{i})); - axis off - endfor - - subplot (10, 4, 37); - [opol, npol] = clipPolygon_mrf (pol2, pol1, 0); - opol = polygon2patch (opol); - patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'none'); - hold on - patch (pol2a(:, 1), pol2a(:, 2), 'facecolor', 'y', 'edgecolor', 'none'); - patch (opol(:,1),opol(:,2), 'facecolor', 'g', 'edgecolor', 'r', ... - 'linewidth', lw); - axis image - grid on - axis off - title "7. Clip - sub"; -***** demo - pol1 = [1 1; 5 1; 3 7; NaN NaN; 2 2; 3 5; 4 2]; - pol2 = [3 1; 5 6; 1 6]; - pol1a = polygon2patch(pol1); - pol2a = polygon2patch(pol2); - lw = 2; - subplot (2, 6, [2 3]) - patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'k', 'linewidth', lw); - axis image - grid on - title ("1. Subject polygon") - - subplot (2, 6, [4 5]) - patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'none'); - hold on - patch (pol2a(:, 1), pol2a(:, 2), 'facecolor', 'y', 'edgecolor', 'b', 'linewidth', lw); - axis image - grid on - title "2. Clip polygon" - - op = {"Sub -clip", "AND / Intersection", "Exclusive OR", "OR / Union"}; - for i=1:numel(op) - subplot (6, 4, [12 16]+i); - [opol, npol] = clipPolygon_mrf (pol1, pol2, i-1); - opol = polygon2patch (opol); - patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'none'); - hold on - patch (pol2a(:, 1), pol2a(:, 2), 'facecolor', 'y', 'edgecolor', 'none'); - patch (opol(:,1),opol(:,2), 'facecolor', 'g', 'edgecolor', 'r', ... - 'linewidth', lw); - axis image - grid on - title (sprintf("%d. %s", i+2, op{i})); - axis off - endfor - - subplot (10, 4, 37); - [opol, npol] = clipPolygon_mrf (pol2, pol1, 0); - opol = polygon2patch (opol); - patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'none'); - hold on - patch (pol2a(:, 1), pol2a(:, 2), 'facecolor', 'y', 'edgecolor', 'none'); - patch (opol(:,1),opol(:,2), 'facecolor', 'g', 'edgecolor', 'r', ... - 'linewidth', lw); - axis image - grid on - axis off - title "7. Clip - sub"; -4 tests, 4 passed, 0 known failure, 0 skipped -[inst/polyjoin.m] ->>>>> /build/octave-geometry-4.0.0/inst/polyjoin.m -***** demo - x = {[1 2]'; [3 4]'} - y = {[10 20]'; [30 40]'} - [vecx, vecy] = polyjoin (x, y) -***** test - x = {[1 2]'; [3 4]'}; y = {[10 20]'; [30 40]'}; - [vecx, vecy] = polyjoin (x, y); - assert (vecx, [1; 2; NaN; 3; 4]); - assert (vecy, [10; 20; NaN; 30; 40]); -***** test - x = {[1;2]; [3;4]; [3]}; y = {[10;20]; [30;40]; [10]}; - [vecx, vecy] = polyjoin (x, y); - assert (vecx, [1; 2; NaN; 3; 4; NaN; 3]); - assert (vecy, [10; 20; NaN; 30; 40; NaN; 10]); -***** test - x = {[1 2 3]'; 4; [5 6 7 8 NaN 9]'}; - y = {[9 8 7]'; 6; [5 4 3 2 NaN 1]'}; - [vecx, vecy] = polyjoin (x, y); - assert (vecx, [1; 2; 3; NaN; 4; NaN; 5; 6; 7; 8; NaN; 9]); - assert (vecy, [9; 8; 7; NaN; 6; NaN; 5; 4; 3; 2; NaN; 1]); +[inst/polysplit.m] +>>>>> /build/octave-geometry-4.0.0/inst/polysplit.m ***** test - xyi = {[0 0; 0 10; 10, 10; 10, 0; 0, 0]; [1 5; 2 5; 2 6; 1 6; 1 5]}; - xyo = polyjoin (xyi); - assert (polyjoin (xyi), [0 0; 0 10; 10 10; 10 0; 0 0; NaN, NaN; 1 5; 2 5; 2 6; 1 6; 1 5], eps); + x=[1 ;2 ;NaN ;3 ;4]; y=[4 ;3 ;NaN ;2 ;1]; + [cellx,celly]=polysplit(x,y); + assert (cellx, {[1; 2];[3; 4]}); + assert (celly, {[4; 3];[2; 1]}); ***** test - xyi = {[0 0 1; 0 10 2; 10, 10 3; 10, 0 2; 0, 0 1]; [1 5 1.5; 2 5 2; 2 6 2.5; 1 6 2; 1 5 1.5]}; - xyo = polyjoin (xyi); - assert (polyjoin (xyi), [0 0 1; 0 10 2; 10 10 3; 10 0 2; 0 0 1; NaN, NaN NaN; 1 5 1.5; 2 5 2; 2 6 2.5; 1 6 2; 1 5 1.5], eps); + x=[1 2 NaN 3 4]; y=[4 3 NaN 2 1]; + [cellx,celly]=polysplit(x,y); + assert (cellx, {[1 2];[3 4]}); + assert (celly, {[4 3];[2 1]}); ***** test - assert (polyjoin ({[2, 3]}), [2, 3], eps); -***** error polyjoin (1); -***** error polyjoin ({2}); -***** error polyjoin ({2, 3}); -***** error polyjoin ({1; 2}, [3 4]); -***** warning polyjoin ({1; 2}, {3 4}); -11 tests, 11 passed, 0 known failure, 0 skipped + x=[0 ;2 ;2 ;0 ;0 ;NaN ;NaN]; y=[0 ;0 ;3 ;3 ;0 ;NaN ;NaN]; + [cellx,celly]=polysplit(x,y); + assert (cellx, {[0 ;2 ;2 ;0 ;0]}); + assert (celly, {[0 ;0 ;3 ;3 ;0]}); +3 tests, 3 passed, 0 known failure, 0 skipped [inst/clipPolygon.m] >>>>> /build/octave-geometry-4.0.0/inst/clipPolygon.m ***** error clipPolygon([],[],[],'abracadabra') @@ -3413,116 +3360,22 @@ axis off endfor 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/poly2ccw.m] ->>>>> /build/octave-geometry-4.0.0/inst/poly2ccw.m +[inst/poly2cw.m] +>>>>> /build/octave-geometry-4.0.0/inst/poly2cw.m ***** test - x = [0 0 1 1 0]; y = [0 1 1 0 0]; - [xccw,yccw] = poly2ccw(x,y); - xexp = [0; 1; 1; 0; 0]; yexp = [0; 0; 1; 1; 0]; - assert (xccw,xexp); - assert (yccw,yexp); + x = [0; 1; 1; 0; 0]; y = [0; 0; 1; 1; 0]; + [xcw,ycw] = poly2cw(x,y); + xexp = [0; 0; 1; 1; 0]; yexp = [0; 1; 1; 0; 0]; + assert (xcw,xexp); + assert (ycw,yexp); ***** test x=[0 0 2 2 NaN 0 2 0]; y=[0 2 2 0 NaN 0 0 3]; - [xccw,yccw]=poly2ccw(x,y); - xexp=[0; 2; 2; 0; NaN; 0; 2; 0]; - yexp=[0; 0; 2; 2; NaN; 0; 0; 3]; - assert (xccw,xexp); - assert (yccw,yexp); + [xcw,ycw]=poly2cw(x,y); + xexp=[0; 0; 2; 2; NaN; 0; 0; 2]; + yexp=[0; 2; 2; 0; NaN; 0; 3; 0]; + assert (xcw,xexp); + assert (ycw,yexp); 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/polybool.m] ->>>>> /build/octave-geometry-4.0.0/inst/polybool.m -***** shared ipol, cpol, ix, iy, cx, cy, xi, yi, xc, yc - ipol = [0 0; 3 0; 3 3; 0 3; 0 0]; - cpol = [2, 1; 5, 1; 5, 4; 2, 4; 2, 1]; - ix = {ipol(:, 1)'}; - iy = {ipol(:, 2)'}; - cx = {cpol(:, 1)'}; - cy = {cpol(:, 2)'}; - xi = {ipol(:, 1)}; - yi = {ipol(:, 2)}; - xc = {cpol(:, 1)}; - yc = {cpol(:, 2)}; -***** test - opol = polybool (0, ipol, cpol); - assert (size (opol), [7, 2]); - assert (polygonArea (opol), 7); -***** test - [ox, oy] = polybool (0, ix, iy, cx, cy); - opol = [ox{1}', oy{1}']; - assert (size (opol), [7, 2]); - assert (polygonArea (opol), 7); -***** test - [ox, oy] = polybool (0, xi, yi, xc, yc); - opol = [ox{1}, oy{1}]; - assert (size (opol), [7, 2]); - assert (polygonArea (opol), 7); -***** test - opol = polybool (1, cpol, ipol); - assert (size (opol), [5, 2]); - assert (polygonArea (opol), 2); -***** test - [ox, oy] = polybool (1, ix, iy, cx, cy); - opol = [ox{1}', oy{1}']; - assert (size (opol), [5, 2]); - assert (polygonArea (opol), 2); -***** test - opol = polybool (2, cpol, ipol); - assert (size (opol), [15, 2]); - assert (polygonArea (opol), 14); -***** test - [ox, oy] = polybool (2, ix, iy, cx, cy); - opol = [ox{1}', oy{1}']; - assert (size (opol), [15, 2]); - assert (polygonArea (opol), 14); -***** test - opol = polybool (3, cpol, ipol); - assert (size (opol), [9, 2]); - assert (polygonArea (opol), 16); -***** test - [ox, oy] = polybool (3, ix, iy, cx, cy); - opol = [ox{1}', oy{1}']; - assert (size (opol), [9, 2]); - assert (polygonArea (opol), 16); -***** error polybool ("a", 1, 2, 3 ,4); -***** error polybool (-1, 1, 2); -***** error polybool (-1, [1 1; 2 2; 3 3], [2 2; 3 3; 4 4]); -***** error polybool (1, [0 0 0; 2 2 2; 5 5 5], [1 1 1; 3 3 3]); -***** error polybool (1, [0 0 0; 2 2 2; 5 5 5], [1 1 1; 3 3 3; 6 6 7]); -***** error polybool (1, {1, 2}, [1, 2]); -***** error polybool (1, {[1, 2, 3]}, {[1, 2, 3, 4]}); -***** error polybool (1, {[1, 2, 3]}, {[1, 2, 3]}, {[1, 2, 3]}, {[1, 2, 4, 5]}); -***** error polybool ('z', {[1, 2, 3]}, {[1, 2, 3]}, {[1, 2, 3]}, {[1, 2, 4]}); -***** error polybool (1, [1 1; 2 2; 3 3], [2 2; 3 3; 4 4], "abc") -19 tests, 19 passed, 0 known failure, 0 skipped -[inst/ispolyccw.m] ->>>>> /build/octave-geometry-4.0.0/inst/ispolyccw.m -***** shared pccw, pcw, ph - pccw = pcw = [0 0; 1 0; 1 1; 0 1]; - pcw([2 4],:) = pcw([4 2], :); - ph = [pccw; nan(1,2); 0.5*pcw+[0.25 0.25]]; -***** assert (ispolyccw (pccw)); -***** assert (~ispolyccw (pcw)); -***** assert (ispolyccw ({pccw;pcw}), {true false}); -***** assert (ispolyccw(ph),[true;false]); -***** test - phcw = [pcw; nan(1,2); 0.5*pccw+[0.25 0.25]]; - assert (ispolyccw(phcw),[false;true]); -***** test - x=[0 0 2 2 NaN 0 2 0]; y=[0 2 2 0 NaN 0 0 3]; - assert(ispolyccw(x,y),[false;true]); -6 tests, 6 passed, 0 known failure, 0 skipped -[inst/joinPolygons.m] ->>>>> /build/octave-geometry-4.0.0/inst/joinPolygons.m -***** test - assert (joinPolygons ({1,2}), [1 2]); -***** test - assert (joinPolygons ({}), []); -***** test - XY = joinPolygons ({[1 6; 2 5; 3 4]; [4 3; 5 2; 6 1]}); - assert (XY, [1 6; 2 5; 3 4; NaN NaN; 4 3; 5 2; 6 1]); -***** error joinPolygons ([1 2 NaN 3 4]) -***** error joinPolygons ({[1,0], [0,2]}); -5 tests, 5 passed, 0 known failure, 0 skipped [inst/shapeCentroid.m] >>>>> /build/octave-geometry-4.0.0/inst/shapeCentroid.m ***** demo # non-convex bezier shape @@ -3616,24 +3469,6 @@ vn = shapeCentroid (nshape)(:); assert(vn,[0; 0],1e-2); 6 tests, 6 passed, 0 known failure, 0 skipped -[inst/ispolycw.m] ->>>>> /build/octave-geometry-4.0.0/inst/ispolycw.m -***** shared pccw, pcw, ph - pccw = pcw = [0 0; 1 0; 1 1; 0 1]; - pcw([2 4],:) = pcw([4 2], :); - ph = [pccw; nan(1,2); 0.5*pcw+[0.25 0.25]]; -***** assert (~ispolycw (pccw)); -***** assert (ispolycw (pcw)); -***** assert (ispolycw ({pccw;pcw}), [false;true]); -***** assert (ispolycw ({pccw,pcw}), [false,true]); -***** assert (ispolycw(ph),[false;true]); -***** test - phcw = [pcw; nan(1,2); 0.5*pccw+[0.25 0.25]]; - assert (ispolycw(phcw),[true;false]); -***** test - x=[0 0 2 2 NaN 0 2 0]; y=[0 2 2 0 NaN 0 0 3]; - assert(ispolycw(x,y),[true;false]); -7 tests, 7 passed, 0 known failure, 0 skipped [inst/plotShape.m] >>>>> /build/octave-geometry-4.0.0/inst/plotShape.m ***** demo @@ -3666,54 +3501,71 @@ ***** test plotShape (s,'-om', 'tol', 1e-4, 'tol', 1e-2);close; 7 tests, 7 passed, 0 known failure, 0 skipped -[inst/polysplit.m] ->>>>> /build/octave-geometry-4.0.0/inst/polysplit.m +[inst/polybool.m] +>>>>> /build/octave-geometry-4.0.0/inst/polybool.m +***** shared ipol, cpol, ix, iy, cx, cy, xi, yi, xc, yc + ipol = [0 0; 3 0; 3 3; 0 3; 0 0]; + cpol = [2, 1; 5, 1; 5, 4; 2, 4; 2, 1]; + ix = {ipol(:, 1)'}; + iy = {ipol(:, 2)'}; + cx = {cpol(:, 1)'}; + cy = {cpol(:, 2)'}; + xi = {ipol(:, 1)}; + yi = {ipol(:, 2)}; + xc = {cpol(:, 1)}; + yc = {cpol(:, 2)}; ***** test - x=[1 ;2 ;NaN ;3 ;4]; y=[4 ;3 ;NaN ;2 ;1]; - [cellx,celly]=polysplit(x,y); - assert (cellx, {[1; 2];[3; 4]}); - assert (celly, {[4; 3];[2; 1]}); + opol = polybool (0, ipol, cpol); + assert (size (opol), [7, 2]); + assert (polygonArea (opol), 7); ***** test - x=[1 2 NaN 3 4]; y=[4 3 NaN 2 1]; - [cellx,celly]=polysplit(x,y); - assert (cellx, {[1 2];[3 4]}); - assert (celly, {[4 3];[2 1]}); + [ox, oy] = polybool (0, ix, iy, cx, cy); + opol = [ox{1}', oy{1}']; + assert (size (opol), [7, 2]); + assert (polygonArea (opol), 7); ***** test - x=[0 ;2 ;2 ;0 ;0 ;NaN ;NaN]; y=[0 ;0 ;3 ;3 ;0 ;NaN ;NaN]; - [cellx,celly]=polysplit(x,y); - assert (cellx, {[0 ;2 ;2 ;0 ;0]}); - assert (celly, {[0 ;0 ;3 ;3 ;0]}); -3 tests, 3 passed, 0 known failure, 0 skipped -[inst/shapeArea.m] ->>>>> /build/octave-geometry-4.0.0/inst/shapeArea.m -***** demo # non-convex piece-wise polynomial shape - boomerang = {[ 0 -2 1; ... - -4 4 0]; ... - [0.25 -1; ... - 0 0]; ... - [ 0 1.5 -0.75; ... - -3 3 0]; - [0.25 0.75; ... - 0 0]}; - A = shapeArea (boomerang) + [ox, oy] = polybool (0, xi, yi, xc, yc); + opol = [ox{1}, oy{1}]; + assert (size (opol), [7, 2]); + assert (polygonArea (opol), 7); ***** test - warning('off', 'geom2d:cw-shape', 'local'); - triangle = {[1 0; 0 0]; [-0.5 1; 1 0]; [-0.5 0.5; -1 1]}; - A = shapeArea (triangle); - assert (0.5, A); + opol = polybool (1, cpol, ipol); + assert (size (opol), [5, 2]); + assert (polygonArea (opol), 2); ***** test - warning('off', 'geom2d:cw-shape', 'local'); - circle = {[1.715729 -6.715729 0 5; ... - -1.715729 -1.568542 8.284271 0]; ... - [1.715729 1.568542 -8.284271 0; ... - 1.715729 -6.715729 0 5]; ... - [-1.715729 6.715729 0 -5; ... - 1.715729 1.568542 -8.284271 0]; ... - [-1.715729 -1.568542 8.284271 0; ... - -1.715729 6.715729 0 -5]}; - A = shapeArea (circle); - assert (pi*5^2, A, 5e-2); -2 tests, 2 passed, 0 known failure, 0 skipped + [ox, oy] = polybool (1, ix, iy, cx, cy); + opol = [ox{1}', oy{1}']; + assert (size (opol), [5, 2]); + assert (polygonArea (opol), 2); +***** test + opol = polybool (2, cpol, ipol); + assert (size (opol), [15, 2]); + assert (polygonArea (opol), 14); +***** test + [ox, oy] = polybool (2, ix, iy, cx, cy); + opol = [ox{1}', oy{1}']; + assert (size (opol), [15, 2]); + assert (polygonArea (opol), 14); +***** test + opol = polybool (3, cpol, ipol); + assert (size (opol), [9, 2]); + assert (polygonArea (opol), 16); +***** test + [ox, oy] = polybool (3, ix, iy, cx, cy); + opol = [ox{1}', oy{1}']; + assert (size (opol), [9, 2]); + assert (polygonArea (opol), 16); +***** error polybool ("a", 1, 2, 3 ,4); +***** error polybool (-1, 1, 2); +***** error polybool (-1, [1 1; 2 2; 3 3], [2 2; 3 3; 4 4]); +***** error polybool (1, [0 0 0; 2 2 2; 5 5 5], [1 1 1; 3 3 3]); +***** error polybool (1, [0 0 0; 2 2 2; 5 5 5], [1 1 1; 3 3 3; 6 6 7]); +***** error polybool (1, {1, 2}, [1, 2]); +***** error polybool (1, {[1, 2, 3]}, {[1, 2, 3, 4]}); +***** error polybool (1, {[1, 2, 3]}, {[1, 2, 3]}, {[1, 2, 3]}, {[1, 2, 4, 5]}); +***** error polybool ('z', {[1, 2, 3]}, {[1, 2, 3]}, {[1, 2, 3]}, {[1, 2, 4]}); +***** error polybool (1, [1 1; 2 2; 3 3], [2 2; 3 3; 4 4], "abc") +19 tests, 19 passed, 0 known failure, 0 skipped [inst/isPolygonCCW.m] >>>>> /build/octave-geometry-4.0.0/inst/isPolygonCCW.m ***** shared pccw, pcw, pxccw, pyccw, pxnan, pynan, pnan @@ -3739,61 +3591,252 @@ ***** xtest assert (isPolygonCCW(pnan,[],"clipper"), [true; false]); ***** xtest assert (isPolygonCCW({pnan,pcw},[],"clipper"),{[true; false], false}); 14 tests, 14 passed, 0 known failure, 0 skipped -[inst/orientPolygon.m] ->>>>> /build/octave-geometry-4.0.0/inst/orientPolygon.m -***** shared pccw, pcw, pxccw, pyccw, pxnan, pynan, pnan - pccw = [0 0; 1 0; 1 1; 0 1]; - pcw = reversePolygon (pccw); - pxccw = pccw(:,1); - pyccw = pccw(:,2); - pxnan = [2; 2; 0; 0; NaN; 0; 0; 2]; - pynan = [0; 2; 2; 0; NaN; 0; 3; 0]; - pnan = [pxnan pynan]; +[inst/polygon2shape.m] +>>>>> /build/octave-geometry-4.0.0/inst/polygon2shape.m ***** test - x = orientPolygon (pccw,[],"ccw"); - assert (x, pccw); + pp = [0 0; 1 0; 1 1; 0 1]; + s = polygon2shape (pp); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/ispolycw.m] +>>>>> /build/octave-geometry-4.0.0/inst/ispolycw.m +***** shared pccw, pcw, ph + pccw = pcw = [0 0; 1 0; 1 1; 0 1]; + pcw([2 4],:) = pcw([4 2], :); + ph = [pccw; nan(1,2); 0.5*pcw+[0.25 0.25]]; +***** assert (~ispolycw (pccw)); +***** assert (ispolycw (pcw)); +***** assert (ispolycw ({pccw;pcw}), [false;true]); +***** assert (ispolycw ({pccw,pcw}), [false,true]); +***** assert (ispolycw(ph),[false;true]); ***** test - x = orientPolygon (pccw,[],"cw"); - assert (x, pcw); + phcw = [pcw; nan(1,2); 0.5*pccw+[0.25 0.25]]; + assert (ispolycw(phcw),[true;false]); ***** test - x = orientPolygon (pcw,[],"ccw"); - assert (x, pccw); + x=[0 0 2 2 NaN 0 2 0]; y=[0 2 2 0 NaN 0 0 3]; + assert(ispolycw(x,y),[true;false]); +7 tests, 7 passed, 0 known failure, 0 skipped +[inst/ispolyccw.m] +>>>>> /build/octave-geometry-4.0.0/inst/ispolyccw.m +***** shared pccw, pcw, ph + pccw = pcw = [0 0; 1 0; 1 1; 0 1]; + pcw([2 4],:) = pcw([4 2], :); + ph = [pccw; nan(1,2); 0.5*pcw+[0.25 0.25]]; +***** assert (ispolyccw (pccw)); +***** assert (~ispolyccw (pcw)); +***** assert (ispolyccw ({pccw;pcw}), {true false}); +***** assert (ispolyccw(ph),[true;false]); ***** test - x = orientPolygon (pcw,[],"cw"); - assert (x, pcw); + phcw = [pcw; nan(1,2); 0.5*pccw+[0.25 0.25]]; + assert (ispolyccw(phcw),[false;true]); ***** test - x = orientPolygon (pnan,[],"cw"); - y = splitPolygons (pnan); - y = joinPolygons ({reversePolygon(y{1}); y{2}}); - assert (x, y); + x=[0 0 2 2 NaN 0 2 0]; y=[0 2 2 0 NaN 0 0 3]; + assert(ispolyccw(x,y),[false;true]); +6 tests, 6 passed, 0 known failure, 0 skipped +[inst/poly2ccw.m] +>>>>> /build/octave-geometry-4.0.0/inst/poly2ccw.m ***** test - x = orientPolygon (pnan,[],"ccw"); - y = splitPolygons (pnan); - y = joinPolygons ({y{1}; reversePolygon(y{2})}); - assert (x, y); + x = [0 0 1 1 0]; y = [0 1 1 0 0]; + [xccw,yccw] = poly2ccw(x,y); + xexp = [0; 1; 1; 0; 0]; yexp = [0; 0; 1; 1; 0]; + assert (xccw,xexp); + assert (yccw,yexp); ***** test - [x y] = orientPolygon (pxccw,pyccw,"ccw"); - assert ([x y], pccw); + x=[0 0 2 2 NaN 0 2 0]; y=[0 2 2 0 NaN 0 0 3]; + [xccw,yccw]=poly2ccw(x,y); + xexp=[0; 2; 2; 0; NaN; 0; 2; 0]; + yexp=[0; 0; 2; 2; NaN; 0; 0; 3]; + assert (xccw,xexp); + assert (yccw,yexp); +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/clipPolygon_mrf.m] +>>>>> /build/octave-geometry-4.0.0/inst/clipPolygon_mrf.m ***** test - [x y] = orientPolygon (pxccw,pyccw,"cw"); - assert ([x y], pcw); -8 tests, 8 passed, 0 known failure, 0 skipped -[inst/poly2cw.m] ->>>>> /build/octave-geometry-4.0.0/inst/poly2cw.m + pol1 = [-0.15 -0.15; 0.45 -0.15; 0.15 0.45]; + pol2 = [-0.05 -0.05; 0.15 0.35; 0.35 -0.05; NaN NaN; + 0.05 0.05; 0.25 0.05; 0.15 0.25]; + opol_0 = [0.15 0.25; 0.05 0.05; 0.25 0.05; NaN NaN; + 0.15 0.35; -0.05 -0.05; 0.35 -0.05; NaN NaN; + 0.15 0.45; -0.15 -0.15; 0.45 -0.15]; + npol_0 = 3; + opol_1= [0.15 0.25; 0.05 0.05; 0.25 0.05; NaN NaN; + 0.15 0.35; -0.05 -0.05; 0.35 -0.05]; + npol_1 = 2; + opol_2 = [0.15 0.25; 0.05 0.05; 0.25 0.05; NaN NaN; + 0.15 0.35; -0.05 -0.05; 0.35 -0.05; NaN NaN; + 0.15 0.45; -0.15 -0.15; 0.45 -0.15]; + npol_2 = 3; + opol_3 = [0.15 0.45; -0.15 -0.15; 0.45 -0.15]; + npol_3 = 1; + [opol npol] = clipPolygon_mrf (pol1, pol2, 0); + assert(opol, opol_0); + assert(npol, npol_0); + [opol npol] = clipPolygon_mrf (pol1, pol2, 1); + assert(opol, opol_1); + assert(npol, npol_1); + [opol npol] = clipPolygon_mrf (pol1, pol2, 2); + assert(opol, opol_2); + assert(npol, npol_2); + [opol npol] = clipPolygon_mrf (pol1, pol2, 3); + assert(opol, opol_3); + assert(npol, npol_3); +***** error clipPolygon_mrf([], [], 0); +***** error + pol1 = [0.15 0.15; 0.55 0.45; 0.15 0.75]; + pol2 = [0.35 0.45; 0.75 0.15; 0.75 0.75]; + clipPolygon_mrf(pol1, pol2, 4); +***** test ## Bug #56506 + subpol = [0 0; 5 5; 2.5 4;0 0]; + clppol2 = [10 1; 16 6; 13.5 5; 10 1]; + [a, b] = clipPolygon_mrf (subpol, clppol2, 1); + assert (a, []); + assert (b, 0); +***** demo + pol1 = [0.15 0.15; 0.55 0.45; 0.15 0.75]; + pol2 = [0.35 0.45; 0.75 0.15; 0.75 0.75]; + pol1a = polygon2patch(pol1); + pol2a = polygon2patch(pol2); + lw = 2; + subplot (2, 6, [2 3]) + patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'k', 'linewidth', lw); + axis image + grid on + title ("1. Subject polygon") + + subplot (2, 6, [4 5]) + patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'none'); + hold on + patch (pol2a(:, 1), pol2a(:, 2), 'facecolor', 'y', 'edgecolor', 'b', 'linewidth', lw); + axis image + grid on + title "2. Clip polygon" + + op = {"Sub -clip", "AND / Intersection", "Exclusive OR", "OR / Union"}; + for i=1:numel(op) + subplot (6, 4, [12 16]+i); + [opol, npol] = clipPolygon_mrf (pol1, pol2, i-1); + opol = polygon2patch (opol); + patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'none'); + hold on + patch (pol2a(:, 1), pol2a(:, 2), 'facecolor', 'y', 'edgecolor', 'none'); + patch (opol(:,1),opol(:,2), 'facecolor', 'g', 'edgecolor', 'r', ... + 'linewidth', lw); + axis image + grid on + title (sprintf("%d. %s", i+2, op{i})); + axis off + endfor + + subplot (10, 4, 37); + [opol, npol] = clipPolygon_mrf (pol2, pol1, 0); + opol = polygon2patch (opol); + patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'none'); + hold on + patch (pol2a(:, 1), pol2a(:, 2), 'facecolor', 'y', 'edgecolor', 'none'); + patch (opol(:,1),opol(:,2), 'facecolor', 'g', 'edgecolor', 'r', ... + 'linewidth', lw); + axis image + grid on + axis off + title "7. Clip - sub"; +***** demo + pol1 = [1 1; 5 1; 3 7; NaN NaN; 2 2; 3 5; 4 2]; + pol2 = [3 1; 5 6; 1 6]; + pol1a = polygon2patch(pol1); + pol2a = polygon2patch(pol2); + lw = 2; + subplot (2, 6, [2 3]) + patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'k', 'linewidth', lw); + axis image + grid on + title ("1. Subject polygon") + + subplot (2, 6, [4 5]) + patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'none'); + hold on + patch (pol2a(:, 1), pol2a(:, 2), 'facecolor', 'y', 'edgecolor', 'b', 'linewidth', lw); + axis image + grid on + title "2. Clip polygon" + + op = {"Sub -clip", "AND / Intersection", "Exclusive OR", "OR / Union"}; + for i=1:numel(op) + subplot (6, 4, [12 16]+i); + [opol, npol] = clipPolygon_mrf (pol1, pol2, i-1); + opol = polygon2patch (opol); + patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'none'); + hold on + patch (pol2a(:, 1), pol2a(:, 2), 'facecolor', 'y', 'edgecolor', 'none'); + patch (opol(:,1),opol(:,2), 'facecolor', 'g', 'edgecolor', 'r', ... + 'linewidth', lw); + axis image + grid on + title (sprintf("%d. %s", i+2, op{i})); + axis off + endfor + + subplot (10, 4, 37); + [opol, npol] = clipPolygon_mrf (pol2, pol1, 0); + opol = polygon2patch (opol); + patch (pol1a(:, 1), pol1a(:, 2), 'facecolor', 'c', 'edgecolor', 'none'); + hold on + patch (pol2a(:, 1), pol2a(:, 2), 'facecolor', 'y', 'edgecolor', 'none'); + patch (opol(:,1),opol(:,2), 'facecolor', 'g', 'edgecolor', 'r', ... + 'linewidth', lw); + axis image + grid on + axis off + title "7. Clip - sub"; +4 tests, 4 passed, 0 known failure, 0 skipped +[inst/joinPolygons.m] +>>>>> /build/octave-geometry-4.0.0/inst/joinPolygons.m ***** test - x = [0; 1; 1; 0; 0]; y = [0; 0; 1; 1; 0]; - [xcw,ycw] = poly2cw(x,y); - xexp = [0; 0; 1; 1; 0]; yexp = [0; 1; 1; 0; 0]; - assert (xcw,xexp); - assert (ycw,yexp); + assert (joinPolygons ({1,2}), [1 2]); ***** test - x=[0 0 2 2 NaN 0 2 0]; y=[0 2 2 0 NaN 0 0 3]; - [xcw,ycw]=poly2cw(x,y); - xexp=[0; 0; 2; 2; NaN; 0; 0; 2]; - yexp=[0; 2; 2; 0; NaN; 0; 3; 0]; - assert (xcw,xexp); - assert (ycw,yexp); -2 tests, 2 passed, 0 known failure, 0 skipped + assert (joinPolygons ({}), []); +***** test + XY = joinPolygons ({[1 6; 2 5; 3 4]; [4 3; 5 2; 6 1]}); + assert (XY, [1 6; 2 5; 3 4; NaN NaN; 4 3; 5 2; 6 1]); +***** error joinPolygons ([1 2 NaN 3 4]) +***** error joinPolygons ({[1,0], [0,2]}); +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/polyjoin.m] +>>>>> /build/octave-geometry-4.0.0/inst/polyjoin.m +***** demo + x = {[1 2]'; [3 4]'} + y = {[10 20]'; [30 40]'} + [vecx, vecy] = polyjoin (x, y) +***** test + x = {[1 2]'; [3 4]'}; y = {[10 20]'; [30 40]'}; + [vecx, vecy] = polyjoin (x, y); + assert (vecx, [1; 2; NaN; 3; 4]); + assert (vecy, [10; 20; NaN; 30; 40]); +***** test + x = {[1;2]; [3;4]; [3]}; y = {[10;20]; [30;40]; [10]}; + [vecx, vecy] = polyjoin (x, y); + assert (vecx, [1; 2; NaN; 3; 4; NaN; 3]); + assert (vecy, [10; 20; NaN; 30; 40; NaN; 10]); +***** test + x = {[1 2 3]'; 4; [5 6 7 8 NaN 9]'}; + y = {[9 8 7]'; 6; [5 4 3 2 NaN 1]'}; + [vecx, vecy] = polyjoin (x, y); + assert (vecx, [1; 2; 3; NaN; 4; NaN; 5; 6; 7; 8; NaN; 9]); + assert (vecy, [9; 8; 7; NaN; 6; NaN; 5; 4; 3; 2; NaN; 1]); +***** test + xyi = {[0 0; 0 10; 10, 10; 10, 0; 0, 0]; [1 5; 2 5; 2 6; 1 6; 1 5]}; + xyo = polyjoin (xyi); + assert (polyjoin (xyi), [0 0; 0 10; 10 10; 10 0; 0 0; NaN, NaN; 1 5; 2 5; 2 6; 1 6; 1 5], eps); +***** test + xyi = {[0 0 1; 0 10 2; 10, 10 3; 10, 0 2; 0, 0 1]; [1 5 1.5; 2 5 2; 2 6 2.5; 1 6 2; 1 5 1.5]}; + xyo = polyjoin (xyi); + assert (polyjoin (xyi), [0 0 1; 0 10 2; 10 10 3; 10 0 2; 0 0 1; NaN, NaN NaN; 1 5 1.5; 2 5 2; 2 6 2.5; 1 6 2; 1 5 1.5], eps); +***** test + assert (polyjoin ({[2, 3]}), [2, 3], eps); +***** error polyjoin (1); +***** error polyjoin ({2}); +***** error polyjoin ({2, 3}); +***** error polyjoin ({1; 2}, [3 4]); +***** warning polyjoin ({1; 2}, {3 4}); +11 tests, 11 passed, 0 known failure, 0 skipped Checking C++ files ... Summary: 103 tests, 102 passed, 1 known failures, 0 skipped dh_installdocs -O--buildsystem=octave @@ -3834,12 +3877,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/11924/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/11924/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/1677 and its subdirectories -I: Current time: Mon Jun 5 08:14:26 -12 2023 -I: pbuilder-time-stamp: 1685996066 +I: removing directory /srv/workspace/pbuilder/11924 and its subdirectories +I: Current time: Tue Jun 6 10:20:52 +14 2023 +I: pbuilder-time-stamp: 1685996452