Esempio n. 1
0
        public override Point3F GetInitialCutPoint()
        {
            if (_toolpaths.Count == 0)
            {
                return(Point3F.Undefined);
            }
            Toolpath tp0 = _toolpaths[0];

            if (tp0.Leadin != null)
            {
                return(new Point3F(tp0.Leadin.FirstPoint.X, tp0.Leadin.FirstPoint.Y, tp0.Leadin.FirstPoint.Z + tp0.Bottom));
            }
            if (tp0.Trajectory.Count == 0)
            {
                return(Point3F.Undefined);
            }
            Sliced_path_item ppi = tp0.Trajectory[0];

            if (ppi.Points.Count == 0)
            {
                return(Point3F.Undefined);
            }
            Point3F pt = ppi.Points[0].Point;

            return(new Point3F(pt.X, pt.Y, tp0.Bottom));
        }
Esempio n. 2
0
        private Polyline gen_leadin(Toolpath path)
        {
            Sliced_path_item spiral = path.Trajectory[0];

            if (spiral.Item_type != Sliced_path_item_type.SPIRAL)
            {
                throw new Exception("no spiral in sliced path");
            }

            Vector2F start_normal = Vector2F.Undefined;

            if (path.Trajectory.Extension != null && path.Trajectory.Extension is Traj_metainfo)
            {
                Traj_metainfo meta = (Traj_metainfo)path.Trajectory.Extension;
                start_normal = meta.Start_normal;
            }

            LeadMoveInfo move = _leadin.Cached;
            Polyline     p    = move.GetLeadInToolPath(spiral,
                                                       spiral.Direction,
                                                       start_normal,
                                                       base.PlungeFeedrate.Cached,
                                                       base.CutFeedrate.Cached,
                                                       base.StockSurface.Cached,
                                                       _depth_increment.Cached,
                                                       path.Bottom,
                                                       move.ValidSpiralAngle, path.Top - path.Bottom);

            return(p);
        }