Exemplo n.º 1
0
def scale_surface():
    """Scale the stl model."""
    if not check_surface():
        return
    itemlist = [ [ 'X-scale',1.0], [ 'Y-scale',1.0], [ 'Z-scale',1.0] ] 
    res,accept = widgets.inputDialog(itemlist,'Scaling Parameters').getResult()
    if accept:
        updateGUI()
        scale = map(float,[r[1] for r in res])
        print scale
        nodes,elems = PF['old_surface'] = PF['surface']
        F = Formex(nodes.reshape((-1,1,3)))
        nodes = F.scale(scale).f
        PF['surface'] = nodes,elems
        clear()
        show_changes(PF['old_surface'],PF['surface'])