internal override void BuildPlan(PlanBuilder3D builder, MillingWorkspacePanel workspace)
        {
            builder.GotoZeroLevel();

            var maxDepth    = _millingDepth;
            var upDown      = true;
            var stepLength  = 1.0;
            var resolutionX = _shapeMetricSize.Width / stepLength;
            var resolutionY = _shapeMetricSize.Height / stepLength;

            for (var xi = 0.0; xi < resolutionX; xi += stepLength)
            {
                for (var yi = 0.0; yi < resolutionY; yi += stepLength)
                {
                    var xRatio = 1.0 * xi / resolutionX;
                    var yRatio = 1.0 * yi / resolutionY;

                    var depth = _shapeMap.GetHeight(xRatio, yRatio) * _millingDepth;
                    var x     = _shapeMetricSize.Width * xRatio;
                    var y     = _shapeMetricSize.Height * yRatio;
                    if (!upDown)
                    {
                        y = _shapeMetricSize.Height - y;
                    }

                    var point = new Point3Dmm(PositionX + x, PositionY + y, depth);
                    builder.AddCuttingSpeedTransition(new Point2Dmm(point.X, point.Y), point.Z);
                }
                upDown = !upDown;
            }

            builder.GotoTransitionLevel();
            builder.AddRampedLine(EntryPoint);
        }
示例#2
0
        internal override void BuildPlan(PlanBuilder3D builder, MillingWorkspacePanel workspace)
        {
            var reliefPoints = TransformedShapeDefinition;

            builder.GotoZeroLevel();

            var maxDepth = _millingDepth;
            var upDown   = true;

            for (var x = 0; x < _width; ++x)
            {
                for (var i = 0; i < _height; ++i)
                {
                    var y     = upDown ? i : _height - i - 1;
                    var point = reliefPoints[x, y];
                    if (point.Z > maxDepth)
                    {
                        point = new Point3Dmm(point.X, point.Y, maxDepth);
                    }

                    builder.AddCuttingSpeedTransition(new Point2Dmm(point.X, point.Y), point.Z);
                }
                upDown = !upDown;
            }

            builder.GotoTransitionLevel();
            builder.AddRampedLine(EntryPoint);
        }