/// <summary> /// Create a new plane that is identical the current but flipped. /// </summary> /// <returns></returns> public Plane3D GetFlipped() { Plane3D plane = (Plane3D)this.Clone(); plane.Flip(); return(plane); }
object ICloneable.Clone() { Plane3D plane = new Plane3D(); plane.Constant = this.Constant; plane.Normal = (Vector3D)this.Normal.Clone(); return(plane); }
/// <summary> /// Is given object equal to current planes? /// </summary> /// <param name="o"></param> /// <returns></returns> public override bool Equals(object o) { if (o is Plane3D) { Plane3D plane = (Plane3D)o; return((this.Constant == plane.Constant) && (this.Normal == plane.Normal)); } return(false); }
/// <summary> /// Calculate the plane of the polygon /// </summary> /// <returns></returns> public Plane3D GetPlane() { if (_points.Count < 3) { throw new PlaneIllDefinedException("verticies in polygon are less than 3."); } // TODO: ensure that polygon is actually planar... currently no checking is done. return(Plane3D.FromCoplanarPoints(_points[0], _points[1], _points[2])); }
public void Reverse() { int count = this.Count; for (int i = 0; i < count / 2; i++) { Plane3D temp = this[i]; this[i] = this[count - i - 1]; this[count - i - 1] = temp; } }
object ICloneable.Clone() { Plane3D plane = new Plane3D(); plane.Constant = this.Constant; plane.Normal = (Vector3D) this.Normal.Clone(); return plane; }
public Plane3D[] ToArray() { Plane3D[] array = new Plane3D[this.Count]; this.CopyTo(array, 0); return(array); }