code: def place_visual(self):
          
          index = 0
          bin_pos = string_to_array(self.bin2_body.get("pos"))
          bin_size = self.bin_size
  
          for _, obj_mjcf in self.visual_objects:
  
              bin_x_low = bin_pos[0]
              bin_y_low = bin_pos[1]
              if index == 0 or index == 2:
                  bin_x_low -= bin_size[0] / 2
              if index < 2:
                  bin_y_low -= bin_size[1] / 2
  
              bin_x_high = bin_x_low + bin_size[0] / 2
              bin_y_high = bin_y_low + bin_size[1] / 2
              bottom_offset = obj_mjcf.get_bottom_offset()
  
              bin_range = [bin_x_low + bin_x_high, bin_y_low + bin_y_high, 2 * bin_pos[2]]
              bin_center = np.array(bin_range) / 2.0
  
              pos = bin_center - bottom_offset
              self.visual_obj_mjcf[index].set("pos", array_to_string(pos))
              index += 1
docs: Places visual objects randomly until no collisions or max iterations hit.