src/objects2d_to_objects3d/src/objects2d_to_objects3d.cpp
/** \brief Computes a 3D object from a non-empty 2D polygon.
 *
 * This function approximates the given 2D polygon by its bounding rectangle.
 * Then it computes a 3D box that represents this rectangle.
 * It assumes that the polygon represents an object that is standing on the
 * ground.
 */
\brief Computes a 3D object from a non-empty 2D polygon.
This function approximates the given 2D polygon by its bounding rectangle.
Then it computes a 3D box that represents this rectangle.
It assumes that the polygon represents an object that is standing on the
ground.
\ brief Computes a 3D object from a non - empty 2D polygon . This function approximates the given 2D polygon by its bounding rectangle . Then it computes a 3D box that represents this rectangle . It assumes that the polygon represents an object that is standing on the ground .
inline OrientedBox compute3DBoxFrom2DPolygon(const Polygon& polygon)
{
  if (polygon.points.empty())
    throw runtime_error {"empty polygon passed to compute3DBoxFrom2DPolygon"};
  Rectangle rec {computePolygonBoundingRect(polygon)};
  BoxComputer bc;
  OrientedBox box {bc.computeFromRectangle(rec)};
  return box;
}
inline OrientedBox compute3DBoxFrom2DPolygon ( const Polygon & polygon ) { if ( polygon . points . empty ( ) ) throw runtime_error { " " } ; Rectangle rec { computePolygonBoundingRect ( polygon ) } ; BoxComputer bc ; OrientedBox box { bc . computeFromRectangle ( rec ) } ; return box ; }
\brief Computes a 3D object from a non-empty 2D polygon.
\ brief Computes a 3D object from a non - empty 2D polygon .