octave-maintainers
[Top][All Lists]
Advanced

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

Re: GSOC 2016 Enquiry (boolean operations on polygons)


From: PhilipNienhuis
Subject: Re: GSOC 2016 Enquiry (boolean operations on polygons)
Date: Sun, 24 Apr 2016 09:49:56 -0700 (PDT)

John Swensen-3 wrote
>> On Mar 25, 2016, at 8:46 AM, <

> amr_mohamed@

> > <

> amr_mohamed@

> > wrote:
>> 
>> Dear Mr John,
>> I noticed that the implementation of boolean operations on polygons
>> project was moved to packages projects ...
>> Will the project probably be discarded ? 
>> Regards,
>> Amr Mohamed
> I don’t think the project is being discarded. I had just mistakenly
> thought that the polygon functions were part of the core of Matlab. They
> are actually in the Matlab Mapping Toolbox, so they re-arranged the GSoC
> wiki page to indicated that the results of this project would end up being
> included in the Octave Mapping Package, rather than in the core of Octave.
> As far as I know, it was more of just an organizational correction to the
> wiki page, rather than an actual change in scope or importance.

Just to jump in, as regards this project I wonder if it is really enough for
a GSoC project.

I already had a partial implementation lying around I made early last year
based on Clipperlib (based on a mex function in the Third Party/Matlab/
subdir in the clipper archive), and in the wiki John Swensen pointed to Ulf
Griesmann's web page where another working implementation for Octave is
present (also based on Clipperlib).
Both implementations provide much more functionality than just polybool()
and ispolycw() in Matlab's mapping toolbox.

Recently I urgently needed a decent polyclip function for a project so I set
to finishing my own version - took me just two evenings.  Looking at Ulf
Griessman's polybool function I think that also only needs one or two
evenings of work.
polybool() and ispolycw() in the mapping package would only need to be a
very thin m-file wrapper n top of one of these implementations.

One advantage of clipperlib is that there is no need to build, or rely on, a
separate library for it. Just copying the clipper.cpp and clipper.hpp files
over + the mex wrappers supplied in clipperlib itself or from Ulf Griesmann
will do for the binary parts; mkoctfile will do the rest during package
installation.
In addition I know that clipperlib offers an option to also process Z-values
+ interpolation (using a user-supplied callback). I haven't found that in
Boost.geometry or any other polygon clipping library yet (but maybe it is
there).

If we go for Clipperlib, I think that this GSoC project as it stands is too
small to fill 3 months, because most of the work has already been done. It's
just a matter of polishing existing code.

But then additional functionality can be thought up:

- How to properly draw polygons with holes. AFAIK (but I hope there is a
better solution) both Octave and Matlab need "branch cuts" to be able to
draw, or better: leave holes in polygons. A clever algorithm is required to
avoid those branch cuts screwing up drawings, esp. in case of multiple
and/or concentric holes.
There is already a partial implementation for that (in shapedraw.m in the
current mapping package) but I wouldn't call it a clever one.

- Implementing efficient interpolation of vertex Z-values, maybe multiple
Z-values, on clipped polygon sides. 

- Maybe 3D-clipping of 3D polygons (maybe even more dimensions).

- ????


Thoughts ?

Philip




--
View this message in context: 
http://octave.1599824.n4.nabble.com/GSOC-2016-Enquiry-tp4675870p4676464.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.



reply via email to

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