I've got a point cloud (point cloud is represented by many vertices) and a cube. Some vertices of the point cloud are inside the cube and some are outside of it.

From this point cloud I'd like to extract all vertices, that are located inside the cube.

How can you extract all vertices within the cube?

So far I have tried a boolean modifier, but unfortunately boolean modifiers do not seem to work with vertices...

Thanks for your help!

Side note: The point cloud was generated by ray casting ("BVHTree.ray_cast") onto an object. I created a new mesh object and added vertices at the location of the ray hits using "bmesh.verts.new(ray_hit_location)". This new mesh object is my point cloud.

  • $\begingroup$ can u show us how you created this point cloud? $\endgroup$
    – Chris
    Feb 2, 2022 at 17:53
  • $\begingroup$ Actually, I casted rays ("BVHTree.ray_cast") onto an object. The ray casting method returned the location of the ray hits (on the object). Then I created a new mesh object and added vertices at the location of the ray hits using "bmesh.verts.new(ray_hit_location)". Thus I received the point cloud (the new mesh object). $\endgroup$
    – Philipp
    Feb 2, 2022 at 18:02
  • $\begingroup$ @Philipp please add all new information regarding your question to the body of your post as an edit rather than using the comments section. Comments are generally considered disposable, and there are many users who do not even look at them who may have a good answer to many questions. $\endgroup$
    – Timaroberts
    Feb 2, 2022 at 19:16
  • 1
    $\begingroup$ The brute force way is to think of the cube as a bounding box and test each vertex to determine if it is inside the bounding box, saving a list/set of those vertices that are. Then create a new mesh of those that are. Does this answer help? $\endgroup$ Feb 3, 2022 at 0:52
  • $\begingroup$ With some modifications, it could possibly work. I'll try it out! Thanks! $\endgroup$
    – Philipp
    Feb 3, 2022 at 15:31


You must log in to answer this question.

Browse other questions tagged .