examples/Python/Advanced/mesh_voxelization.py
def preprocess(model):
    """Normalize model to fit in unit sphere (sphere with unit radius).
    
    Calculate center & scale of vertices, and transform vertices to have 0 mean and unit variance. 

    Returns:
        open3d.geometry.TriangleMesh: normalized mesh
    """
    min_bound = model.get_min_bound()
    max_bound = model.get_max_bound()
    center = min_bound + (max_bound - min_bound) / 2.0
    scale = np.linalg.norm(max_bound - min_bound) / 2.0
    vertices = np.asarray(model.vertices)
    vertices -= np.matlib.repmat(center, len(model.vertices), 1)
    model.vertices = o3d.utility.Vector3dVector(vertices / scale)

    ## Paint uniform color for pleasing visualization
    model.paint_uniform_color(np.array([1, 0.7, 0]))
    return model
Normalize model to fit in unit sphere (sphere with unit radius).
    
    Calculate center & scale of vertices, and transform vertices to have 0 mean and unit variance. 

    Returns:
        open3d.geometry.TriangleMesh: normalized mesh
    
Normalize model to fit in unit sphere (sphere with unit radius).
Calculate center & scale of vertices, and transform vertices to have 0 mean and unit variance.
Normalize model to fit in unit sphere ( sphere with unit radius ) . Calculate center & scale of vertices and transform vertices to have 0 mean and unit variance .
def preprocess(model):
    min_bound = model.get_min_bound()
    max_bound = model.get_max_bound()
    center = min_bound + (max_bound - min_bound) / 2.0
    scale = np.linalg.norm(max_bound - min_bound) / 2.0
    vertices = np.asarray(model.vertices)
    vertices -= np.matlib.repmat(center, len(model.vertices), 1)
    model.vertices = o3d.utility.Vector3dVector(vertices / scale)
    model.paint_uniform_color(np.array([1, 0.7, 0]))
    return model
def preprocess ( model ) : min_bound = model . get_min_bound ( ) max_bound = model . get_max_bound ( ) center = min_bound + ( max_bound - min_bound ) / 2.0 scale = np . linalg . norm ( max_bound - min_bound ) / 2.0 vertices = np . asarray ( model . vertices ) vertices -= np . matlib . repmat ( center , len ( model . vertices ) , 1 ) model . vertices = o3d . utility . Vector3dVector ( vertices / scale ) model . paint_uniform_color ( np . array ( [ 1 , 0.7 , 0 ] ) ) return model
Normalize model to fit in unit sphere (sphere with unit radius).
Normalize model to fit in unit sphere ( sphere with unit radius ) .
"""Normalize model to fit in unit sphere (sphere with unit radius).
    
    Calculate center & scale of vertices, and transform vertices to have 0 mean and unit variance. 

    Returns:
        open3d.geometry.TriangleMesh: normalized mesh
    """ ## Paint uniform color for pleasing visualization
None
open3d.geometry.TriangleMesh
model