Пример #1
0
        internal override void BuildPlan(PlanBuilder3D builder, MillingWorkspacePanel workspace)
        {
            var offsetLines  = afterScaleTransformation(_currentOffsetLines);
            var currentDepth = 0.0;

            while (currentDepth < MillingDepth)
            {
                var depthIncrement = Math.Min(workspace.MaxLayerCut, MillingDepth - currentDepth);
                currentDepth += depthIncrement;

                foreach (var cluster in offsetLines)
                {
                    builder.GotoTransitionLevel();
                    builder.AddRampedLine(cluster[0]);


                    builder.GotoZ(currentDepth);
                    foreach (var point in cluster)
                    {
                        builder.AddCuttingSpeedTransition(point);
                    }
                }
            }
            builder.GotoTransitionLevel();
            builder.AddRampedLine(EntryPoint);
        }
Пример #2
0
        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);
        }
Пример #3
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);
        }
Пример #4
0
        internal override void BuildPlan(PlanBuilder3D builder, MillingWorkspacePanel workspace)
        {
            var offsetLines = afterScaleTransformation(_currentOffsetLines);

            if (!offsetLines.Any() || !offsetLines.First().Any())
            {
                return;
            }

            builder.AddRampedLine(offsetLines.First().First());
            var currentDepth = 0.0;

            while (currentDepth <= MillingDepth)
            {
                builder.GotoZ(currentDepth);

                foreach (var cluster in offsetLines)
                {
                    foreach (var point in cluster)
                    {
                        builder.AddCuttingSpeedTransition(point);
                    }
                }

                var depthIncrement = Math.Min(workspace.MaxLayerCut, MillingDepth - currentDepth);
                if (depthIncrement <= 0)
                {
                    break;
                }
                currentDepth += depthIncrement;
            }
            builder.GotoTransitionLevel();
            builder.AddRampedLine(EntryPoint);
        }
Пример #5
0
        internal void BuildPlan(PlanBuilder3D builder, MillingWorkspacePanel workspace)
        {
            var initialPoint = builder.CurrentPoint;

            var entryPoint = Item2.EntryPoint;

            builder.GotoTransitionLevel();
            builder.AddRampedLine(entryPoint);

            Item2.BuildPlan(builder, workspace);
            builder.GotoTransitionLevel();

            foreach (var outgoingJoin in workspace.FindOutgoingJoins(Item2))
            {
                outgoingJoin.BuildPlan(builder, workspace);
            }

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