Example #1
0
 public void IfcCenterLineProfileDefTest()
 {
     using (var m = IfcStore.Create(new XbimEditorCredentials(), IfcSchemaVersion.Ifc4, XbimStoreType.InMemoryModel))
     {
         using (var txn = m.BeginTransaction())
         {
             var semiCircle = IfcModelBuilder.MakeSemiCircle(m, 20);
             var cl         = IfcModelBuilder.MakeCenterLineProfileDef(m, semiCircle, 5);
             var face       = _xbimGeometryCreator.CreateFace(cl);
             Assert.IsNotNull(face as IXbimFace, "Wrong type returned");
             Assert.IsTrue(((IXbimFace)face).IsValid, "Invalid face returned");
         }
     }
 }
 public void IfcCenterLineProfileDefTest()
 {
     using (var m = XbimModel.CreateTemporaryModel())
     {
         using (var txn = m.BeginTransaction())
         {
             var semiCircle = IfcModelBuilder.MakeSemiCircle(m, 20);
             var cl         = IfcModelBuilder.MakeCenterLineProfileDef(m, semiCircle, 5);
             var face       = _xbimGeometryCreator.CreateFace(cl);
             Assert.IsNotNull(face as IXbimFace, "Wrong type returned");
             Assert.IsTrue(((IXbimFace)face).IsValid, "Invalid face returned");
         }
     }
 }
        public void MirroredProfileDefTest()
        {
            using (var model = IfcStore.Open(@"Ifc4TestFiles\IfcMirroredProfileDef.ifc"))
            {
                var derived  = model.Instances[50] as IIfcDerivedProfileDef;   //derived profile, mirrored by transform
                var mirrored = model.Instances[177] as IIfcMirroredProfileDef; //mirrored versio of above
                Assert.IsNotNull(derived);
                Assert.IsNotNull(mirrored);

                var dFace  = _xbimGeometryCreator.CreateFace(derived);
                var mFace  = _xbimGeometryCreator.CreateFace(mirrored);
                var brepD  = dFace.ToBRep;
                var brepM  = mFace.ToBRep;
                var differ = new Diff();
                var diffs  = differ.DiffText(brepM, brepD);
                Assert.IsTrue(mFace.Normal == dFace.Normal);
                Assert.IsTrue(diffs.Length == 3);
            }
        }
Example #4
0
 public void CircleProfileDefTest()
 {
     using (var m = IfcStore.Create(new XbimEditorCredentials(), IfcSchemaVersion.Ifc4, XbimStoreType.InMemoryModel))
     {
         using (var txn = m.BeginTransaction())
         {
             IfcProfileDef prof = IfcModelBuilder.MakeCircleProfileDef(m, 20);
             var           face = _xbimGeometryCreator.CreateFace(prof);
             Assert.IsTrue(face.Area > 0);
             txn.Commit();
         }
     }
 }
Example #5
0
 public void CircleProfileDefTest()
 {
     using (var m = XbimModel.CreateTemporaryModel())
     {
         using (var txn = m.BeginTransaction())
         {
             IfcProfileDef prof = IfcModelBuilder.MakeCircleProfileDef(m, 20);
             var           face = _xbimGeometryCreator.CreateFace(prof);
             Assert.IsTrue(face.Area > 0);
         }
     }
 }