Given vertex points of two 2D polygons plotted in 3D space (x,y,z) how to determine if they intersect?

7 Ansichten (letzte 30 Tage)
Let's say I have some set of vertices:
[x1,y1,z1;
...
xn,yn,zn];
and
[a1,b1,c1;
...
an,bn,cn];
where the two polygons are 2D (all vertices for one polygon lie on the same plane)
What MATLAB function allows you to determine if they intersect or overlap at all?
I've looked at both patch() and fill3() functions for plotting, but they dont work with overlap or intersect functions I've found so far since I'm plotting the 2D polygons in 3D space.

Akzeptierte Antwort

MarKf
MarKf am 1 Dez. 2022
Bearbeitet: MarKf am 1 Dez. 2022
Unfortunately intersect only works for 2D polyshape objects, whereas for 3D you can use alphaShape and then a numerical solution involving testing most of the surface points with inShape.
Depending on the simplicity of your shapes, there are also analytical solutions, for example either by computing the intersection between the planes of the polygons (see for example fileexchange planes-intersection) and checking if the line is within both areas, or with fileexchange SurfaceIntersection.
  1 Kommentar
Michael Ferguson
Michael Ferguson am 1 Dez. 2022
Thanks for the suggestion. I think I've found a workaround to my problem by creating a 3D bounding box around each of the polygons with some small height and finding the overlapping volume of those boxes as described in this post.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Elementary Polygons finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by