コード例 #1
0
 public IXbimCurve CreateCurve(IIfcCurve curve, ILogger logger)
 {
     using (new Tracer(LogHelper.CurrentFunctionName(), this._logger, curve))
     {
         return(_engine.CreateCurve(curve, logger));
     }
 }
コード例 #2
0
ファイル: GeometryView.cs プロジェクト: wyh9462/XbimWindowsUI
 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);
     }
 }
コード例 #3
0
        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
ファイル: IFCHelper.cs プロジェクト: 15831944/CADTo3D-1
        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));
 }