Efficient way to delete all points below z = 0 on grid via Python script I am trying to create a bowl in Blender by using the Python scipt.  My method is as follows:


Clear cube in new file
Create UV sphere via Add --> Mesh --> UV Sphere
Tab (enter edit mode)
a' (unselect all points)
Highlight all vertices below the XY plane (Z &lt; 0), and delete them.

Is there an efficient way to carry out step 5 via python scripting? Doing so in Blender and watching the Python script window doesn't help, since the selection is manual.
This small script loops through the vertices in the active object and deletes all the vertices that are below 0 on the local Z axis. The local axis starts at the object origin.
Just paste this in to the text editor in blender and with your UV sphere selected press the Run button.
import bpy

vert = bpy.context.object.data.vertices

bpy.ops.object.mode_set(mode='OBJECT')

for v in vert:
    v.select = v.co.z &lt; 0
        
bpy.ops.object.mode_set(mode = 'EDIT') 
bpy.ops.mesh.delete(type='VERT')
bpy.ops.object.mode_set(mode = 'OBJECT')