private static void SetCartesianPoint(double x, double y, double z, StepCartesianPoint point) { point.X = x; point.Y = y; point.Z = z; }
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 { } }
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; }
private static Point ToPoint(StepCartesianPoint point) { return(new Point(point.X, point.Y, point.Z)); }