meshlabxml/normals.py
def point_sets(script, neighbors=10, smooth_iteration=0, flip=False,
               viewpoint_pos=(0.0, 0.0, 0.0)):
    """ Compute the normals of the vertices of a mesh without exploiting the
        triangle connectivity, useful for dataset with no faces.

    Args:
        script: the FilterScript object or script filename to write
            the filter to.
        neighbors (int): The number of neighbors used to estimate normals.
        smooth_iteration (int): The number of smoothing iteration done on the
            p used to estimate and propagate normals.
        flip (bool): Flip normals w.r.t. viewpoint. If the 'viewpoint' (i.e.
            scanner position) is known, it can be used to disambiguate normals
            orientation, so that all the normals will be oriented in the same
            direction.
        viewpoint_pos (single xyz point, tuple or list): Set the x, y, z
            coordinates of the viewpoint position.

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    filter_xml = ''.join([
        '  <filter name="Compute normals for point sets">\n',
        '    <Param name="K" ',
        'value="{:d}" '.format(neighbors),
        'description="Neighbour num" ',
        'type="RichInt" ',
        '/>\n',
        '    <Param name="smoothIter" ',
        'value="{:d}" '.format(smooth_iteration),
        'description="Smooth Iteration" ',
        'type="RichInt" ',
        '/>\n',
        '    <Param name="flipFlag" ',
        'value="{}" '.format(str(flip).lower()),
        'description="Flip normals w.r.t. viewpoint" ',
        'type="RichBool" ',
        '/>\n',
        '    <Param name="viewPos" ',
        'x="{}" y="{}" z="{}" '.format(viewpoint_pos[0], viewpoint_pos[1],
                                       viewpoint_pos[2],),
        'description="Viewpoint Pos." ',
        'type="RichPoint3f" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(script, filter_xml)
    return None
def point_sets(script, neighbors=10, smooth_iteration=0, flip=False,
               viewpoint_pos=(0.0, 0.0, 0.0)):
    filter_xml = ''.join([
        '  <filter name="Compute normals for point sets">\n',
        '    <Param name="K" ',
        'value="{:d}" '.format(neighbors),
        'description="Neighbour num" ',
        'type="RichInt" ',
        '/>\n',
        '    <Param name="smoothIter" ',
        'value="{:d}" '.format(smooth_iteration),
        'description="Smooth Iteration" ',
        'type="RichInt" ',
        '/>\n',
        '    <Param name="flipFlag" ',
        'value="{}" '.format(str(flip).lower()),
        'description="Flip normals w.r.t. viewpoint" ',
        'type="RichBool" ',
        '/>\n',
        '    <Param name="viewPos" ',
        'x="{}" y="{}" z="{}" '.format(viewpoint_pos[0], viewpoint_pos[1],
                                       viewpoint_pos[2],),
        'description="Viewpoint Pos." ',
        'type="RichPoint3f" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(script, filter_xml)
    return None
def point_sets ( script , neighbors = 10 , smooth_iteration = 0 , flip = False , viewpoint_pos = ( 0.0 , 0.0 , 0.0 ) ) : filter_xml = '' . join ( [ '  <filter name="Compute normals for point sets">\n' , '    <Param name="K" ' , 'value="{:d}" ' . format ( neighbors ) , 'description="Neighbour num" ' , 'type="RichInt" ' , '/>\n' , '    <Param name="smoothIter" ' , 'value="{:d}" ' . format ( smooth_iteration ) , 'description="Smooth Iteration" ' , 'type="RichInt" ' , '/>\n' , '    <Param name="flipFlag" ' , 'value="{}" ' . format ( str ( flip ) . lower ( ) ) , 'description="Flip normals w.r.t. viewpoint" ' , 'type="RichBool" ' , '/>\n' , '    <Param name="viewPos" ' , 'x="{}" y="{}" z="{}" ' . format ( viewpoint_pos [ 0 ] , viewpoint_pos [ 1 ] , viewpoint_pos [ 2 ] , ) , 'description="Viewpoint Pos." ' , 'type="RichPoint3f" ' , '/>\n' , '  </filter>\n' ] ) util . write_filter ( script , filter_xml ) return None
Compute the normals of the vertices of a mesh without exploiting the
        triangle connectivity, useful for dataset with no faces.

    Args:
        script: the FilterScript object or script filename to write
            the filter to.
        neighbors (int): The number of neighbors used to estimate normals.
        smooth_iteration (int): The number of smoothing iteration done on the
            p used to estimate and propagate normals.
        flip (bool): Flip normals w.r.t. viewpoint. If the 'viewpoint' (i.e.
            scanner position) is known, it can be used to disambiguate normals
            orientation, so that all the normals will be oriented in the same
            direction.
        viewpoint_pos (single xyz point, tuple or list): Set the x, y, z
            coordinates of the viewpoint position.

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA
Compute the normals of the vertices of a mesh without exploiting the triangle connectivity useful for dataset with no faces .