Example #1
0
        public static BbPolyline2D Create(BbCoordinate2D[] points)
        {
            var pLine = new BbPolyline2D(points);

            BbInstanceDB.AddToExport(pLine);
            return pLine;
        }
Example #2
0
 public static BbDrillHoles Create(BbElement hostElement,
                         BbCoordinate2D position,
                         double radius,
                         SemHoleLocation location,
                         bool through)
 {
     var hole = new BbDrillHoles(hostElement, position, radius, location, through);
     BbInstanceDB.AddToExport(hole);
     return hole;
 }
Example #3
0
        protected BbDrillHoles(
			BbElement hostElement,
			BbCoordinate2D position,
			double radius,
			SemHoleLocation location,
			bool through
		)
            : base(hostElement, position, BbBbNamedCircleProfile.Create(radius), location, through, "Drill Hole")
        {
        }
Example #4
0
        public BbPolyline2D(BbCoordinate2D[] points)
        {
            ifcPolyline = new IfcPolyline();

            ifcPolyline.Points = new List<IfcCartesianPoint> ();

            foreach (var point in points) {
                ifcPolyline.Points.Add( point.IfcCartesianPoint);
            }
        }
 public static BbRectangleOpening Create(BbElement hostElement,
                              BbCoordinate2D position,
                              double width,
                              double height,
                              SemHoleLocation location,
                              bool through)
 {
     var hole = new BbRectangleOpening(hostElement, position, width, height, location, through);
     BbInstanceDB.AddToExport(hole);
     return hole;
 }
 protected BbRectangleOpening(
     BbElement hostElement,
     BbCoordinate2D position,
     double width,
     double height,
     SemHoleLocation location,
     bool through
     )
     : base(hostElement, position, BbNamedRectangleProfile.Create(width, height), location, through, "Rectangle Opening")
 {
 }
Example #7
0
 protected BbSlottedHole(
     BbElement hostElement,
     BbCoordinate2D position,
     double centerToCenter,
     double radius,
     BbDirection2D refDirection,
     SemHoleLocation location,
     bool through
     )
     : base(hostElement, position, BbSlottedHoleProfile.Create(centerToCenter, radius, refDirection),
     location, through, "Slot Hole")
 {
 }
Example #8
0
 public static BbSlottedHole Create(
     BbElement hostElement,
     BbCoordinate2D position,
     double centerToCenter,
     double radius,
     BbDirection2D refDirection,
     SemHoleLocation location,
     bool through
     )
 {
     var sl = new BbSlottedHole(hostElement, position, centerToCenter, radius, refDirection, location, through);
     BbInstanceDB.AddToExport(sl);
     return sl;
 }
 public static BbRectangleOpening Create(BbElement hostElement,
                      BbCoordinate2D position,
                      double width,
                      double height,
                      SemHoleLocation location,
                      bool through,
                      BbPropertySet bbPropertySet,
                      string featureSubType,
                      double rectangleOpeningRoundRadius)
 {
     var hole = new BbRectangleOpening(hostElement, position, width, height, location, through);
     hole.AddRectangleOpeningProperty(bbPropertySet, featureSubType, width, height, rectangleOpeningRoundRadius);
     BbInstanceDB.AddToExport(hole);
     return hole;
 }
Example #10
0
 public static BbSlottedHole Create(
     BbElement hostElement,
     BbCoordinate2D position,
     double centerToCenter,
     double radius,
     BbDirection2D refDirection,
     SemHoleLocation location,
     bool through,
     BbPropertySet bbPropertySet,
     string featureSubType
     )
 {
     var sl = new BbSlottedHole(hostElement, position, centerToCenter, radius, refDirection, location, through);
     sl.AddSlottedHoleProperty(bbPropertySet, featureSubType, centerToCenter, centerToCenter + (radius * 2), radius);
     BbInstanceDB.AddToExport(sl);
     return sl;
 }
Example #11
0
        void SetBbDirection2D()
        {
            XAxis2D = RefDirection2D = BbDirection2D.Create(1, 0);
            YAxis2D = BbDirection2D.Create(0, 1);
            XAxisMinus2D = BbDirection2D.Create(-1, 0);
            YAxisMinus2D = BbDirection2D.Create(0, -1);

            Origin2D = BbCoordinate2D.Create();
            Position2D = BbPosition2D.Create(Origin2D, RefDirection2D);
        }
