def METHOD_NAME(obj):
    """Converts Klamp't geometry to an open3d geometry.
    Geometry3D objects are converted applying the current transform.
    If the VolumeGrid is considered to be an occupancy grid (all values
    between 0 and 1), then it is converted to a VoxelGrid containing a
    voxel for any positive items.  If it is considered to be a SDF,
    then it contains a voxel of any non-positive items.  There may be
    issues converting from VolumeGrids whose cells are non-cubic.
    """
    if isinstance(obj,PointCloud):
        pc = open3d.geometry.PointCloud()
        pc.points = open3d.utility.Vector3dVector(obj.getPoints())
        #TODO: other properties
        colors = geometry.point_cloud_colors(obj,('r','g','b'))
        if colors is not None:
            for i in range(obj.numPoints()):
                pc.colors.append(colors[i])
        return pc
    elif isinstance(obj,TriangleMesh):
        m = open3d.geometry.TriangleMesh()
        m.vertices = open3d.utility.Vector3dVector(obj.getVertices())
        m.triangles = open3d.utility.Vector3iVector(obj.getIndices())
        return m
    elif isinstance(obj,VolumeGrid):
        import numpy as np
        origin = np.array([obj.bbox[0],obj.bbox[1],obj.bbox[2]])
        cx = (obj.bbox[3]-obj.bbox[0])/obj.dims[0]
        cy = (obj.bbox[4]-obj.bbox[1])/obj.dims[1]
        cz = (obj.bbox[5]-obj.bbox[2])/obj.dims[2]
        voxel_size = pow(cx*cy*cz,1.0/3.0)
        values = obj.getValues()
        vrange = np.min(values),np.min(values)
        if vrange[0] < 0 or vrange[1] > 1:
            #treat as SDF
            indices = np.nonzero(values <= 0)
        else:
            #treat as occupancy grid
            indices = np.nonzero(values > 0.5)
        pc = open3d.geometry.PointCloud()
        for i in indices[0]:
            cell = np.array([i//(obj.dims[2]*obj.dims[1]), (i//obj.dims[2]) % obj.dims[1], i%obj.dims[2]])
            pt = (cell + 0.5)*voxel_size + origin
            pc.points.append(pt)
        return open3d.geometry.create_surface_voxel_grid_from_point_cloud(pc,voxel_size)
    elif isinstance(obj,Geometry3D):
        if obj.type() == 'PointCloud':
            pc = obj.getPointCloud()
            pc.transform(*obj.getCurrentTransform())
            return METHOD_NAME(pc)
        elif obj.type() == 'TriangleMesh':
            m = obj.getTriangleMesh()
            m.transform(*obj.getCurrentTransform())
            return METHOD_NAME(m)
    raise TypeError("Invalid type")