Faster polygon operations than polyshape

Is there a faster method to handle vast amounts of polyshape operations? In my thesis, I need to perform large number of boolean operations of FoV of multiple satellites. I tried using a MEX version of GPC-Library. Though individual operations (binary operations with just two polygons) seemed faster, when working with polygon vectors, polyshape again become comparable in performance. Besides this the MEX code also become unstable and crashes MATLAB as I call it repeatedly. Any suggestions would be appriceated.
P.s. I use polyshape due to level of accuracy required for work, instead of approximated spherical point and operations on them.

1 件のコメント

Jayanth Suresh
Jayanth Suresh 2023 年 6 月 20 日
@JackCrusoe47 I am looking for ways to speed up my polyshape operations too. Do you have a rough estimate on the kind of time savings you got with the code you were using?

サインインしてコメントする。

回答 (1 件)

Bruno Luong
Bruno Luong 2020 年 12 月 6 日

1 投票

5 件のコメント

JackCrusoe47
JackCrusoe47 2020 年 12 月 8 日
Thank you.
In then end I used a modified version of Angus J's code too.
I used : New Polygon Clipping and Offsetting by Erik Johnson and then modified it allow multiple boolean operation and hole definition closely resembling Polygon Clipper - Sebastian Hölz method. I needed to use all the functionalities of polyshape (diff, intersect, xor and union + overlaps and isinterior (I used the mex version of INPOLYGON - Bruno Luong ).
As you can probably guess, I'm still not used to writing my own mex function builds (except using Matlab coder).
JackCrusoe47
JackCrusoe47 2020 年 12 月 8 日
@ Bruno Luong . Sorry. I should thank you also for your function, Inpolygon. I didn't realisize it was your code. I was able to speed up several parts of my thesis using your function. Thank you.
Bruno Luong
Bruno Luong 2020 年 12 月 8 日
Ah your are welcome. I'm glad to learn the code is helpful.
Tian Dong
Tian Dong 2022 年 4 月 28 日
編集済み: Tian Dong 2022 年 4 月 28 日
Hi Bruno,
I hope this message find you well. I came across this thread as I was searching for a way to speed up union polyshapes. I am putting polybuffer around a set of links (see figure below). Method 1(left figure): store XY coordinates of all links in one array, then make a polyshape. output is not ideal. Method 2 (right figure): generate a polyshape for each link, then union. output is very ideal, but about 20 times slower than Method 1. I wonder if you can help me out here. Thank you.
In term of the clipper software, do I need to write a MEX Function based on C++ or C# to translate the software to use it in MATLAB, how would the outputs from software work with polyshape in MATLAB? I do not have any experenice in C languages or wrting MEX. any tipps there? Thank you so much.
Bruno Luong
Bruno Luong 2022 年 4 月 28 日
The clipper provide a mex-ready cpp file. All you need is the C compiler supported by your MATLAB version.
The package is provided with an mfile with H1 line. The calling is well documented.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangePolygonal Shapes についてさらに検索

製品

リリース

R2020b

質問済み:

2020 年 12 月 6 日

コメント済み:

2023 年 6 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by