Create a boundary using points

조회 수: 6 (최근 30일)
Ahmed
Ahmed 2023년 1월 11일
댓글: Ahmed 2023년 1월 11일
I have an array of nx2 points, where column 1 and 2 contain the x coordinate and y coordinate of this boundary. However these points are not in ordered and the shape of the boundary is not known (can be literally any shape). Is there a way to order those points to draw a boundary where the initial starting point is also the last point (the boundary is closed) and no two lines in this boundary intersects one another (each point will be connected to the next using a straight line. Note I tried the convex hull method, but this is isn’t what I’m looking for because the points I have are the boundary points and I don’t need them to be within a boundary as obtained by the convex hull method.

답변 (1개)

John D'Errico
John D'Errico 2023년 1월 11일
편집: John D'Errico 2023년 1월 11일
This is often achieved using the CRUST algorithm. A quick search just found several links that have MATLAB code for CRUST.
A quick search on the FEX shows at least two CRUST tools, though both written by the same person, depending on whether your manifold is open or closed. CRUST tools typically are written for both 2-d or 3-d cases, so points in a plane are fine.
  댓글 수: 1
Ahmed
Ahmed 2023년 1월 11일
Thank you for sharing, unfortunately this function is only for 3D shapes. Still looking for one that works for 2D points

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by