示例#1
0
 private static void SetCartesianPoint(double x, double y, double z,
                                       StepCartesianPoint point)
 {
     point.X = x;
     point.Y = y;
     point.Z = z;
 }
示例#2
0
        public void FileSystemAPITest()
        {
            var filePath = Path.GetTempFileName();
            var stepFile = new StepFile();
            var point    = new StepCartesianPoint("some-label", 1.0, 2.0, 3.0);

            stepFile.Items.Add(point);

            // round trip
            stepFile.Save(filePath);
            var stepFile2 = StepFile.Load(filePath);

            var point2 = (StepCartesianPoint)stepFile2.Items.Single();

            Assert.Equal(point.Name, point2.Name);
            Assert.Equal(point.X, point2.X);
            Assert.Equal(point.Y, point2.Y);
            Assert.Equal(point.Z, point2.Z);

            try
            {
                File.Delete(filePath);
            }
            catch
            {
            }
        }
示例#3
0
        private static void SetAxis(double axisX, double axisY, double axisZ, StepAxis2Placement axis, double aDirectionX,
                                    double aDirectionY, double aDirectionZ, double refDirectionX, double refDirectionY, double refDirectionZ)
        {
            StepCartesianPoint point = new StepCartesianPoint();

            SetCartesianPoint(axisX, axisY, axisZ, point);

            StepDirection axisDirection = new StepDirection();

            SetDirection(aDirectionX, aDirectionY, aDirectionZ, axisDirection);

            StepDirection refDirection = new StepDirection();

            SetDirection(refDirectionX, refDirectionY, refDirectionZ, refDirection);

            axis.Location     = point;
            axis.Axis         = axisDirection;
            axis.RefDirection = refDirection;
        }
示例#4
0
 private static Point ToPoint(StepCartesianPoint point)
 {
     return(new Point(point.X, point.Y, point.Z));
 }