/// <summary>
 /// Compares two objects for geometric equality
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b">object to compare with</param>
 /// <returns></returns>
 public static bool GeometricEquals(this IfcFace a, IfcFace b)
 {
     if (a.Equals(b)) return true;
     if (a.Bounds.Count != b.Bounds.Count) return false;
     List<IfcFaceBound> aFaceBounds = a.Bounds.ToList();
     List<IfcFaceBound> bFaceBounds = b.Bounds.ToList();
     for (int i = 0; i < aFaceBounds.Count; i++)
     {
         if (!(aFaceBounds[i].GeometricEquals(bFaceBounds[i])))
             return false;
     }
     return true;
 }
Ejemplo n.º 2
0
        private IfcFace AddFace(bool orientation, XbimFaceTypeEnum type)
        {
            _actualFaceType = type;

            _face = GetFace(type);
            _faces.Add_Reversible(_face);

            //if (_face.Bounds == null) _face.Bounds = new XbimSet<IfcFaceBound>();

            IfcFaceBound faceBound = _document.Model.Instances.New<IfcFaceBound>();
            _face.Bounds.Add_Reversible(faceBound);

            faceBound.Orientation = orientation;
            IfcPolyLoop polyLoop = _document.Model.Instances.New<IfcPolyLoop>();
            faceBound.Bound = polyLoop;

            //if (polyLoop.Polygon == null) polyLoop.Polygon = new XbimListUnique<IfcCartesianPoint>();
            _newPoints = polyLoop.Polygon;

            return _face;
        }