Exemplo n.º 1
0
        protected override void GenerateInstance(IfcBuilding building)
        {
            DatabaseIfc db    = building.Database;
            IfcBlock    block = new IfcBlock(new IfcAxis2Placement3D(new IfcCartesianPoint(db, 0, 0, 0)), 2000, 800, 800);
            IfcRoundedRectangleProfileDef roundedRectangle  = new IfcRoundedRectangleProfileDef(db, "VoidProfile", 1800, 600, 200);
            IfcExtrudedAreaSolid          extrudedAreaSolid = new IfcExtrudedAreaSolid(roundedRectangle, new IfcAxis2Placement3D(new IfcCartesianPoint(db, 1000, 400, 100)), new IfcDirection(db, 0, 0, 1), 700);
            IfcBooleanResult        booleanResult           = new IfcBooleanResult(IfcBooleanOperator.DIFFERENCE, block, extrudedAreaSolid);
            IfcCsgSolid             csgSolid             = new IfcCsgSolid(booleanResult);
            IfcRepresentationMap    representationMap    = new IfcRepresentationMap(csgSolid);
            IfcMaterial             ceramic              = new IfcMaterial(db, "Ceramic");
            IfcSanitaryTerminalType sanitaryTerminalType = new IfcSanitaryTerminalType(db, "Bath", IfcSanitaryTerminalTypeEnum.BATH)
            {
                MaterialSelect = ceramic
            };

            sanitaryTerminalType.RepresentationMaps.Add(representationMap);
            IfcElement element = sanitaryTerminalType.GenerateMappedItemElement(building, new IfcCartesianTransformationOperator3D(db));

            db.Context.AddDeclared(sanitaryTerminalType);

            //Unique ids assigned to generate constant IfcScript  sample files, remove otherwise
            sanitaryTerminalType.GlobalId = "1HarmwaPv3OeJSXpaoPKpg";
            ceramic.Associates.GlobalId   = "0Pkhszwjv1qRMYyCFg9fjB";
            sanitaryTerminalType.ObjectTypeOf.GlobalId = "1lO$X3e3j9lfVMhNy4MzKB";
            element.GlobalId = "3$$o7C03j0KQeLnoj018fc";
        }
 /// <summary>
 /// returns a Hash for the geometric behaviour of this object
 /// </summary>
 /// <param name="solid"></param>
 /// <returns></returns>
 public static int GetGeometryHashCode(this IfcCsgSolid solid)
 {
     if (solid.TreeRootExpression is IfcBooleanResult)
     {
         return(((IfcBooleanResult)(solid.TreeRootExpression)).GetGeometryHashCode());
     }
     else if (solid.TreeRootExpression is IfcCsgPrimitive3D)
     {
         throw new XbimGeometryException("Hashing of IfcCsgPrimitive3D is not implmeneted yet");
     }
     else
     {
         throw new XbimGeometryException("Hashing of unknown Csg Solid is not implmeneted yet");
     }
 }
Exemplo n.º 3
0
		protected override void GenerateData(STPModelData md, IfcBuilding building)
		{
			IfcBlock block = new IfcBlock(md,Plane.WorldXY,	2000,800,800);
			IfcRoundedRectangleProfileDef roundedRectangle = new IfcRoundedRectangleProfileDef(md, "VoidProfile", 600,1800,200);
			IfcExtrudedAreaSolid extrudedAreaSolid = new IfcExtrudedAreaSolid(roundedRectangle,new IfcAxis2Placement3D(md,new Plane(new Point3d( 1000,400,100),Vector3d.XAxis,Vector3d.YAxis)),new IfcDirection(md,0,0,1),700);
			IfcBooleanResult booleanResult = new IfcBooleanResult(IfcBooleanOperator.DIFFERENCE, block, extrudedAreaSolid);
			IfcCsgSolid csgSolid = new IfcCsgSolid(booleanResult);
			IfcRepresentationMap representationMap = new IfcRepresentationMap(csgSolid);
			IfcMaterial ceramic = new IfcMaterial(md, "Ceramic", "", "");
			ceramic.Associates.GlobalId = "0Pkhszwjv1qRMYyCFg9fjB";
			IfcSanitaryTerminalType sanitaryTerminalType = new IfcSanitaryTerminalType(md, "Bath", IfcSanitaryTerminalTypeEnum.BATH) { GlobalId = "1HarmwaPv3OeJSXpaoPKpg", MaterialSelect = ceramic, RepresentationMaps = new List<IfcRepresentationMap>() {representationMap } };
			sanitaryTerminalType.ObjectTypeOf.GlobalId = "1lO$X3e3j9lfVMhNy4MzKB";
			IfcElement element = sanitaryTerminalType.GenerateMappedItemElement(building, Plane.WorldXY);
			element.GlobalId = "3$$o7C03j0KQeLnoj018fc";
		}
