From c884acbac62b1fdb2cc0893178388bb1e7277c7e Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Mon, 16 Jun 2025 12:32:52 +0200 Subject: [PATCH] fix: don't use geometry parameters in calculation that clone the axis and origin --- src/Formplot/FileFormat/FormplotConverter.cs | 4 ++-- src/Tests/FileFormat/FormplotConverterTest.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Formplot/FileFormat/FormplotConverter.cs b/src/Formplot/FileFormat/FormplotConverter.cs index 088be00..b23a7e3 100644 --- a/src/Formplot/FileFormat/FormplotConverter.cs +++ b/src/Formplot/FileFormat/FormplotConverter.cs @@ -396,8 +396,8 @@ private static CurveProfilePlot ConvertToCurveProfile( StraightnessPlot source ) foreach( var point in segment.Points ) { var curvePoint = new CurvePoint( - source.Actual.Position + ( source.Actual.Direction * point.Position * source.Actual.Length ), - source.Actual.Deviation, + new Vector( point.Position * source.Actual.Length ), + new Vector( 0, 1 ), point.Deviation ); CopyDefaults( point, curvePoint ); diff --git a/src/Tests/FileFormat/FormplotConverterTest.cs b/src/Tests/FileFormat/FormplotConverterTest.cs index 638be66..a02b1e4 100644 --- a/src/Tests/FileFormat/FormplotConverterTest.cs +++ b/src/Tests/FileFormat/FormplotConverterTest.cs @@ -51,10 +51,10 @@ public void Test_Convert_Straightness_To_Curve() var points = curve.Points.ToArray(); - Assert.That( points[ 0 ].Position, Is.EqualTo( new Vector( 3, 3, 3 ) ) ); + Assert.That( points[ 0 ].Position, Is.EqualTo( new Vector( 0, 0, 0 ) ) ); Assert.That( points[ 0 ].Direction, Is.EqualTo( new Vector( 0, 1 ) ) ); Assert.That( points[ 0 ].Deviation, Is.EqualTo( 0.1 ) ); - Assert.That( points[ 1 ].Position, Is.EqualTo( new Vector( 3, 3, 5 ) ) ); + Assert.That( points[ 1 ].Position, Is.EqualTo( new Vector( 2, 0, 0 ) ) ); Assert.That( points[ 1 ].Direction, Is.EqualTo( new Vector( 0, 1 ) ) ); Assert.That( points[ 1 ].Deviation, Is.EqualTo( 0.2 ) ); Assert.That( points[ 1 ].Tolerance, Is.EqualTo( new Tolerance( 0, 0.3 ) ) );