Example #12
0
        public void SetContext()
        {
            SetBbDirection3D();

            Origin2D = BbCoordinate2D.Create();
            SetBbDirection2D();

            GeometricRepresentationContext = new IfcGeometricRepresentationContext
            {
                ContextType = "Model",
                CoordinateSpaceDimension = 3,
                Precision = 1E-08,
                WorldCoordinateSystem = new IfcAxis2Placement
                {
                    Value = DefaultBbPosition3D.IfcAxis2Placement3D
                }
            };
        }
Example #13
0
 public static BbCoordinate2D Create(double x, double y)
 {
     var coord2D = new BbCoordinate2D(x, y);
     BbInstanceDB.AddToExport(coord2D);
     return coord2D;
 }
Example #14
0
        protected BbOpening(
            BbElement hostElement,
            BbCoordinate2D position,
            BbProfile profile,
            SemHoleLocation location,
            bool through,
            string type
            )
        {
            var mainPart = hostElement as BbPiece;
            if (mainPart == null)
                return;

            double thickness;
            BbPosition3D pos;

            // x direction follows extrusion direction
            // extrude origin  projected to bottom or left becomes the origin

            switch (location)
            {

                case SemHoleLocation.Left:
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            -(mainPart.Profile.Width / 2),
                            position.Y,
                            position.X),
                        BbHeaderSetting.Setting3D.XAxis,
                        BbHeaderSetting.Setting3D.ZAxis);
                    if (through)
                        thickness = mainPart.Profile.Width;
                    else
                        thickness = mainPart.Profile.Width / 2;
                    break;
                case SemHoleLocation.Right:
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            (mainPart.Profile.Width / 2),
                            position.Y,
                            position.X),
                        BbHeaderSetting.Setting3D.XAxisMinus,
                        BbHeaderSetting.Setting3D.ZAxis);
                    if (through)
                        thickness = mainPart.Profile.Width;
                    else
                        thickness = mainPart.Profile.Width / 2;
                    break;
                case SemHoleLocation.Web:
                    if (through)
                    {
                        pos = BbPosition3D.Create(
                            BbCoordinate3D.Create(
                                (mainPart.Profile.Width / 2),
                                position.Y,
                                position.X
                                ),
                            BbHeaderSetting.Setting3D.XAxisMinus,
                            BbHeaderSetting.Setting3D.ZAxis);
                        thickness = mainPart.Profile.Width;
                    }
                    else
                    {
                        pos = BbPosition3D.Create(
                            BbCoordinate3D.Create(
                                (mainPart.Profile.Width / 4),
                                position.Y,
                                position.X
                                ),
                            BbHeaderSetting.Setting3D.XAxisMinus,
                            BbHeaderSetting.Setting3D.ZAxis);
                        thickness = mainPart.Profile.Width / 2;
                    }
                    break;

                case SemHoleLocation.Bottom:
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            position.Y,
                            -(mainPart.Profile.Depth / 2),
                            position.X
                            ),
                        BbHeaderSetting.Setting3D.YAxis,
                        BbHeaderSetting.Setting3D.ZAxis);
                    if (through)
                        thickness = mainPart.Profile.Depth;
                    else
                        thickness = mainPart.Profile.Depth / 2;
                    break;
                case SemHoleLocation.Top:
                default:
                    pos = BbPosition3D.Create(
                        BbCoordinate3D.Create(
                            position.Y,
                            (mainPart.Profile.Depth / 2),
                            position.X
                            ),
                        BbHeaderSetting.Setting3D.YAxisMinus,
                        BbHeaderSetting.Setting3D.ZAxis);
                    if (through)
                        thickness = mainPart.Profile.Depth;
                    else
                        thickness = mainPart.Profile.Depth / 2;
                    break;
            }

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

            BbExtrudedGeometry bbExtrudedGeometry = BbExtrudedGeometry.Create(
                profile,
                BbHeaderSetting.Setting3D.DefaultBbPosition3D,
                BbHeaderSetting.Setting3D.ZAxis,
                thickness);

            _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 = type,
                    RelatingBuildingElement = hostElement.IfcObject as IfcElement,
                    RelatedOpeningElement = _ifcOpeningElement,
                };
        }
Example #15
0
 public static BbOpening Create(BbElement hostElement,
                              BbCoordinate2D position,
                              BbProfile profile,
                              SemHoleLocation location,
                              bool through,
     string type)
 {
     var hole = new BbOpening(hostElement, position, profile, location, through, type);
     BbInstanceDB.AddToExport(hole);
     return hole;
 }