コード例 #1
0
ファイル: URVector.cs プロジェクト: ospqul/UR-Controller
        public static URVector Subtract(URVector vector1, URVector vector2)
        {
            var newPoseVector     = Vector3D.Subtract(vector1.PoseVector, vector2.PoseVector);
            var newRotationVector = Vector3D.Subtract(vector1.RotationVector, vector2.RotationVector);

            return(new URVector(newPoseVector, newRotationVector));
        }
コード例 #2
0
ファイル: URPose.cs プロジェクト: ospqul/UR-Controller
        public static URPose Subtract(URPose pose, URVector vector)
        {
            var newPosition = Point3D.Subtract(pose.Position, vector.PoseVector);
            var newRotation = Point3D.Subtract(pose.Rotation, vector.RotationVector);

            return(new URPose(newPosition, newRotation));
        }
コード例 #3
0
ファイル: URVector.cs プロジェクト: ospqul/UR-Controller
        public static URPose Subtract(URVector vector, URPose pose)
        {
            var newPosition = Vector3D.Subtract(vector.PoseVector, pose.Position);
            var newRotation = Vector3D.Subtract(vector.RotationVector, pose.Rotation);

            return(new URPose(newPosition, newRotation));
        }
コード例 #4
0
        // O-->-->-->-->-->-->-->O
        //
        // O-->-->-->-->-->-->-->O
        //
        // O-->-->-->-->-->-->-->O
        public static List <IURMovement> ZStyle(IRectangularBoundary boundary, double brushThickness, double overlap)
        {
            List <IURMovement> movements = new List <IURMovement>();

            if ((overlap >= 1) || (overlap < 0))
            {
                return(movements);
            }

            var offset      = brushThickness * (1 - overlap);
            var indexVector = boundary.IndexMovement.PoseVector;
            int number      = (int)Math.Ceiling(indexVector.Length / offset);

            indexVector.Normalize();
            if (number > 1)
            {
                for (int i = 0; i < number; i++)
                {
                    var      deltaMove    = Vector3D.Multiply(indexVector, i * offset);
                    var      rotationMove = new Vector3D(0, 0, 0);
                    URVector delta        = new URVector(deltaMove, rotationMove);
                    movements.Add(new URMovement(boundary.LeftTop + delta, boundary.RightTop + delta));
                }
            }
            else if (number == 1)
            {
                movements.Add(new URMovement(boundary.LeftTop, boundary.RightTop));
            }

            return(movements);
        }
コード例 #5
0
        public RectangularBoundary(URPose lefttop, URPose righttop, URPose rightbottom, URPose leftbottom)
        {
            LeftTop     = lefttop;
            RightTop    = righttop;
            RightBottom = rightbottom;
            LeftBottom  = leftbottom;

            ScanMovement  = RightTop - LeftTop;
            IndexMovement = LeftBottom - LeftTop;
        }
コード例 #6
0
        public RectangularBoundary(IURMovement scanMove, URPose pose)
        {
            // define LeftTop corner and RightTop corner positions with URMove
            LeftTop      = scanMove.Start;
            RightTop     = scanMove.End;
            ScanMovement = scanMove.Movement;

            IndexMovement = GetIndexMoveVector(pose);

            LeftBottom  = LeftTop + IndexMovement;
            RightBottom = RightTop + IndexMovement;
        }
コード例 #7
0
ファイル: URScript.cs プロジェクト: ospqul/UR-Controller
        public static string Generate(string name, List <IURMovement> movements, URVector safeDistVector)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(FunctionHeader(name));

            // Start scan
            for (int i = 0; i < movements.Count; i++)
            {
                // movej to safe position above start point
                sb.Append(Indent(1) + MoveL(movements[i].Start + safeDistVector, 0.5, 0.3));
                sb.Append(Indent(1) + Sleep(0.5));
                // force mode
                sb.Append(ForceMode(1, movements[i]));
                sb.Append(Indent(1) + Sleep(0.5));
                // move to safe position after one line scan
                sb.Append(Indent(1) + MoveL(movements[i].End + safeDistVector, 0.1, 0.1));
            }

            sb.Append(FunctionEnd());
            return(sb.ToString());
        }