Diff of the two buildlogs: -- --- b1/build.log 2024-12-20 22:05:46.137093949 +0000 +++ b2/build.log 2024-12-20 22:11:04.930658481 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Fri Dec 20 10:00:21 -12 2024 -I: pbuilder-time-stamp: 1734732021 +I: Current time: Sat Dec 21 12:05:59 +14 2024 +I: pbuilder-time-stamp: 1734732359 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/trixie-reproducible-base.tgz] I: copying local configuration @@ -26,52 +26,84 @@ dpkg-source: info: unpacking octave-geometry_4.1.0-1.debian.tar.xz I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/10286/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/32685/tmp/hooks/D01_modify_environment starting +debug: Running on virt64z. +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 Dec 20 22:06 /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/32685/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/32685/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='trixie' - 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]="37" [3]="1" [4]="release" [5]="arm-unknown-linux-gnueabihf") + BASH_VERSION='5.2.37(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=trixie + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=arm + HOST_ARCH=armhf IFS=' ' - INVOCATION_ID='37b7d73ed2cd490f9b006de61815c13c' - 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='10286' - PS1='# ' - PS2='> ' + INVOCATION_ID=a9748fb3b31d41b18a1f5e5e8d56022e + 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=32685 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.ymSgINHw/pbuilderrc_Lcsp --distribution trixie --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.ymSgINHw/b1 --logfile b1/build.log octave-geometry_4.1.0-1.dsc' - SUDO_GID='113' - SUDO_UID='107' - 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.ymSgINHw/pbuilderrc_MoNz --distribution trixie --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.ymSgINHw/b2 --logfile b2/build.log octave-geometry_4.1.0-1.dsc' + SUDO_GID=110 + SUDO_UID=103 + 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 virt32c 6.1.0-28-armmp-lpae #1 SMP Debian 6.1.119-1 (2024-11-22) armv7l GNU/Linux + Linux i-capture-the-hostname 6.1.0-28-arm64 #1 SMP Debian 6.1.119-1 (2024-11-22) aarch64 GNU/Linux I: ls -l /bin lrwxrwxrwx 1 root root 7 Nov 22 14:40 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/10286/tmp/hooks/D02_print_environment finished +I: user script /srv/workspace/pbuilder/32685/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -651,7 +683,7 @@ Get: 534 http://deb.debian.org/debian trixie/main armhf libxslt1.1 armhf 1.1.35-1.1+b1 [212 kB] Get: 535 http://deb.debian.org/debian trixie/main armhf octave-matgeom all 1.2.4-2 [427 kB] Get: 536 http://deb.debian.org/debian trixie/main armhf python3-lxml armhf 5.3.0-1+b1 [1468 kB] -Fetched 183 MB in 8s (24.3 MB/s) +Fetched 183 MB in 19s (9777 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libpython3.12-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 ... 19674 files and directories currently installed.) @@ -2405,8 +2437,8 @@ Setting up tzdata (2024b-4) ... Current default time zone: 'Etc/UTC' -Local time is now: Fri Dec 20 22:02:56 UTC 2024. -Universal Time is now: Fri Dec 20 22:02:56 UTC 2024. +Local time is now: Fri Dec 20 22:08:39 UTC 2024. +Universal Time is now: Fri Dec 20 22:08:39 UTC 2024. Run 'dpkg-reconfigure tzdata' if you wish to change it. Setting up libxcb-present0:armhf (1.17.0-2+b1) ... @@ -2858,7 +2890,11 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/reproducible-path/octave-geometry-4.1.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.1.0-1_source.changes +I: user script /srv/workspace/pbuilder/32685/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for trixie +I: user script /srv/workspace/pbuilder/32685/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/reproducible-path/octave-geometry-4.1.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.1.0-1_source.changes dpkg-buildpackage: info: source package octave-geometry dpkg-buildpackage: info: source version 4.1.0-1 dpkg-buildpackage: info: source distribution unstable @@ -2896,8 +2932,8 @@ make[1]: Entering directory '/build/reproducible-path/octave-geometry-4.1.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 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-9.2.0/octave/.. -I/usr/include/octave-9.2.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-geometry-4.1.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -g -Wall -I. -DMEX_DEBUG clipper.cpp -o /tmp/oct-kody0S.o /usr/bin/mkoctfile --verbose -c martinez.cpp -o martinez.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-9.2.0/octave/.. -I/usr/include/octave-9.2.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-geometry-4.1.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -g -Wall -I. -DMEX_DEBUG clipper.cpp -o /tmp/oct-zROVOr.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-9.2.0/octave/.. -I/usr/include/octave-9.2.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-geometry-4.1.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security connector.cpp -o connector.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-9.2.0/octave/.. -I/usr/include/octave-9.2.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-geometry-4.1.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security martinez.cpp -o martinez.o /usr/bin/mkoctfile --verbose -c polygon.cpp -o polygon.o @@ -2986,7 +3022,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 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-9.2.0/octave/.. -I/usr/include/octave-9.2.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-geometry-4.1.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security polybool_mrf.cc -o /tmp/oct-gvj6b1.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-9.2.0/octave/.. -I/usr/include/octave-9.2.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-geometry-4.1.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security polybool_mrf.cc -o /tmp/oct-6MFjR9.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 @@ -3004,9 +3040,9 @@ /usr/include/c++/14/bits/stl_function.h:131:12: note: declared here 131 | struct binary_function | ^~~~~~~~~~~~~~~ -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-9.2.0/octave/.. -I/usr/include/octave-9.2.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-geometry-4.1.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -g -Wall -I. -DMEX_DEBUG mexclipper.cpp -o /tmp/oct-nmNVYx.o -g++ -I/usr/include/octave-9.2.0/octave/.. -I/usr/include/octave-9.2.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-geometry-4.1.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -g -Wall -o clipper.mex /tmp/oct-zROVOr.o /tmp/oct-nmNVYx.o -shared -Wl,-Bsymbolic -Wl,-z,relro -flto=auto -ffat-lto-objects -Wl,-z,relro -g++ -I/usr/include/octave-9.2.0/octave/.. -I/usr/include/octave-9.2.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-geometry-4.1.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o polybool_mrf.oct connector.o martinez.o polygon.o utilities.o /tmp/oct-gvj6b1.o -shared -Wl,-Bsymbolic -Wl,-z,relro -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-9.2.0/octave/.. -I/usr/include/octave-9.2.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-geometry-4.1.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -g -Wall -I. -DMEX_DEBUG mexclipper.cpp -o /tmp/oct-lhmzf3.o +g++ -I/usr/include/octave-9.2.0/octave/.. -I/usr/include/octave-9.2.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-geometry-4.1.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -o polybool_mrf.oct connector.o martinez.o polygon.o utilities.o /tmp/oct-6MFjR9.o -shared -Wl,-Bsymbolic -Wl,-z,relro -flto=auto -ffat-lto-objects -Wl,-z,relro +g++ -I/usr/include/octave-9.2.0/octave/.. -I/usr/include/octave-9.2.0/octave -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-geometry-4.1.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -g -Wall -o clipper.mex /tmp/oct-kody0S.o /tmp/oct-lhmzf3.o -shared -Wl,-Bsymbolic -Wl,-z,relro -flto=auto -ffat-lto-objects -Wl,-z,relro make[1]: Leaving directory '/build/reproducible-path/octave-geometry-4.1.0/src' copyfile /build/reproducible-path/octave-geometry-4.1.0/./src/polybool_mrf.oct /build/reproducible-path/octave-geometry-4.1.0/./src/clipper.mex /build/reproducible-path/octave-geometry-4.1.0/./inst/arm-unknown-linux-gnueabihf-api-v59 For information about changes from previous versions of the geometry package, run 'news geometry'. @@ -3014,145 +3050,30 @@ Checking package... Run the unit tests... Checking m files ... -[inst/clipPolygon_mrf.m] ->>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/clipPolygon_mrf.m +[inst/polygon2shape.m] +>>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/polygon2shape.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 + pp = [0 0; 1 0; 1 1; 0 1]; + s = polygon2shape (pp); +1 test, 1 passed, 0 known failure, 0 skipped +[inst/polysplit.m] +>>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/polysplit.m +***** 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]}); +***** 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]}); +***** 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/polybool.m] >>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/polybool.m ***** shared ipol, cpol, ix, iy, cx, cy, xi, yi, xc, yc @@ -3218,110 +3139,6 @@ ***** 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/joinPolygons.m] ->>>>> /build/reproducible-path/octave-geometry-4.1.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], [56 NaN 78]) -***** error joinPolygons ({[1,0], [0,2]}); -5 tests, 5 passed, 0 known failure, 0 skipped -[inst/poly2cw.m] ->>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/poly2cw.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); -***** 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 -[inst/isPolygonCCW.m] ->>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/isPolygonCCW.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]; -***** assert (isPolygonCCW (pccw)); -***** assert (isPolygonCCW (pxccw, pyccw)); -***** assert (isPolygonCCW ({pxccw, pxccw}, {pyccw, pyccw}), {true, true}); -***** assert (~isPolygonCCW (pcw)); -***** assert (isPolygonCCW ({pccw;pcw}), {true;false}); -***** assert (isPolygonCCW(pnan), [true; false]); -***** assert (isPolygonCCW({pnan,pcw}),{[true;false], false}); -***** assert (isPolygonCCW (pccw,[],"clipper")); -***** assert (isPolygonCCW (pxccw, pyccw,"clipper")); -***** assert (isPolygonCCW ({pxccw, pxccw}, {pyccw, pyccw},"clipper"), {true, true}); -***** assert (~isPolygonCCW (pcw,[],"clipper")); -***** assert (isPolygonCCW ({pccw;pcw},[],"clipper"), {true;false}); -***** 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/clipPolygon.m] ->>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/clipPolygon.m -***** error clipPolygon([],[],[],'abracadabra') -***** error clipPolygon([0 0; 0 1; 0.5 1],[-1 -1; -1 1; 0 1],'no-op') -***** demo - pol1 = [2 2; 6 2; 6 6; 2 6; 2 2; NaN NaN; 3 3; 3 5; 5 5; 5 3; 3 3]; - pol2 = [1 2; 7 4; 4 7; 1 2; NaN NaN; 2.5 3; 5.5 4; 4 5.5; 2.5 3]; - - subplot (3, 3, 1) - drawFilledPolygon (pol1, 'edgecolor', 'k', 'facecolor', 'c') - axis image - title ('1. Subject polygon') - axis off - - subplot (3, 3, 2) - drawFilledPolygon (pol1, 'linestyle', 'none', 'facecolor', 'c') - drawFilledPolygon (pol2, 'edgecolor', 'b', 'facecolor', 'y') - axis image - title ('2. Clip polygon') - axis off - - algo = {'clipper', 'mrf'}; - for i = 1:numel (algo) - subplot (3, 3, i+2); - tic - [opol, npol] = clipPolygon (pol1, pol2, 3, 'clipper'); - printf('%s took: %f seconds (union)\n', algo{i}, toc); - drawFilledPolygon (opol, 'edgecolor', 'r', 'facecolor', 'g') - axis image - title (sprintf('Union - %s', algo{i})); - axis off - - subplot (3, 3, i+4); - tic - [opol, npol] = clipPolygon (pol1, pol2, 1, 'clipper'); - printf('%s took: %f seconds (and)\n', algo{i}, toc); - drawFilledPolygon (opol, 'edgecolor', 'r', 'facecolor', 'g') - axis image - title (sprintf('And - %s', algo{i})); - axis off - - subplot (3, 3, i+6); - tic - [opol, npol] = clipPolygon (pol1, pol2, 2, 'clipper'); - printf('%s took: %f seconds (xor)\n', algo{i}, toc); - drawFilledPolygon (opol, 'edgecolor', 'r', 'facecolor', 'g') - axis image - title (sprintf('Xor - %s', algo{i})); - axis off - endfor -2 tests, 2 passed, 0 known failure, 0 skipped [inst/poly2ccw.m] >>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/poly2ccw.m ***** test @@ -3338,94 +3155,6 @@ assert (xccw,xexp); assert (yccw,yexp); 2 tests, 2 passed, 0 known failure, 0 skipped -[inst/polygon2shape.m] ->>>>> /build/reproducible-path/octave-geometry-4.1.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/@svg/svg.m] ->>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/@svg/svg.m -***** xtest - dc = svg('drawing5.svg'); - dc.getpath(); - dc.pathid(); - dc.getpath('path3756'); -***** xtest - dc = svg('drawing.svg'); - ids = dc.pathid(); - dc.getpath({ids{[1 3]}}); -***** xtest - dc = svg('drawing6.svg'); - ids = dc.pathid(); - P = dc.path2polygon(ids{1}); -!!!!! known failure -cat: dimension mismatch -***** xtest - dc = svg('drawing6.svg'); - dc.plot(); - dc.plot('color','r','linewidth',2); -warning: using the gnuplot graphics toolkit is discouraged - -The gnuplot graphics toolkit is not actively maintained and has a number -of limitations that are unlikely to be fixed. Communication with gnuplot -uses a one-directional pipe and limited information is passed back to the -Octave interpreter so most changes made interactively in the plot window -will not be reflected in the graphics properties managed by Octave. For -example, if the plot window is closed with a mouse click, Octave will not -be notified and will not update its internal list of open figure windows. -The qt toolkit is recommended instead. -4 tests, 3 passed, 1 known failure, 0 skipped -[inst/plotShape.m] ->>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/plotShape.m -***** demo - # Taylor series of cos(pi*x),sin(pi*x) - n = 5; N = 0:5; - s{1}(1,2:2:2*n+2) = fliplr ( (-1).^N .* (pi).^(2*N) ./ factorial (2*N)); - s{1}(2,1:2:2*n+1) = fliplr ( (-1).^N .* (pi).^(2*N+1) ./ factorial (2*N+1)); - - h(1) = plotShape (s, 'tol', 1e-1, 'color','b'); - h(2) = plotShape (s, 'tol', 1e-3, 'color', 'm'); - h(3) = plotShape (s, 'tol', 1e-9, 'color', 'g'); - legend (h, {'1e-1','1e-3','1e-9'}) - axis image -***** shared s - s = {[0.1 1; 1 0]}; -***** test - plotShape (s); close; -***** test - plotShape (s,'tol', 1e-4);close; -***** test - plotShape (s,'color', 'm', 'tol', 1e-4);close; -***** test - plotShape (s,'color', 'm', 'linewidth', 2, 'tol', 1e-4);close; -***** test - plotShape (s,'color', 'm', 'tol', 1e-4, 'linewidth', 2);close; -***** test - plotShape (s,'-om', 'tol', 1e-4, 'linewidth', 2);close; - plotShape (s,'tol', 1e-4, '-om', 'linewidth', 2);close; - plotShape (s,'-om', 'linewidth', 2, 'tol', 1e-4);close; -***** test - plotShape (s,'-om', 'tol', 1e-4, 'tol', 1e-2);close; -7 tests, 7 passed, 0 known failure, 0 skipped -[inst/polysplit.m] ->>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/polysplit.m -***** 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]}); -***** 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]}); -***** 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/shapeCentroid.m] >>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/shapeCentroid.m ***** demo # non-convex bezier shape @@ -3519,23 +3248,197 @@ vn = shapeCentroid (nshape)(:); assert(vn,[0; 0],1e-2); 6 tests, 6 passed, 0 known failure, 0 skipped -[inst/ispolyccw.m] ->>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/ispolyccw.m +[inst/@svg/svg.m] +>>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/@svg/svg.m +***** xtest + dc = svg('drawing5.svg'); + dc.getpath(); + dc.pathid(); + dc.getpath('path3756'); +***** xtest + dc = svg('drawing.svg'); + ids = dc.pathid(); + dc.getpath({ids{[1 3]}}); +***** xtest + dc = svg('drawing6.svg'); + ids = dc.pathid(); + P = dc.path2polygon(ids{1}); +!!!!! known failure +cat: dimension mismatch +***** xtest + dc = svg('drawing6.svg'); + dc.plot(); + dc.plot('color','r','linewidth',2); +warning: using the gnuplot graphics toolkit is discouraged + +The gnuplot graphics toolkit is not actively maintained and has a number +of limitations that are unlikely to be fixed. Communication with gnuplot +uses a one-directional pipe and limited information is passed back to the +Octave interpreter so most changes made interactively in the plot window +will not be reflected in the graphics properties managed by Octave. For +example, if the plot window is closed with a mouse click, Octave will not +be notified and will not update its internal list of open figure windows. +The qt toolkit is recommended instead. +4 tests, 3 passed, 1 known failure, 0 skipped +[inst/clipPolygon_mrf.m] +>>>>> /build/reproducible-path/octave-geometry-4.1.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/ispolycw.m] +>>>>> /build/reproducible-path/octave-geometry-4.1.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 (ispolyccw (pccw)); -***** assert (~ispolyccw (pcw)); -***** assert (ispolyccw ({pccw;pcw}), {true false}); -***** assert (ispolyccw(ph),[true;false]); +***** assert (~ispolycw (pccw)); +***** assert (ispolycw (pcw)); +***** assert (ispolycw ({pccw;pcw}), [false;true]); +***** assert (ispolycw ({pccw,pcw}), [false,true]); +***** assert (ispolycw ({pccw(:, 1);pcw(:, 1)}, {pccw(:, 2);pcw(:, 2)}), [false;true]); +***** assert (ispolycw ({pccw(:, 1),pcw(:, 1)}, {pccw(:, 2),pcw(:, 2)}), [false,true]); +***** assert (ispolycw(ph),[false;true]); ***** test phcw = [pcw; nan(1,2); 0.5*pccw+[0.25 0.25]]; - assert (ispolyccw(phcw),[false;true]); + 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(ispolyccw(x,y),[false;true]); -6 tests, 6 passed, 0 known failure, 0 skipped + assert(ispolycw(x,y),[true;false]); +9 tests, 9 passed, 0 known failure, 0 skipped [inst/shapeArea.m] >>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/shapeArea.m ***** demo # non-convex piece-wise polynomial shape @@ -3643,26 +3546,63 @@ ***** error polyjoin ({1; 2}, [3 4]); ***** warning polyjoin ({1; 2}, {3 4}); 11 tests, 11 passed, 0 known failure, 0 skipped -[inst/ispolycw.m] ->>>>> /build/reproducible-path/octave-geometry-4.1.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 ({pccw(:, 1);pcw(:, 1)}, {pccw(:, 2);pcw(:, 2)}), [false;true]); -***** assert (ispolycw ({pccw(:, 1),pcw(:, 1)}, {pccw(:, 2),pcw(:, 2)}), [false,true]); -***** assert (ispolycw(ph),[false;true]); +[inst/isPolygonCCW.m] +>>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/isPolygonCCW.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]; +***** assert (isPolygonCCW (pccw)); +***** assert (isPolygonCCW (pxccw, pyccw)); +***** assert (isPolygonCCW ({pxccw, pxccw}, {pyccw, pyccw}), {true, true}); +***** assert (~isPolygonCCW (pcw)); +***** assert (isPolygonCCW ({pccw;pcw}), {true;false}); +***** assert (isPolygonCCW(pnan), [true; false]); +***** assert (isPolygonCCW({pnan,pcw}),{[true;false], false}); +***** assert (isPolygonCCW (pccw,[],"clipper")); +***** assert (isPolygonCCW (pxccw, pyccw,"clipper")); +***** assert (isPolygonCCW ({pxccw, pxccw}, {pyccw, pyccw},"clipper"), {true, true}); +***** assert (~isPolygonCCW (pcw,[],"clipper")); +***** assert (isPolygonCCW ({pccw;pcw},[],"clipper"), {true;false}); +***** 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/plotShape.m] +>>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/plotShape.m +***** demo + # Taylor series of cos(pi*x),sin(pi*x) + n = 5; N = 0:5; + s{1}(1,2:2:2*n+2) = fliplr ( (-1).^N .* (pi).^(2*N) ./ factorial (2*N)); + s{1}(2,1:2:2*n+1) = fliplr ( (-1).^N .* (pi).^(2*N+1) ./ factorial (2*N+1)); + + h(1) = plotShape (s, 'tol', 1e-1, 'color','b'); + h(2) = plotShape (s, 'tol', 1e-3, 'color', 'm'); + h(3) = plotShape (s, 'tol', 1e-9, 'color', 'g'); + legend (h, {'1e-1','1e-3','1e-9'}) + axis image +***** shared s + s = {[0.1 1; 1 0]}; ***** test - phcw = [pcw; nan(1,2); 0.5*pccw+[0.25 0.25]]; - assert (ispolycw(phcw),[true;false]); + plotShape (s); close; ***** 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]); -9 tests, 9 passed, 0 known failure, 0 skipped + plotShape (s,'tol', 1e-4);close; +***** test + plotShape (s,'color', 'm', 'tol', 1e-4);close; +***** test + plotShape (s,'color', 'm', 'linewidth', 2, 'tol', 1e-4);close; +***** test + plotShape (s,'color', 'm', 'tol', 1e-4, 'linewidth', 2);close; +***** test + plotShape (s,'-om', 'tol', 1e-4, 'linewidth', 2);close; + plotShape (s,'tol', 1e-4, '-om', 'linewidth', 2);close; + plotShape (s,'-om', 'linewidth', 2, 'tol', 1e-4);close; +***** test + plotShape (s,'-om', 'tol', 1e-4, 'tol', 1e-2);close; +7 tests, 7 passed, 0 known failure, 0 skipped [inst/simplifyPolygon_geometry.m] >>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/simplifyPolygon_geometry.m ***** test @@ -3686,6 +3626,102 @@ # The two polygons describe the same figure, a triangle. Extra points are # removed from the redundant one. 1 test, 1 passed, 0 known failure, 0 skipped +[inst/joinPolygons.m] +>>>>> /build/reproducible-path/octave-geometry-4.1.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], [56 NaN 78]) +***** error joinPolygons ({[1,0], [0,2]}); +5 tests, 5 passed, 0 known failure, 0 skipped +[inst/poly2cw.m] +>>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/poly2cw.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); +***** 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 +[inst/clipPolygon.m] +>>>>> /build/reproducible-path/octave-geometry-4.1.0/inst/clipPolygon.m +***** error clipPolygon([],[],[],'abracadabra') +***** error clipPolygon([0 0; 0 1; 0.5 1],[-1 -1; -1 1; 0 1],'no-op') +***** demo + pol1 = [2 2; 6 2; 6 6; 2 6; 2 2; NaN NaN; 3 3; 3 5; 5 5; 5 3; 3 3]; + pol2 = [1 2; 7 4; 4 7; 1 2; NaN NaN; 2.5 3; 5.5 4; 4 5.5; 2.5 3]; + + subplot (3, 3, 1) + drawFilledPolygon (pol1, 'edgecolor', 'k', 'facecolor', 'c') + axis image + title ('1. Subject polygon') + axis off + + subplot (3, 3, 2) + drawFilledPolygon (pol1, 'linestyle', 'none', 'facecolor', 'c') + drawFilledPolygon (pol2, 'edgecolor', 'b', 'facecolor', 'y') + axis image + title ('2. Clip polygon') + axis off + + algo = {'clipper', 'mrf'}; + for i = 1:numel (algo) + subplot (3, 3, i+2); + tic + [opol, npol] = clipPolygon (pol1, pol2, 3, 'clipper'); + printf('%s took: %f seconds (union)\n', algo{i}, toc); + drawFilledPolygon (opol, 'edgecolor', 'r', 'facecolor', 'g') + axis image + title (sprintf('Union - %s', algo{i})); + axis off + + subplot (3, 3, i+4); + tic + [opol, npol] = clipPolygon (pol1, pol2, 1, 'clipper'); + printf('%s took: %f seconds (and)\n', algo{i}, toc); + drawFilledPolygon (opol, 'edgecolor', 'r', 'facecolor', 'g') + axis image + title (sprintf('And - %s', algo{i})); + axis off + + subplot (3, 3, i+6); + tic + [opol, npol] = clipPolygon (pol1, pol2, 2, 'clipper'); + printf('%s took: %f seconds (xor)\n', algo{i}, toc); + drawFilledPolygon (opol, 'edgecolor', 'r', 'facecolor', 'g') + axis image + title (sprintf('Xor - %s', algo{i})); + axis off + endfor +2 tests, 2 passed, 0 known failure, 0 skipped +[inst/ispolyccw.m] +>>>>> /build/reproducible-path/octave-geometry-4.1.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 Checking C++ files ... Done running the unit tests. Summary: 106 tests, 105 passed, 1 known failures, 0 skipped @@ -3731,12 +3767,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: including full source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/32685/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/32685/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/10286 and its subdirectories -I: Current time: Fri Dec 20 10:05:41 -12 2024 -I: pbuilder-time-stamp: 1734732341 +I: removing directory /srv/workspace/pbuilder/32685 and its subdirectories +I: Current time: Sat Dec 21 12:11:00 +14 2024 +I: pbuilder-time-stamp: 1734732660