@@ -947,6 +947,7 @@ def add_surfaces(self, surfaces, positions):
947947 the root chord which is highest in the rocket coordinate system.
948948 For Tail type, position is relative to the point belonging to the
949949 tail which is highest in the rocket coordinate system.
950+ For RailButtons type, position is relative to the lower rail button.
950951
951952 See Also
952953 --------
@@ -956,11 +957,16 @@ def add_surfaces(self, surfaces, positions):
956957 -------
957958 None
958959 """
959- try :
960- for surface , position in zip (surfaces , positions ):
960+ if not isinstance (surfaces , list ):
961+ surfaces = [surfaces ]
962+ positions = [positions ]
963+
964+ for surface , position in zip (surfaces , positions ):
965+ if isinstance (surface , RailButtons ):
966+ surface .rocket_radius = surface .rocket_radius or self .radius
967+ self .rail_buttons .add (surface , position )
968+ else :
961969 self .aerodynamic_surfaces .add (surface , position )
962- except TypeError :
963- self .aerodynamic_surfaces .add (surfaces , positions )
964970
965971 self .evaluate_center_of_pressure ()
966972 self .evaluate_stability_margin ()
@@ -1512,6 +1518,7 @@ def set_rail_buttons(
15121518 rail_buttons = RailButtons (
15131519 buttons_distance = buttons_distance , angular_position = angular_position
15141520 )
1521+ rail_buttons .rocket_radius = rail_buttons .rocket_radius or self .radius
15151522 self .rail_buttons .add (rail_buttons , lower_button_position )
15161523 return rail_buttons
15171524
0 commit comments