From 135ab5072a6011175a554ec4282f0d3e5e80359b Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sun, 21 Feb 2016 15:20:27 -0800 Subject: [PATCH] Added Bounds.Length, Width, Height --- OSCADSharp/OSCADSharp/OSCADObject.cs | 2 ++ OSCADSharp/OSCADSharp/Spatial/Bounds.cs | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/OSCADSharp/OSCADSharp/OSCADObject.cs b/OSCADSharp/OSCADSharp/OSCADObject.cs index fdbede2..a8d259d 100644 --- a/OSCADSharp/OSCADSharp/OSCADObject.cs +++ b/OSCADSharp/OSCADSharp/OSCADObject.cs @@ -316,6 +316,8 @@ namespace OSCADSharp /// /// Writes the script for this OSCADObject to the file specified + /// + /// (This is just a shortcut for File.WriteAllLines) /// /// Path for the file to write. Including filename and (optionally) file extension public void ToFile(string filePath) diff --git a/OSCADSharp/OSCADSharp/Spatial/Bounds.cs b/OSCADSharp/OSCADSharp/Spatial/Bounds.cs index e38ea48..3d981ce 100644 --- a/OSCADSharp/OSCADSharp/Spatial/Bounds.cs +++ b/OSCADSharp/OSCADSharp/Spatial/Bounds.cs @@ -63,8 +63,24 @@ namespace OSCADSharp.Spatial /// Z position with the smallest value /// public double Z_Min { get { return TopRight.Z < BottomLeft.Z ? TopRight.Z : BottomLeft.Z; } } + + /// + /// Size on the X axis + /// + public double Length { get { return this.X_Max - this.X_Min; } } + + /// + /// Size on the Y axis + /// + public double Width { get { return this.Y_Max - this.Y_Min; } } + + /// + /// Size on the Z axis + /// + public double Height { get { return this.Z_Max - this.Z_Min; } } #endregion + #region Overrides /// /// Compares a set of bounds to another object /// @@ -84,5 +100,6 @@ namespace OSCADSharp.Spatial { return String.Format("TR: {0}, BL: {1}", this.TopRight.ToString(), this.BottomLeft.ToString()).GetHashCode(); } + #endregion } }