Пример #1
0
 /// <summary>
 /// Creates and sets a rectangular Room Perimeter with dimensions derived from Room characteristics with its southwest corner at the supplied Vector3 point. If no point is supplied, the southwest corner is placed at the origin.
 /// </summary>
 /// <param name="area">Area override for the new Room Perimeter. If zero, defaults to the value of DesignArea.</param>
 /// <param name="ratio">Desired ratio of X to Y Room dimensions.</param>
 /// <param name="moveTo">Vector3 location of the new Polygon's southwest corner.</param>
 /// <returns>
 /// True if the Perimeter is successfully set.
 /// </returns>
 public bool SetPerimeter(double area, double ratio = 1.5, Vector3 moveTo = null)
 {
     if (area <= 0.0 || ratio <= 0.0)
     {
         return(false);
     }
     Perimeter = Shaper.PolygonByArea(area, ratio, moveTo);
     return(true);
 }
Пример #2
0
 /// <summary>
 /// Creates and sets a rectangular Room Perimeter with dimensions derived from Room characteristics with its southwest corner at the origin or at the 2D location implied by the supplied Vector3.
 /// </summary>
 /// <returns>
 /// True if the Perimeter is successfully set.
 /// </returns>
 public bool SetPerimeter(Vector3 moveTo = null)
 {
     if (DesignSet)
     {
         Perimeter = Shaper.PolygonBox(DesignLength, DesignWidth, moveTo);
         return(true);
     }
     else if (DesignArea > 0.0 && DesignRatio > 0.0)
     {
         Perimeter = Shaper.PolygonByArea(DesignArea, DesignRatio, moveTo);
         return(true);
     }
     return(false);
 }