Changeset 15554 for branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Geometry/Plane3D.cs
- Timestamp:
- 12/20/17 16:15:38 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Geometry/Plane3D.cs
r15454 r15554 6 6 7 7 namespace HeuristicLab.Problems.BinPacking3D.Geometry { 8 internalenum Side { Top, Left, Bottom, Right, Front, Back }8 public enum Side { Top, Left, Bottom, Right, Front, Back } 9 9 10 10 /// <summary> 11 11 /// A plane is given as a point and two directing vectors 12 12 /// </summary> 13 internalclass Plane3D {13 public class Plane3D { 14 14 public Vector3D Point { get; private set; } 15 15 public Vector3D Direction1 { get; private set; } 16 16 public Vector3D Direction2 { get; private set; } 17 17 public Vector3D Normal { get; private set; } 18 18 19 private int rhs; 19 20 … … 93 94 } 94 95 96 /// <summary> 97 /// Returns true if the given point is an element of the current plane 98 /// </summary> 99 /// <param name="point"></param> 100 /// <returns></returns> 95 101 public bool IsElementOf(Vector3D point) { 96 102 return Normal.X * point.X + Normal.Y * point.Y + Normal.Z * point.Z == rhs; 97 103 } 98 104 105 /// <summary> 106 /// Returns true, if the given line intersects with the current plane 107 /// </summary> 108 /// <param name="line"></param> 109 /// <returns></returns> 99 110 public bool Intersects(Line3D line) { 100 111 return Intersect(line) != null; 101 112 } 102 113 114 /// <summary> 115 /// Returns the point of intersection of a given line and the current plane. 116 /// It returns null if there is no intersection. 117 /// </summary> 118 /// <param name="line"></param> 119 /// <returns></returns> 103 120 public Vector3D Intersect(Line3D line) { 104 121 var denom = Normal * line.Direction;
Note: See TracChangeset
for help on using the changeset viewer.