예제 #1
0
 public IXbimCurve CreateCurve(IIfcCurve curve, ILogger logger)
 {
     using (new Tracer(LogHelper.CurrentFunctionName(), this._logger, curve))
     {
         return(_engine.CreateCurve(curve, logger));
     }
 }
예제 #2
0
 private static void Report(IIfcCurve obj, TextHighliter sb)
 {
     if (obj is IIfcCompositeCurve)
     {
         Report((IIfcCompositeCurve)obj, sb);
     }
     else if (obj is IIfcTrimmedCurve)
     {
         Report((IIfcTrimmedCurve)obj, sb);
     }
     else if (obj is IIfcCircle)
     {
         Report((IIfcCircle)obj, sb);
     }
     else if (obj is IIfcPolyline)
     {
         Report((IIfcPolyline)obj, sb);
     }
     else if (obj is IIfcLine)
     {
         Report((IIfcLine)obj, sb);
     }
     else
     {
         sb.Append($"{obj.GetType().Name} not implemented in IIfcCurve.", Brushes.Red);
     }
 }
        public static List <MctNode> TranslateNodes(IIfcCurve directrix, List <double> distAlong, int index)
        {
            var nodes = new List <MctNode>();

            if (directrix is IIfcOffsetCurveByDistances ocbd)
            {
                var basicCurve = ocbd.BasisCurve;
                if (basicCurve is IIfcAlignmentCurve ac)
                {
                    for (int i = 0; i < distAlong.Count; i++)
                    {
                        double startDist      = ocbd.OffsetValues[0].DistanceAlong + distAlong[i];
                        double offsetLateral  = ocbd.OffsetValues[0].OffsetLateral.Value;
                        double offserVertical = ocbd.OffsetValues[0].OffsetVertical.Value;
                        var    vz             = new XbimVector3D(0, 0, 1);
                        double height         = ac.Vertical.Segments[0].StartHeight;
                        var    horSegs        = ac.Horizontal.Segments;
                        (var pt, var vy) = Utilities.GeometryEngine.GetPointByDistAlong(horSegs, startDist);
                        var position = pt + vy * offsetLateral + vz * (offserVertical + height);
                        nodes.Add(new MctNode(index * distAlong.Count + i + 1, position.X, position.Y, position.Z));
                    }
                }
            }
            return(nodes);
        }
예제 #4
0
        public static Dictionary <int, LinearPath> DicLinPathOfProductsGet(List <IIfcProduct> lstProduct)
        {
            Dictionary <int, LinearPath> dicLinPath = new Dictionary <int, LinearPath>();

            for (int i = 0; i < lstProduct.Count; i++)
            {
                IIfcRepresentationItem repItem = lstProduct[i].Representation.Representations.First.Items.First;
                IIfcProfileDef         profile = (repItem as IIfcExtrudedAreaSolid).SweptArea;
                IIfcCurve curve = (profile as IIfcArbitraryClosedProfileDef).OuterCurve;

                IIfcPolyline pLine = curve as IfcPolyline;
                IItemSet <IIfcCartesianPoint> ptSet = pLine.Points;

                List <Point3D> lstPt = new List <Point3D>();

                for (int j = 0; j < ptSet.Count; j++)
                {
                    lstPt.Add(new Point3D(ptSet[j].X, ptSet[j].Y, ptSet[j].Z));
                }
                dicLinPath.Add(lstProduct[i].EntityLabel, new LinearPath(lstPt));
            }
            return(dicLinPath);
        }
예제 #5
0
 public IXbimCurve CreateCurve(IIfcCurve curve)
 {
     return(_engine.CreateCurve(curve));
 }
예제 #6
0
 public IXbimWire CreateWire(IIfcCurve curve)
 {
     return(_engine.CreateWire(curve));
 }