Faster polygon operations than polyshape
Show older comments
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 Comment
Jayanth Suresh
on 20 Jun 2023
@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?
Answers (1)
Bruno Luong
on 6 Dec 2020
1 vote
5 Comments
JackCrusoe47
on 8 Dec 2020
JackCrusoe47
on 8 Dec 2020
Bruno Luong
on 8 Dec 2020
Ah your are welcome. I'm glad to learn the code is helpful.
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
on 28 Apr 2022
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.
Categories
Find more on Polygonal Shapes in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!