class Link3D:
    """Class for an msd3D link"""
    
    def __init__(self):
        self.id = "link"
        self.mass1_id = "0"
        self.mass2_id = "0"
        self.rigidity = 0
        self.damping = 0
        self.distance_exponent = 1
        self.min_length = 0
        self.max_length = 0
    
    def get_msd_setup_message(self):
       msd_msg = "link " + self.id + " " + str(self.mass1_id) + " " + \
           str(self.mass2_id) + " " + str(self.rigidity) + " " + \
           str(self.damping)
       
       if self.distance_exponent != 1 or self.min_length != 0 or self.max_length !=0:
           msd_msg += " " + str(self.distance_exponent)
       
       if self.min_length != 0 or self.max_length != 0:
           msd_msg += " " + str(self.min_length)
       
       if self.max_length != 0:
           msd_msg += " " + str(self.max_length)
       
       return msd_msg