/// <summary> 构造函数 </summary> /// <param name="docMdf"></param> /// <param name="roadCurve"></param> /// <param name="groundCurve"></param> public LongitudinalSection(DocumentModifier docMdf, CompositeCurve3d roadCurve, CompositeCurve3d groundCurve) { _docMdf = docMdf; RoadCurve2d = roadCurve.Get2dLinearCurve(); GroundCurve2d = groundCurve.Get2dLinearCurve(); // StartStation = RoadCurve2d.StartPoint.X; EndStation = RoadCurve2d.EndPoint.X; // 求交点 Intersects = new CurveCurveIntersector2d(RoadCurve2d, GroundCurve2d); GetIntersects(); //_road = Curve.CreateFromGeCurve(roadCurve) as Polyline; //_ground = Curve.CreateFromGeCurve(groundCurve) as Polyline; }
/// <summary> 将三维折线多段线投影到XY平面上,以转换为二维多段线 </summary> /// <param name="pl"></param> /// <returns></returns> public static CompositeCurve2d Get2dLinearCurve(this CompositeCurve3d pl) { LineSegment2d seg2d; var curve3ds = pl.GetCurves(); var seg2ds = new Curve2d[curve3ds.Length]; Curve3d c; for (int i = 0; i < curve3ds.Length; i++) { c = curve3ds[i]; seg2d = new LineSegment2d(c.StartPoint.ToXYPlane(), c.EndPoint.ToXYPlane()); seg2ds[i] = (seg2d); } return(new CompositeCurve2d(seg2ds)); }
/// <summary> 构造方式二: 通过<seealso cref="SubgradeSection" /> 进行指定 </summary> /// <param name="docMdf"></param> /// <param name="pline"></param> /// <param name="axis"></param> /// <param name="onLeft"></param> /// <param name="isFill"></param> /// <param name="retainingWall"></param> public SlopeLine(DocumentModifier docMdf, Polyline pline, SubgradeSection axis, bool onLeft, bool isFill, RetainingWallType retainingWallType, Polyline retainingWall = null) { _docMdf = docMdf; // Pline = pline; Section = axis; Station = axis.XData.Station; _onLeft = onLeft; _isFill = isFill; _retainingWallType = retainingWallType; _retainingWall = retainingWall; if (retainingWall != null) { _retainingWallCurve = _retainingWall.GetGeCurve() as CompositeCurve3d; } // 构造边坡系统 ConstructSlopeSys(pline, out _slopes, out _platforms); }
public Relation(StructurePosition str, TextPosition txt) { StructurePosition = str; TextPosition = txt; Point3d txtPt = TextPosition.GetCenter(); CompositeCurve3d txtCurve = TextPosition.BoxCurve; Point3d blockPos = StructurePosition.Position; //точка вставки блока находится внутри коробки текста? Point2d maxPt = new Point2d(txt.Envelope.MaxX, txt.Envelope.MaxY); Point2d minPt = new Point2d(txt.Envelope.MinX, txt.Envelope.MinY); if (Utils.PointInsideBoundingBox(maxPt, minPt, new Point2d(blockPos.X, blockPos.Y))) { Distance = 0; } else { Distance = txtCurve.GetDistanceTo(blockPos); } CenterDistance = txtPt.DistanceTo(blockPos); }