Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/Formplot/FileFormat/FormplotConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,11 @@ private static CurveProfilePlot ConvertToCurveProfile( CylindricityPlot source )
var resultSegment = new Segment<CurvePoint, CurveGeometry>( segment.Name, segment.SegmentType );
foreach( var point in segment.Points )
{
var x = Math.Cos( point.Angle ) * source.Nominal.Radius;
var y = Math.Sin( point.Angle ) * source.Nominal.Radius;
var x = Math.Cos( point.Angle ) * source.Actual.Radius;
var y = Math.Sin( point.Angle ) * source.Actual.Radius;

var curvePoint = new CurvePoint(
new Vector( x, y, point.Height * source.Nominal.Height ),
new Vector( x, y, point.Height * source.Actual.Height ),
new Vector( x, y ).Normalized(),
point.Deviation );

Expand Down Expand Up @@ -396,8 +396,8 @@ private static CurveProfilePlot ConvertToCurveProfile( StraightnessPlot source )
foreach( var point in segment.Points )
{
var curvePoint = new CurvePoint(
source.Nominal.Position + ( source.Nominal.Direction * point.Position * source.Nominal.Length ),
source.Nominal.Deviation,
source.Actual.Position + ( source.Actual.Direction * point.Position * source.Actual.Length ),
source.Actual.Deviation,
point.Deviation );

CopyDefaults( point, curvePoint );
Expand Down Expand Up @@ -425,8 +425,8 @@ private static CurveProfilePlot ConvertToCurveProfile( RoundnessPlot source )
var resultSegment = new Segment<CurvePoint, CurveGeometry>( segment.Name, segment.SegmentType );
foreach( var point in segment.Points )
{
var x = Math.Cos( point.Angle ) * source.Nominal.Radius;
var y = Math.Sin( point.Angle ) * source.Nominal.Radius;
var x = Math.Cos( point.Angle ) * source.Actual.Radius;
var y = Math.Sin( point.Angle ) * source.Actual.Radius;

var curvePoint = new CurvePoint(
new Vector( x, y ),
Expand Down Expand Up @@ -460,7 +460,7 @@ private static CurveProfilePlot ConvertToCurveProfile( FlatnessPlot source )
foreach( var point in segment.Points )
{
var curvePoint = new CurvePoint(
new Vector( point.Coordinate1 * source.Nominal.Length1, point.Coordinate2 * source.Nominal.Length2 ),
new Vector( point.Coordinate1 * source.Actual.Length1, point.Coordinate2 * source.Actual.Length2 ),
new Vector( 0, 0, 1 ),
point.Deviation );

Expand Down
8 changes: 4 additions & 4 deletions src/Tests/FileFormat/FormplotConverterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void Test_Convert_Straightness_To_Curve()
{
var straightness = new StraightnessPlot
{
Nominal =
Actual =
{
Position = new Vector( 3, 3, 3 ),
Direction = new Vector( 0, 0, 1 ),
Expand Down Expand Up @@ -65,7 +65,7 @@ public void Test_Convert_Roundness_To_Curve()
{
var roundness = new RoundnessPlot
{
Nominal =
Actual =
{
Radius = 2
}
Expand Down Expand Up @@ -101,7 +101,7 @@ public void Test_Convert_Cylindricity_To_Curve()
{
var cylindricity = new CylindricityPlot
{
Nominal =
Actual =
{
Height = 3,
Radius = 2
Expand Down Expand Up @@ -137,7 +137,7 @@ public void Test_Convert_Flatness_To_Curve()
{
var flatness = new FlatnessPlot
{
Nominal =
Actual =
{
Length1 = 4,
Length2 = 3
Expand Down
Loading