## Remove points from a mesh

ibabinaca

### ibabinaca (view profile)

さんによって質問されました 2019 年 2 月 4 日

さんによって コメントされました 2019 年 2 月 4 日

さんの 回答が採用されました
I have a mesh of points intersecting a cone, and i want to remove all the points inside the conic surface and near to the limits of it. I can check whether the point is on the inside of the circumference slice of the cone for a given height but, this will take me a lot of time since the mesh has a lot of points. I was wondering if there is a better and faster way to do it.
Thank you. #### 0 件のコメント

サインイン to comment.

## 1 件の回答

2019 年 2 月 4 日

2019 年 2 月 4 日
採用された回答

If you know the parameters of the circle that encompasses the area you'd like to remove (ie, the center coordinates and the radius), you could just calculate the distance of all points to the circle's center and then eliminate all dots whose distance is less than the radius. This would work if all of the dots are on the same plane as the circle's center which appears to be the case.
Here's an example where x and y are the coordinates of your dots. c is the (x,y) center of your circle and r is the radius.
% create data
x = rand(1000,1);
y = rand(1000,1);
c = [.5, .5]; %[x,y] center of circle
% Calculate distance to circle center
d = sqrt((x - c(1)).^2 + (y - c(2)).^2);
% find dots on/in circle
inCircleIdx = d <= r;
% remove dots on/in circle
x(inCircleIdx) = [];
y(inCircleIdx) = [];

ibabinaca

### ibabinaca (view profile)

2019 年 2 月 4 日
Yes, thank you, that is a good idea. But the mesh is not always a plane, it can be a cube, sphere... So in that case it will be more complicated and will take me more time. I dont know if you have any other idea for when the mesh is different. Thank you.

2019 年 2 月 4 日
For a 3D mesh, what are you aiming to remove? Everything to the left of the blue manifold?