Skip to content

Commit

Permalink
Fix LogViewer for other cultures.
Browse files Browse the repository at this point in the history
  • Loading branch information
lovettchris committed Jun 5, 2017
1 parent 6458eaf commit 2caf271
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions LogViewer/LogViewer/Controls/MeshViewer.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using LogViewer.Gestures;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
Expand Down Expand Up @@ -137,7 +139,10 @@ private void OnGestureChanged(object sender, EventArgs e)

private void LoadModel()
{
MeshGeometry3D mymesh = new MeshGeometry3D();
MeshGeometry3D mymesh = new MeshGeometry3D();

// this resolves problems with handling of '.' versus ',' as decimal separator in the the loaded mesh.
CultureInfo usCulture = new CultureInfo("en-US");

using (var stream = this.GetType().Assembly.GetManifestResourceStream("LogViewer.Assets.Mesh.txt"))
{
Expand All @@ -155,9 +160,9 @@ private void LoadModel()
string b = line.Substring(i + 1, j - i - 1);
string c = line.Substring(j + 1);

double x = double.Parse(a);
double y = double.Parse(b);
double z = double.Parse(c);
double x = double.Parse(a, usCulture);
double y = double.Parse(b, usCulture);
double z = double.Parse(c, usCulture);

mymesh.Positions.Add(new Point3D(x, y, z));
}
Expand Down

0 comments on commit 2caf271

Please sign in to comment.