Exemplo n.º 4
0
        protected override void GenerateData(STPModelData md, IfcBuilding building)
        {
            IfcBlock block = new IfcBlock(md, Plane.WorldXY, 2000, 800, 800);
            IfcRoundedRectangleProfileDef roundedRectangle  = new IfcRoundedRectangleProfileDef(md, IfcProfileTypeEnum.AREA, "VoidProfile", null, 600, 1800, 200);
            IfcExtrudedAreaSolid          extrudedAreaSolid = new IfcExtrudedAreaSolid(roundedRectangle, new IfcAxis2Placement3D(md, new Plane(new Point3d(1000, 400, 100), Vector3d.XAxis, Vector3d.YAxis)), new IfcDirection(md, 0, 0, 1), 700);
            IfcBooleanResult     booleanResult     = new IfcBooleanResult(IfcBooleanOperator.DIFFERENCE, block, extrudedAreaSolid);
            IfcCsgSolid          csgSolid          = new IfcCsgSolid(booleanResult);
            IfcRepresentationMap representationMap = new IfcRepresentationMap(csgSolid);
            IfcMaterial          ceramic           = new IfcMaterial(md, "Ceramic", "", "");

            ceramic.Associates.GlobalId = "0Pkhszwjv1qRMYyCFg9fjB";
            IfcSanitaryTerminalType sanitaryTerminalType = new IfcSanitaryTerminalType(md, new IfcElemTypeParams("1HarmwaPv3OeJSXpaoPKpg", "Bath", "", "", ""), ceramic, representationMap, null, IfcSanitaryTerminalTypeEnum.BATH);

            sanitaryTerminalType.ObjectTypeOf.GlobalId = "1lO$X3e3j9lfVMhNy4MzKB";
            sanitaryTerminalType.GenerateMappedItemElement(building, Plane.WorldXY, new IfcElemParams("3$$o7C03j0KQeLnoj018fc", "", "", "", ""));
        }
        /// <summary>
        /// Compares two objects for geomtric equality
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b">object to compare with</param>
        /// <returns></returns>
        public static bool GeometricEquals(this IfcCsgSolid a, IfcRepresentationItem b)
        {
            IfcCsgSolid csg = b as IfcCsgSolid;

            if (csg == null)
            {
                return(false);             //different types are not the same
            }
            if (a.TreeRootExpression is IfcBooleanResult && csg.TreeRootExpression is IfcBooleanResult)
            {
                return(((IfcBooleanResult)(a.TreeRootExpression)).GeometricEquals((IfcBooleanResult)(csg.TreeRootExpression)));
            }
            else if (a.TreeRootExpression is IfcCsgPrimitive3D)
            {
                throw new XbimGeometryException("Equality of IfcCsgPrimitive3D is not implmeneted yet");
            }
            else
            {
                throw new XbimGeometryException("Equality of unknown Csg Solid is not implmeneted yet");
            }
        }
Exemplo n.º 6
0
 public IXbimSolid CreateSolid(IfcCsgSolid ifcSolid)
 {
     return(_engine.CreateSolid(ifcSolid));
 }