Beispiel #1
0
        public BbPolyline2D(BbCoordinate2D[] points)
        {
            ifcPolyline = new IfcPolyline();

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

            foreach (var point in points) {
                ifcPolyline.Points.Add( point.IfcCartesianPoint);
            }
        }
Beispiel #2
0
        public BbPolyline3D(BbCoordinate3D[] points)
        {
            base.IfcCurve = _ifcPolyline = new IfcPolyline();

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

            foreach (var point in points) {
                _ifcPolyline.Points.Add( point.IfcCartesianPoint);
            }
        }
Beispiel #3
0
        public BbCurveGeometry(
             BbPolyline3D bbPolyline3D
            )
        {
            _ifcPolyline = bbPolyline3D.IfcCurve as IfcPolyline;

            _ifcShapeRepresentation = new IfcShapeRepresentation
                {
                    ContextOfItems = BbHeaderSetting.Setting3D.GeometricRepresentationContext,
                    RepresentationIdentifier = "Body",
                    RepresentationType = "GeometricCurveSet",
                    Items = new List<IfcRepresentationItem>(),
                };
            _ifcShapeRepresentation.Items.Add(_ifcPolyline);

            _ifcProductDefinitionShape = new IfcProductDefinitionShape
                {
                    // Name=
                    // Description =
                    Representations = new List<IfcRepresentation>(),
                };
            _ifcProductDefinitionShape.Representations.Add(_ifcShapeRepresentation);
        }
        public BbSlottedHoleProfile(double cToCDistance, double radius)
        {
            var cir1 = new IfcCircle
                {
                    Position = new IfcAxis2Placement
                        {
                            Value =  new IfcAxis2Placement2D
                                {
                                    Location = new IfcCartesianPoint(cToCDistance / 2.0, 0),
                                },
                        },
                    Radius = radius,
                };
            var trimmed1 = new IfcTrimmedCurve
                {
                    BasisCurve = cir1,
                    Trim1 = new List<IfcTrimmingSelect>{new IfcTrimmingSelect{Value = new IfcParameterValue{Value = 270}}},
                    Trim2 = new List<IfcTrimmingSelect> { new IfcTrimmingSelect { Value = new IfcParameterValue { Value = 90 } } },
                    SenseAgreement = true,
                    MasterRepresentation = IfcTrimmingPreference.PARAMETER,
                };

            var line1 = new IfcPolyline
                {
                    Points = new List<IfcCartesianPoint>
                        {
                            new IfcCartesianPoint(cToCDistance / 2.0, radius),
                            new IfcCartesianPoint(cToCDistance / -2.0, radius),
                        },
                };

            var cir2 = new IfcCircle
                {
                    Position = new IfcAxis2Placement
                        {
                            Value = new IfcAxis2Placement2D
                                {
                                    Location = new IfcCartesianPoint(cToCDistance / -2.0, 0),
                                },
                        },
                    Radius = radius,
                };
            var trimmed2 = new IfcTrimmedCurve
                {
                    BasisCurve = cir2,
                    Trim1 = new List<IfcTrimmingSelect> { new IfcTrimmingSelect { Value = new IfcParameterValue { Value = 90 } } },
                    Trim2 = new List<IfcTrimmingSelect> { new IfcTrimmingSelect { Value = new IfcParameterValue { Value = 270 } } },
                    SenseAgreement = true,
                    MasterRepresentation = IfcTrimmingPreference.PARAMETER,
                };

            var line2 = new IfcPolyline
                {
                    Points = new List<IfcCartesianPoint>
                        {
                            new IfcCartesianPoint(cToCDistance / -2.0, -radius),
                            new IfcCartesianPoint(cToCDistance / 2.0, -radius),
                        },
                };

            var seg1 = new IfcCompositeCurveSegment
                {
                    Transition = IfcTransitionCode.CONTSAMEGRADIENTSAMECURVATURE,
                    SameSense = true,
                    ParentCurve = trimmed1,
                };
            var seg2 = new IfcCompositeCurveSegment
                {
                    Transition = IfcTransitionCode.CONTSAMEGRADIENTSAMECURVATURE,
                    SameSense = true,
                    ParentCurve = line1,
                };

            var seg3 = new IfcCompositeCurveSegment
                {
                    Transition = IfcTransitionCode.CONTSAMEGRADIENTSAMECURVATURE,
                    SameSense = true,
                    ParentCurve = trimmed2,
                };
            var seg4 = new IfcCompositeCurveSegment
                {
                    Transition = IfcTransitionCode.CONTSAMEGRADIENTSAMECURVATURE,
                    SameSense = true,
                    ParentCurve = line2,
                };

            var cCurve = new IfcCompositeCurve
                {
                    Segments = new List<IfcCompositeCurveSegment>
                        {
                            seg1, seg2, seg3, seg4
                        },
                    SelfIntersect = EbInstanceModel.LOGICAL.dbTrue,

                };

            _ifcProfileDef = new IfcArbitraryClosedProfileDef
                {
                    ProfileType = IfcProfileTypeEnum.AREA,
                    OuterCurve = cCurve,
                };
        }