Area of ​​Interest and Data Peaks (3D), matlab

I want to have a simple function similar to autocad, which allows me to select all lines in 3D with a mouse selection.

enter image description here

in fig. I just want to get (x, y, z) all the selected vetices. The selection function should be like AutoCAD.

1-mouse clicks on a line

2- selection of the area With the cursor information, I get only one point (x, y, z), as shown in the figure. It would be nice if I could get all the points inside the rectangle made by the mouse (the area of ​​interest can be a polygon).

I think the function might look like

[BW, xi, yi] = roipoly(...) 

in 3D

  [ xi, yi,zi] = roipoly_new(...) 
+4
source share
1 answer

To solve this problem, you will need the following:

[xi, yi, zi] = roipoly_new (...)

Define a point of view, POV.

Project ROI from POV and check intersections with all objects with known vertices. This is a ray tracing algorithm, but it is analytic for linear tasks, so it should not be performed too complicated. The first result on the Matlab CPU gives the following: http://www.mathworks.com/matlabcentral/fileexchange/authors/30179

Once you know which objects cross your rays, the world is your oyster.

0
source

All Articles