octave-patch-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-patch-tracker] [patch #9000] Polgon functions for geometry/mappi


From: Philip Nienhuis
Subject: [Octave-patch-tracker] [patch #9000] Polgon functions for geometry/mapping package
Date: Wed, 11 May 2016 22:34:47 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40

URL:
  <http://savannah.gnu.org/patch/?9000>

                 Summary: Polgon functions for geometry/mapping package
                 Project: GNU Octave
            Submitted by: philipnienhuis
            Submitted on: Thu 12 May 2016 12:34:46 AM CEST
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

In the last year I've experimented with various polygons-with-holes drawing
functions and polygon clipping, using the Clipper library.
In the current state it worked for me, so after a bit of polishing and private
emails with the geometry package maintainer & John Swensen (GSOC boolean
polygon ops. mentor) I just put it up here.

Contents are:
- polyjoin.m  (depends on supplied joinPolygons.m)
- polysplit.m  (depends on existing splitPolygons.m)
- polycut.m   (depends on supplied optimize_branch_cuts.m)
These three might go in the mapping package

- joinPolygons.m   (complement of existing splitPolygons in geometry pkg)
- optimize_branch_cuts.m   (separated from shapedraw.m in mapping package)
- polybool.m  (depends on supplied polyclip.m)
- polyclip.m   (wrapper for Clipper library)
I think these could go in the geometry package.

I also have a ispolycw (fairly rough) but that depends on polyclip.m/Clipper
as well.

clipper.cpp, clipper.hpp and mexclipper.cpp can be found in Clipper (I used v.
6.2.1), subdir Third Party/Matlab
https://sourceforge.net/projects/polyclipping/files/
To build clipper.mex in Octave:
mkoctfile -mex -s clipper.cpp mexclipper.cpp

polyclip / polybool / clipper are IMO at most a temporary solution until the
polybool from the GSOC project becomes available. Maybe just for those who
can't wait (like me :-) ).

- Makefile might be a start for including in a package.


- drwpatch.m  A utility function for drawing (possibly nested) polygons with
holes

- polyclip_tst2.m    demo function

- holes.mat, example_holes.m   Example polygons with holes to be used for
optimize_branch_cuts.m. Usage examples are in supplied polyclip_tst2.m


All these functions probably contain bugs, but I didn't hit them yet.


Note:
I've seen polyjoin.m & polysplit.m in bug #47502; as I commented there
polyjoin could benefit from vectorization and polysplit can depend on
splitPolygons in the geometry package.
I suggest to check relative performance and -depending on the results- decide
which versions end up where.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 12 May 2016 12:34:46 AM CEST  Name: polygon_clip.zip  Size: 14kB  
By: philipnienhuis

<http://savannah.gnu.org/patch/download.php?file_id=37133>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?9000>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]