Exemplo n.º 1
0
        public Projector ToProjector(Database db, Transaction trans)
        {
            var sourceCurve = AcadHelpers.GetObject <Polyline>(SourceCurveHandle, db, trans);
            var targetCurve = AcadHelpers.GetObject <Polyline>(TargetCurveHandle, db, trans);

            var notches = SourceNotchLines.Select(lineHandle =>
            {
                var line = AcadHelpers.GetObject <Line>(lineHandle, db, trans);
                return(AcadHelpers.GetSingleIntersection(sourceCurve, line));
            });

            return(new Projector(sourceCurve, notches.ToList(), targetCurve, TargetFacetPercentages));
        }
Exemplo n.º 2
0
        public (Curve sourceCurve, IEnumerable <Point3d> sourceNotches, Curve targetCurve) ToObjects(Database db, Transaction trans)
        {
            var sourceCurve = AcadHelpers.GetObject <Polyline>(SourceCurveHandle, db, trans);
            var targetCurve = AcadHelpers.GetObject <Polyline>(TargetCurveHandle, db, trans);

            var notches = SourceNotchLines.Select(lineHandle =>
            {
                var line = AcadHelpers.GetObject <Line>(lineHandle, db, trans);
                return(AcadHelpers.GetSingleIntersection(sourceCurve, line));
            });

            return(sourceCurve, notches.ToList(), targetCurve);
        }
Exemplo n.º 3
0
        public void ShouldFindNotchPointsByLinesOnCurve()
        {
            DwgTest.ExecuteActionsInDwg(KnownValues.Notches1.DrawingPath, (db, trans) =>
            {
                var sourceCurve = AcadHelpers.GetObject <Polyline>(KnownValues.Notches1.SourceCurveHandle, db, trans);

                foreach (var lineHandle in KnownValues.Notches1.SourceNotchLines)
                {
                    var line = AcadHelpers.GetObject <Line>(lineHandle, db, trans);
                    AcadHelpers.GetSingleIntersection(sourceCurve, line);
                }
            });
        }