Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/20/17 16:15:38 (6 years ago)
Author:
rhanghof
Message:

#2817:

  • Unittests
  • Bugfixes on the line projection based extreme point creation method
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Geometry/Plane3D.cs

    r15454 r15554  
    66
    77namespace HeuristicLab.Problems.BinPacking3D.Geometry {
    8   internal enum Side { Top, Left, Bottom, Right, Front, Back }
     8  public enum Side { Top, Left, Bottom, Right, Front, Back }
    99
    1010  /// <summary>
    1111  /// A plane is given as a point and two directing vectors
    1212  /// </summary>
    13   internal class Plane3D {
     13  public class Plane3D {
    1414    public Vector3D Point { get; private set; }
    1515    public Vector3D Direction1 { get; private set; }
    1616    public Vector3D Direction2 { get; private set; }
    1717    public Vector3D Normal { get; private set; }
     18
    1819    private int rhs;
    1920
     
    9394    }
    9495
     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>
    95101    public bool IsElementOf(Vector3D point) {
    96102      return Normal.X * point.X + Normal.Y * point.Y + Normal.Z * point.Z == rhs;
    97103    }
    98104
     105    /// <summary>
     106    /// Returns true, if the given line intersects with the current plane
     107    /// </summary>
     108    /// <param name="line"></param>
     109    /// <returns></returns>
    99110    public bool Intersects(Line3D line) {
    100111      return Intersect(line) != null;
    101112    }
    102113
     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>
    103120    public Vector3D Intersect(Line3D line) {
    104121      var denom = Normal * line.Direction;
Note: See TracChangeset for help on using the changeset viewer.