Exemplo n.º 1
0
        private void aSTLMeasuringTool_ZAngle_OnFinish(object sender, EventArgs e)
        {
            STLMeasuringTool_ZAngle STLMeasuringTool_ZAngle = sender as STLMeasuringTool_ZAngle;

            if (STLMeasuringTool_ZAngle.TouchPoints[0] != null && STLMeasuringTool_ZAngle.TouchPoints[1] != null)
            {
                PointD measurePoint, touchPoint;
                //讀取第一個PitchPoint的旋轉角
                measurePoint = this.PitchPoint1;
                touchPoint   = STLMeasuringTool_ZAngle.TouchPoints[0];
                touchPoint.OpenGLDisplaySize = 0.001;
                RotateAngles.Add(measurePoint, Atan2(touchPoint.Y, touchPoint.X) - Atan2(measurePoint.Y, measurePoint.X));
                RotateDistance.Add(measurePoint, Norm(measurePoint - new PointD(0, 0, measurePoint.Z)) * RotateAngles[measurePoint]);
                RotatedPitchPoint.Add(measurePoint, STLMeasuringTool_ZAngle.TouchPoints[0]);
                //讀取第二個PitchPoint的旋轉角
                measurePoint = this.PitchPoint2;
                touchPoint   = STLMeasuringTool_ZAngle.TouchPoints[1];
                touchPoint.OpenGLDisplaySize = 0.001;
                RotateAngles.Add(measurePoint, Atan2(touchPoint.Y, touchPoint.X) - Atan2(measurePoint.Y, measurePoint.X));
                RotateDistance.Add(measurePoint, Norm(measurePoint - new PointD(0, 0, measurePoint.Z)) * RotateAngles[measurePoint]);
                RotatedPitchPoint.Add(measurePoint, STLMeasuringTool_ZAngle.TouchPoints[1]);

                //根據旋轉兩個旋轉角旋轉拓樸面
                double rotateAngle;
                rotateAngle       = RotateAngles[this.PitchPoint1];
                TopoFace1.Points  = TransformPoints(RotateMatrix(Axis.Z, rotateAngle), TopoFace1.Points);
                TopoFace1.Normals = TransformPoints(RotateMatrix(Axis.Z, rotateAngle), TopoFace1.Normals);
                rotateAngle       = RotateAngles[this.PitchPoint2];
                TopoFace2.Points  = TransformPoints(RotateMatrix(Axis.Z, rotateAngle), TopoFace2.Points);
                TopoFace2.Normals = TransformPoints(RotateMatrix(Axis.Z, rotateAngle), TopoFace2.Normals);
                Solve();
            }
        }
Exemplo n.º 2
0
        public override void StartMeasure()
        {
            if (this.STLCubicClassifier == null)
            {
                this.STLCubicClassifier = new CubicClassifier();
                this.STLCubicClassifier.CubicClassify(this.STL2Measure);
            }

            this.FinishedThreadNumber = 0;
            this.RotateAngles         = new Dictionary <PointD, double>();
            this.RotateDistance       = new Dictionary <PointD, double>();
            this.RotatedPitchPoint    = new Dictionary <PointD, PointD>();
            this.STLMeasurent_Objects = new List <STLMeasuringTool>();
            STLMeasuringTool_ZAngle aSTLMeasuringTool_ZAngle;

            aSTLMeasuringTool_ZAngle = new STLMeasuringTool_ZAngle()
            {
                STL2Measure = this.STL2Measure, MeasurePoints = new List <PointD>()
                {
                    this.PitchPoint1, this.PitchPoint2
                }
            };
            aSTLMeasuringTool_ZAngle.OnFinish += aSTLMeasuringTool_ZAngle_OnFinish;
            aSTLMeasuringTool_ZAngle.StartMeasure();
        }
Exemplo n.º 3
0
        public override void StartMeasure()
        {
            if (this.STLCubicClassifier == null)
            {
                this.STLCubicClassifier = new CubicClassifier();
                this.STLCubicClassifier.CubicClassify(this.STL2Measure);
            }

            this.FinishedThreadNumber = 0;
            this.RotateAngles = new Dictionary<PointD, double>();
            this.RotateDistance = new Dictionary<PointD, double>();
            this.RotatedPitchPoint = new Dictionary<PointD, PointD>();
            this.STLMeasurent_Objects = new List<STLMeasuringTool>();
            STLMeasuringTool_ZAngle aSTLMeasuringTool_ZAngle;
            aSTLMeasuringTool_ZAngle = new STLMeasuringTool_ZAngle() { STL2Measure = this.STL2Measure, MeasurePoints = new List<PointD>() { this.PitchPoint1, this.PitchPoint2 } };
            aSTLMeasuringTool_ZAngle.OnFinish += aSTLMeasuringTool_ZAngle_OnFinish;
            aSTLMeasuringTool_ZAngle.StartMeasure();
        }