1

I am working with high res point clouds of museum peices made of 20-30 million vertices and normal mapping from PLY files generated in another program.

I wish to delete cylinders and spheres algorytmically from the middle of the point cloud. For example, a sphere is just a maths equation of all vertices that are within distance from a point in space. I just want to get all vertices withing an mathematical surface and delete them.

How can i do it?

bandybabboon
  • 197
  • 1
  • 6
  • Needs more info about the objects to detect. If a sphere is allowed to consist of four points, everything could be deleted. What defines your sphere. Tesselation... etc – Leander Jan 15 '17 at 11:47
  • Hi, I mean an algorytmic sphere made by distance, i.e. sqrt(xxyyzz-1) is a sphere, so i want to find all vertices xyz smaller than zero by that equation. i have changed the quesiton with addid info's. Thanks! – bandybabboon Jan 15 '17 at 13:07

1 Answers1

2

enter image description here

import bpy,bmesh
from mathutils import Vector

mesh=bmesh.from_edit_mesh(bpy.context.object.data)
for v in mesh.verts:
    # select by sphere radius
    if v.co.length < 8:
        v.select = True
    # select by cylinder radius
    vcyl = Vector((v.co.x,v.co.y,0))
    if vcyl.length < 5:
        v.select = True
# trigger viewport update
bpy.context.scene.objects.active = bpy.context.scene.objects.active

See Blender: Scale a group of vertices using python on how to determine the center.

Demo:

stacker
  • 38,549
  • 31
  • 141
  • 243
  • That's very awesome stacker. it led me to learn a lot about coding in blender. Meshlab also has a select by mathematical equation i found out however it's less efficient workflow that your version. – bandybabboon Jan 19 '17 at 19:51