How to find points over a single border of a surface

Hi guys,
i'm dealing with a 3D surface which has straight and curved borders. I have a matrix which contains all the points laying on the borders, now i want to extract the points on each border. Since i work with different kind of surface, i can't select the points by the way of x y or z values, bcs I can have also an inclined surface, and so no chance to select points which share the same x, y or z coordinates.
Do u have some suggestions?
Hope the question is clear and thanks in advance.

3 Comments

Explain exactly what "I have a matrix which contains all the points laying on the borders, now i want to extract the points on each border." means. Is it one particular border, out of several stored in the matrix, that you want to extract? Like if border points are in columns, you want one particular column? Do you want to interactively somehow "lassoo" points in 3-D and extract those from the array? A picture/diagram might help, as well as attaching your data in a .mat file.
The surface is discretized with a triangular mesh, so i have the points and the connectivity list. The surface has 4 straight borders, 1 is curved. I have a Nx3 matrix of points lie on the borders of the surface. From this matrix, i need to extract points which belongs to only one border.
If @Shubham's answer below doesn't work then please attach screenshots illustrating your situation.

Sign in to comment.

Answers (1)

Hi ENRICO,
Since you have a mesh representation of the surface and a matrix of points on the borders, you can use the connectivity information to identify and separate the points that belong to each border. Here's one approach you could try:
  1. First, you need to find the vertices in the mesh that correspond to the points in your Nx3 matrix. You can do this by computing the Euclidean distance between each point in the matrix and every vertex in the mesh. If the distance between a matrix point and a mesh vertex is below a certain threshold (e.g., 10^-3), you can assume that they represent the same point.
  2. Once you have identified the mesh vertices that correspond to the points in your matrix, you can use the connectivity information to separate the vertices that belong to each border. You can start by identifying all the vertices that are adjacent to the points in the matrix. Then, you can traverse the mesh along the edges to find all the vertices that are connected to the previously identified vertices. Repeat this process until you have identified all the vertices that form a closed loop around the border.
  3. After identifying the vertices that belong to each border, you can generate a new mesh for each border by selecting the vertices that belong to the current border and their corresponding triangles. You can then save each mesh as a separate file or use it for further processing.
I hope this approach helps!

Categories

Asked:

on 22 May 2023

Commented:

on 1 Jun 2023

Community Treasure Hunt

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

Start Hunting!