예제 #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";
        }
예제 #2
0
파일: Bath.cs 프로젝트: mccune/IfcScript
		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";
		}
        /// <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  IfcBooleanResult a, IfcRepresentationItem b)
        {
            IfcBooleanResult p = b as IfcBooleanResult;

            if (p == null)
            {
                return(false);           //different types are not the same
            }
            if (a.Equals(p))
            {
                return(true);
            }
            return(a.FirstOperand.EntityLabel == p.FirstOperand.EntityLabel &&
                   a.SecondOperand.EntityLabel == p.SecondOperand.EntityLabel &&
                   a.Operator == p.Operator);
        }
예제 #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", "", "", "", ""));
        }
예제 #5
0
        public static IfcBooleanResult Rotate(this IfcBooleanResult representation,
                                              double[] rotation)
        {   //An IfcBooleanResult is rotated by recursively rotating every operand
            // === first operand
            if (representation.FirstOperand is IfcSweptAreaSolid)
            {
                ((IfcSweptAreaSolid)representation.FirstOperand).Rotate(rotation);
            }
            if (representation.FirstOperand is IfcBooleanResult)
            {
                ((IfcBooleanResult)representation.FirstOperand).Rotate(rotation);
            }
            if (representation.FirstOperand is IfcCsgPrimitive3D)
            {
                ((IfcCsgPrimitive3D)representation.FirstOperand).Position.Rotate(rotation);
            }

            // === second operand
            if (representation.SecondOperand is IfcSweptAreaSolid)
            {
                ((IfcSweptAreaSolid)representation.SecondOperand).Rotate(rotation);
            }
            if (representation.SecondOperand is IfcBooleanResult)
            {
                ((IfcBooleanResult)representation.SecondOperand).Rotate(rotation);
            }
            if (representation.SecondOperand is IfcCsgPrimitive3D)
            {
                ((IfcCsgPrimitive3D)representation.SecondOperand).Position.Rotate(rotation);
            }
            if (representation.SecondOperand is IfcHalfSpaceSolid)
            {
                ((IfcPlane)((IfcHalfSpaceSolid)representation.SecondOperand).BaseSurface)
                .Position.Rotate(rotation);
            }
            return(representation);
        }
 /// <summary>
 /// returns a Hash for the geometric behaviour of this object
 /// </summary>
 /// <param name="solid"></param>
 /// <returns></returns>
 public static int GetGeometryHashCode(this  IfcBooleanResult bResult)
 {
     return((bResult.FirstOperand.EntityLabel ^ bResult.SecondOperand.EntityLabel).GetHashCode()); //good enough for most
 }
예제 #7
0
 public IXbimSolidSet CreateSolidSet(IfcBooleanResult boolOp)
 {
     return(_engine.CreateSolidSet(boolOp));
 }