public void TestRotationAlongTheXAxis()
        {
            var inputPts      = new MdlFilePolygonDataReader(ExecutionDirInfoHelper.GetInputDirPath() + @"\1.mdl").Points;
            var outputDirPath = ExecutionDirInfoHelper.GetOutputDirPath() + @"\TestRotationAlongTheXAxis";

            if (!Directory.Exists(outputDirPath))
            {
                Directory.CreateDirectory(outputDirPath);
            }
            XamlWriter.WritePolygonsToXamlFile("", string.Format(@"{0}\Input.xaml", outputDirPath), inputPts, false);
            for (var angleInRadian = 0.0; angleInRadian <= Math.PI * 2; angleInRadian += Math.PI * 2.0 / 18.0)//every 20 degrees
            {
                var outputPts = RotateAlongXYOrZAxis.GetRotatedPtList(Axis.X, angleInRadian, inputPts.ToArray());
                XamlWriter.WritePolygonsToXamlFile("", string.Format(@"{0}\Output_X_{1}.xaml", outputDirPath, CommonFunctions.RadianToDegrees(angleInRadian, 0)), outputPts, false);
            }
        }
示例#2
0
        public void Create_Some_Rotated_Pts_Along_Z_Axis()
        {
            //translate to +y
            for (var ctr = 0; ctr < _ptsForACube.Count(); ctr++)
            {
                _ptsForACube[ctr].Y += 5.0;
            }
            var ptList = new List <Point3D>();

            for (var angle = 0.0; angle <= Math.PI; angle += Math.PI / 10)
            {
                Point3D[] rotatedPts = RotateAlongXYOrZAxis.GetRotatedPts(Axis.Z, angle, _ptsForACube);
                ptList.AddRange(rotatedPts);
            }
            XamlWriter.WritePolygonsToXamlFile(
                GetTemplatePath(),
                ExecutionDirInfoHelper.GetOutputDirPath() + @"\testRotationAlongZAxis.xaml",
                ptList,
                false);
        }