Polygon Clipping and Offsetting

バージョン 1.0.0.0 (4.31 KB) 作成者: Emmett
Mex wrapper for a fast, robust C++ library to clip and offset arbitrary polygons.
ダウンロード: 1.6K
更新 2012/4/17

ライセンスの表示

This is a mex wrapper for Angus Johnson's Clipper library: http://www.angusj.com/delphi/clipper.php, based on Sebastian Hölz's mex wrapper for the GPC library. This library has some speed advantages over GPC, but the primary addition is the ability to offset polygons.

In order to use this, you must first download the clipper library from the above link (I used ver4.7.5) and put the files clipper.cpp and clipper.hpp in the same folder as the files you downloaded from this submission. Then compile your own mexfile by running the command:

mex clipper.cpp mexclipper.cpp

The example file, testclipper.m, shows all the basic usage. The clipper function takes input as int64 and returns answers as doubles, so remember to convert the data types and scale appropriately.

Details on the library can be found here: http://www.angusj.com/delphi/clipper/documentation/Docs/_Body.htm. Self-intersecting polygons can be used in clipping operations and different fill types are available. For offsetting, polygons cannot self-intersect and perimeters must have a "true" orientation while holes must be "false". The orientation of polygons can also be checked with this wrapper.

Call clipper with no arguments to view help.

引用

Emmett (2024). Polygon Clipping and Offsetting (https://www.mathworks.com/matlabcentral/fileexchange/36241-polygon-clipping-and-offsetting), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2011a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersElementary Polygons についてさらに検索
謝辞

ヒントを得たファイル: Polygon Clipper

ヒントを与えたファイル: New Polygon Clipping and Offsetting

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0