meshlabxml/transform.py
def curl_rim(script, curl_radius=None, start_radius=None, end_radius=None,
             end_height=None):
    """
    flare_radius must be >= z2 (height)
    r2 max = flare_radius + r
    
    r2 (num): radius of mesh at end of flare
    
    +15 r= 8.8205
    -15 r= 1.1795
    
    z=10, 5 +/-15 - +/-15*0.74535599249992989880305788957709
    """
    # TODO: set radius limit, make it so flare continues to expand linearly after radius limit
    # if(r<=radius_limit, flare, factor*z+constant
    # TODO: add option to specify radius at height instead of radius
    effective_radius = '(curl_radius) - z'
    
    r_func = 'if((r)>(start_radius), (start_radius) + (effective_radius)*sin(((r)-(start_radius))/(curl_radius)), (r))'
    z_func = 'if((r)>(start_radius), (curl_radius) - (effective_radius)*cos(((r)-(start_radius))/(curl_radius)), z)'
    
    r_func = r_func.replace('effective_radius', str(effective_radius)).replace('start_radius', str(start_radius)).replace('curl_radius', str(curl_radius))
    z_func = z_func.replace('effective_radius', str(effective_radius)).replace('start_radius', str(start_radius)).replace('curl_radius', str(curl_radius))
    
    function_cyl_co(script=script, r_func=r_func, z_func=z_func)
    return None
def curl_rim(script, curl_radius=None, start_radius=None, end_radius=None,
             end_height=None):
    """
    flare_radius must be >= z2 (height)
    r2 max = flare_radius + r
    
    r2 (num): radius of mesh at end of flare
    
    +15 r= 8.8205
    -15 r= 1.1795
    
    z=10, 5 +/-15 - +/-15*0.74535599249992989880305788957709
    """
    # TODO: set radius limit, make it so flare continues to expand linearly after radius limit
    # if(r<=radius_limit, flare, factor*z+constant
    # TODO: add option to specify radius at height instead of radius
    effective_radius = '(curl_radius) - z'
    
    r_func = 'if((r)>(start_radius), (start_radius) + (effective_radius)*sin(((r)-(start_radius))/(curl_radius)), (r))'
    z_func = 'if((r)>(start_radius), (curl_radius) - (effective_radius)*cos(((r)-(start_radius))/(curl_radius)), z)'
    
    r_func = r_func.replace('effective_radius', str(effective_radius)).replace('start_radius', str(start_radius)).replace('curl_radius', str(curl_radius))
    z_func = z_func.replace('effective_radius', str(effective_radius)).replace('start_radius', str(start_radius)).replace('curl_radius', str(curl_radius))
    
    function_cyl_co(script=script, r_func=r_func, z_func=z_func)
    return None
flare_radius must be >= z2 (height)
    r2 max = flare_radius + r
    
    r2 (num): radius of mesh at end of flare
    
    +15 r= 8.8205
    -15 r= 1.1795
    
    z=10, 5 +/-15 - +/-15*0.74535599249992989880305788957709