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

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

[Octave-patch-tracker] [patch #9000] Polygon functions for geometry/mapp


From: Philip Nienhuis
Subject: [Octave-patch-tracker] [patch #9000] Polygon functions for geometry/mapping package
Date: Fri, 27 May 2016 07:18:55 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40

Follow-up Comment #5, patch #9000 (project octave):

JuanPi,

polyclip.m has two modes:
- with 1 arg, return which subpolys are ccw/cw
- with 2 or more args, perform boolean ops.
Just peruse polyclip's help text for more clarification.

As to naming, please do what you think is good. I just figured polyclip would
be nice and short (I like short names without camelcase better, but that is
just me.)

Does isCounterClockWise only accept three points? if so, it isn't enough. I
have no extreme demands but several of the polygons I'd like to handle (from
ArcGIS shape files) contain several hundreds of vertices, some of them
thousands.

I've been thinking a little more about the OF mapping/geometry divide.
AFAICS the polygon functions in Matlab's mapping toolbox:
- Accept separate X and Y vectors, AFAIU in any orientation (row or column)
- Only handle 2D polygons, not even with (ArcGIS-like) M and Z values per
vertex (the Matlab docs explicity state that M and Z values are ignored),
... while the OF geometry package's polygon functions:
- Accept complete polygons in Nx2 (or Nx3?) format

So one option would be to have polygon functions as feature-complete as
possible & accepting Nx2..NxM [*] polygons in the geometry package, and have
Matlab-compatible wrappers for them in the mapping package that accept X and Y
vectors.

[*] Nx2 = just XY; NxM = XY with one or more values ("measures") per vertex
(e.g., XYZM).

The Clipper "library" merely comprises two mex files (.cpp) and a .h file that
can be compiled/built with an extremely simple Makefile. With proper
acknowledgements as regards license it can be absorbed in a src/ subdir in the
OF geometry package so any system could have the Clipper library "available"
through the geometry package. IOW it doesn't need to be an external
dependency.

AFAICS the Boost:Geometry library is similar: it just comprises headers, so it
can also live in a src/ subdir in the OF geometry package.

John Swensen suggested to use the polytri library to be able to convert
polygon sets with holes into a triangulated patch surface leaving holes
uncovered. That is just another way (next to optimize_branch_cuts and polycut)
to be able to draw hollow polygons in Octave. So polytri might be yet another
external dependency.

BTW shall we also cc John Swensen?


    _______________________________________________________

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]