def __init__(self, centre_tulpe, rayon, angle_start, angle_end, id): Leg.__init__(self, id) #classe mere Leg self._centre = Point_t(centre_tulpe) #position du centre de l'arc self._rayon = rayon #rayon de l'arc self._angle_start = angle_start #angle du point start self._angle_end = angle_end #angle du point end self._longueur = self._rayon * ( (self._angle_end - self._angle_start) % 360) * math.pi / 180 #longueur de l'arc
def __init__(self, coo_tulpe_start, coo_tulpe_end, id): Leg.__init__(self, id) #classe mere leg self._point_start = Point_t(coo_tulpe_start) #point start du leg self._point_end = Point_t(coo_tulpe_end) #point end du leg self._longueur = math.sqrt( math.pow( (self._point_start.get_x() - self._point_end.get_x()), 2) + math.pow( (self._point_start.get_y() - self._point_end.get_y()), 2) + math.pow((self._point_start.get_z() - self._point_end.get_z()), 2)) #longueur du leg
def create_start_end(self): """A partir des informations, créent les points start et end du leg""" x = self._centre.get_x() + self._rayon * math.cos( self._angle_start * math.pi / 180) y = self._centre.get_y() + self._rayon * math.sin( self._angle_start * math.pi / 180) point_start = (x, y, self._centre.get_z()) x = self._centre.get_x() + self._rayon * math.cos( self._angle_end * math.pi / 180) y = self._centre.get_y() + self._rayon * math.sin( self._angle_end * math.pi / 180) point_end = (x, y, self._centre.get_z()) self._point_start = Point_t(point_start) self._point_end = Point_t(point_end)
class Arc_t(Leg): """Classe définissant un arc""" def __init__(self, centre_tulpe, rayon, angle_start, angle_end, id): Leg.__init__(self, id) #classe mere Leg self._centre = Point_t(centre_tulpe) #position du centre de l'arc self._rayon = rayon #rayon de l'arc self._angle_start = angle_start #angle du point start self._angle_end = angle_end #angle du point end self._longueur = self._rayon * ( (self._angle_end - self._angle_start) % 360) * math.pi / 180 #longueur de l'arc def create_start_end(self): """A partir des informations, créent les points start et end du leg""" x = self._centre.get_x() + self._rayon * math.cos( self._angle_start * math.pi / 180) y = self._centre.get_y() + self._rayon * math.sin( self._angle_start * math.pi / 180) point_start = (x, y, self._centre.get_z()) x = self._centre.get_x() + self._rayon * math.cos( self._angle_end * math.pi / 180) y = self._centre.get_y() + self._rayon * math.sin( self._angle_end * math.pi / 180) point_end = (x, y, self._centre.get_z()) self._point_start = Point_t(point_start) self._point_end = Point_t(point_end) def get_centre(self): """Retourne la position du centre""" return self._centre def get_rayon(self): """Retourne le rayon de l'arc""" return self._rayon def get_angle_start(self): """Retourne l'angle du point start""" return self._angle_start def get_angle_end(self): """Retourne l'angle du point end""" return self._angle_end def set_rayon(self, r): """Set le rayon de l'arc""" self._rayon = r def set_angle_start(self, angle): """Set l'angle de start""" self._angle_start = angle def set_angle_end(self, angle): """Set l'angle end""" self._angle_end = angle def set_centre(self, point): """Set le centre de l'arc""" self._centre = point
class Line_t(Leg): """Classe représentant une ligne""" def __init__(self, coo_tulpe_start, coo_tulpe_end, id): Leg.__init__(self, id) #classe mere leg self._point_start = Point_t(coo_tulpe_start) #point start du leg self._point_end = Point_t(coo_tulpe_end) #point end du leg self._longueur = math.sqrt( math.pow( (self._point_start.get_x() - self._point_end.get_x()), 2) + math.pow( (self._point_start.get_y() - self._point_end.get_y()), 2) + math.pow((self._point_start.get_z() - self._point_end.get_z()), 2)) #longueur du leg def get_start_x(self): test = self._point_start x = [test.get_x, test.get_y, test.get_z] return x
def __init__(self, coo_tulpe, description, id): self._waypoint = description #description sous forme de string du waypoints : 'waypoint', 'node standard'... self._id = id #identifiant numerique du waypoint Point_t.__init__(self,coo_tulpe) #position du waypoint self._on_leg = {} #dictionnaire ayant pour clé un leg. Renvoi la distance entre le waypoint et le point start du leg.
def __init__(self, coo_tulpe, id): self._id = id #identifiant de la balise Point_t.__init__(self, coo_tulpe) #position de la balise
def __init__(self, coo_tulpe, value, type, nom): self._value = value #valeur de la contrainte self._type = type #type de contrainte 'dwn constraint' , 'Up constraint' ... self._nom = nom #nom de la contrainte 'v1'.... Point_t.__init__(self, coo_tulpe)