Exemplo n.º 1
0
        public static BbCopeProfile Create(double copeWidth,
                                           double copeDepth,
                                           double copeRadius)
        {
            var profile = new BbCopeProfile(copeWidth, copeDepth, copeRadius);

            BbInstanceDB.AddToExport(profile);
            return(profile);
        }
Exemplo n.º 2
0
        /// <summary>
        /// wrong implementation
        /// </summary>
        /// <param name="extrudedGeometry"></param>
        /// <returns></returns>
        public static BbCopeProfile Retrieve(BbExtrudedGeometry extrudedGeometry)
        {
            var ret = new BbCopeProfile();

            //var profileDef = extrudedGeometry._ifcExtrudedAreaSolid.SweptArea as IfcArbitraryClosedProfileDef;
            //var semCoProfile = new BbCopeProfile { IfcProfileDef = profileDef };
            //BbInstanceDB.AddToExport(semCoProfile);
            //ret = semCoProfile;
            return(ret);
        }
Exemplo n.º 3
0
        public BbCutCope(
            BbElement hostElement,
            double copeWidth,
            double copeDepth,
            double copeRadius,
            double[] position)
        {
            BbCopeProfile profile = BbCopeProfile.Create(copeWidth, copeDepth, copeRadius);

            var mainPart = hostElement as BbPiece;

            if (mainPart == null)
            {
                return;
            }

            BbPosition3D pos = BbPosition3D.Create(
                BbCoordinate3D.Create(position),
                BbHeaderSetting.Setting3D.XAxisMinus,
                BbHeaderSetting.Setting3D.ZAxis);

            ObjectBbLocalPlacement = BbLocalPlacement3D.Create(
                hostElement.ObjectBbLocalPlacement, pos);

            BbExtrudedGeometry bbExtrudedGeometry = BbExtrudedGeometry.Create(
                profile,
                BbHeaderSetting.Setting3D.DefaultBbPosition3D,
                BbHeaderSetting.Setting3D.ZAxis,
                mainPart.Profile.Width);

            _ifcOpeningElement = new IfcOpeningElement
            {
                GlobalId     = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory = hostElement.IfcObject.OwnerHistory,
                // Name =
                // Description =
                ObjectType      = "Opening",
                ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement,
                Representation  = bbExtrudedGeometry.IfcProductDefinitionShape,
            };

            _ifcRelVoidsElement = new IfcRelVoidsElement
            {
                GlobalId                = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory            = hostElement.IfcObject.OwnerHistory,
                Name                    = "Cope",
                RelatingBuildingElement = hostElement.IfcObject as IfcElement,
                RelatedOpeningElement   = _ifcOpeningElement,
            };
        }
Exemplo n.º 4
0
        BbCutCope(
            BbElement hostElement,
            double copeWidth,
            double copeDepth,
            double copeRadius,
            SemCopeLocation copeLocation)
        {
            BbCopeProfile profile = BbCopeProfile.Create(copeWidth, copeDepth, copeRadius, copeLocation);

            var mainPart = hostElement as BbPiece;

            if (mainPart == null)
            {
                return;
            }

            BbPosition3D pos;

            switch (copeLocation)
            {
            case SemCopeLocation.BottomLeft:
                pos = BbPosition3D.Create(
                    BbCoordinate3D.Create(new double[] {
                    mainPart.Profile.Width / 2,
                    -mainPart.Profile.Depth / 2,
                    0
                }),
                    BbHeaderSetting.Setting3D.XAxisMinus,
                    BbHeaderSetting.Setting3D.ZAxis);
                break;

            case SemCopeLocation.BottomRight:
                pos = BbPosition3D.Create(
                    BbCoordinate3D.Create(new double[] {
                    mainPart.Profile.Width / 2,
                    -mainPart.Profile.Depth / 2,
                    mainPart.Length
                }),
                    BbHeaderSetting.Setting3D.XAxisMinus,
                    BbHeaderSetting.Setting3D.ZAxis);
                break;

            case SemCopeLocation.TopRight:
                pos = BbPosition3D.Create(
                    BbCoordinate3D.Create(new double[] {
                    mainPart.Profile.Width / 2,
                    mainPart.Profile.Depth / 2,
                    mainPart.Length
                }),
                    BbHeaderSetting.Setting3D.XAxisMinus,
                    BbHeaderSetting.Setting3D.ZAxis);
                break;

            default:     // TopLeft
                pos = BbPosition3D.Create(
                    BbCoordinate3D.Create(new double[] {
                    mainPart.Profile.Width / 2,
                    mainPart.Profile.Depth / 2,
                    0
                }),
                    BbHeaderSetting.Setting3D.XAxisMinus,
                    BbHeaderSetting.Setting3D.ZAxis);
                break;
            }

            ObjectBbLocalPlacement = BbLocalPlacement3D.Create(
                hostElement.ObjectBbLocalPlacement, pos);

            BbExtrudedGeometry bbExtrudedGeometry = BbExtrudedGeometry.Create(
                profile,
                BbHeaderSetting.Setting3D.DefaultBbPosition3D,
                BbHeaderSetting.Setting3D.ZAxis,
                mainPart.Profile.Width);

            _ifcOpeningElement = new IfcOpeningElement
            {
                GlobalId     = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory = hostElement.IfcObject.OwnerHistory,
                // Name =
                // Description =
                ObjectType      = "Opening",
                ObjectPlacement = ObjectBbLocalPlacement.IfcLocalPlacement,
                Representation  = bbExtrudedGeometry.IfcProductDefinitionShape,
            };

            _ifcRelVoidsElement = new IfcRelVoidsElement
            {
                GlobalId                = IfcGloballyUniqueId.NewGuid(),
                OwnerHistory            = hostElement.IfcObject.OwnerHistory,
                Name                    = "Cope",
                RelatingBuildingElement = hostElement.IfcObject as IfcElement,
                RelatedOpeningElement   = _ifcOpeningElement,
            };
        }