From 70d1c5a49f7ae441a39ccdbc40c47e63c3ba9843 Mon Sep 17 00:00:00 2001 From: "Onur R. Bingol" Date: Fri, 19 Jan 2018 19:07:28 -0600 Subject: [PATCH] Visualization scripts input files path update --- visualization/mpl_scatter_wframe.py | 4 ++-- visualization/mpl_wframe_trisurf.py | 4 ++-- visualization/mpl_wframe_wframe.py | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/visualization/mpl_scatter_wframe.py b/visualization/mpl_scatter_wframe.py index 06148f4..6331b06 100644 --- a/visualization/mpl_scatter_wframe.py +++ b/visualization/mpl_scatter_wframe.py @@ -20,8 +20,8 @@ os.chdir(os.path.dirname(os.path.realpath(__file__))) # Read surface and control points, @ref: https://stackoverflow.com/a/13550615 -cpgrid = np.genfromtxt('ctrlpts03_orig.csv', delimiter=',', skip_header=1, names=['x', 'y', 'z']) -surf = np.genfromtxt('surfpts03_orig.csv', delimiter=',', skip_header=1, names=['x', 'y', 'z']) +cpgrid = np.genfromtxt('../surface/ctrlpts03_orig.csv', delimiter=',', skip_header=1, names=['x', 'y', 'z']) +surf = np.genfromtxt('../surface/surfpts03_orig.csv', delimiter=',', skip_header=1, names=['x', 'y', 'z']) # Reshape surface points array for plotting, @ref: https://stackoverflow.com/a/21352257 cols = surf['x'].shape[0] diff --git a/visualization/mpl_wframe_trisurf.py b/visualization/mpl_wframe_trisurf.py index 4c24dec..bc12fff 100644 --- a/visualization/mpl_wframe_trisurf.py +++ b/visualization/mpl_wframe_trisurf.py @@ -22,8 +22,8 @@ os.chdir(os.path.dirname(os.path.realpath(__file__))) # Read surface and control points, @ref: https://stackoverflow.com/a/13550615 -cpgrid = np.genfromtxt('ctrlpts02_orig.csv', delimiter=',', skip_header=1, names=['x', 'y', 'z']) -surf = np.genfromtxt('surfpts02_orig.csv', delimiter=',', skip_header=1, names=['x', 'y', 'z']) +cpgrid = np.genfromtxt('../surface/ctrlpts02_orig.csv', delimiter=',', skip_header=1, names=['x', 'y', 'z']) +surf = np.genfromtxt('../surface/surfpts02_orig.csv', delimiter=',', skip_header=1, names=['x', 'y', 'z']) # Arrange control points grid for plotting, @ref: https://stackoverflow.com/a/21352257 cols = cpgrid['x'].shape[0] diff --git a/visualization/mpl_wframe_wframe.py b/visualization/mpl_wframe_wframe.py index 355ecb5..2c4a34e 100644 --- a/visualization/mpl_wframe_wframe.py +++ b/visualization/mpl_wframe_wframe.py @@ -10,14 +10,18 @@ * NumPy v1.13.3 * Matplotlib v2.1.0 """ +import os import numpy as np import matplotlib from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt +# Fix file path +os.chdir(os.path.dirname(os.path.realpath(__file__))) + # Read surface and control points, @ref: https://stackoverflow.com/a/13550615 -cpgrid = np.genfromtxt('ctrlpts01_orig.csv', delimiter=',', skip_header=1, names=['x', 'y', 'z']) -surf = np.genfromtxt('surfpts01_orig.csv', delimiter=',', skip_header=1, names=['x', 'y', 'z']) +cpgrid = np.genfromtxt('../surface/ctrlpts01_orig.csv', delimiter=',', skip_header=1, names=['x', 'y', 'z']) +surf = np.genfromtxt('../surface/surfpts01_orig.csv', delimiter=',', skip_header=1, names=['x', 'y', 'z']) # Arrange control points grid for plotting, @ref: https://stackoverflow.com/a/21352257 Xc = cpgrid['x'].reshape(-1, cpgrid['x'].shape[0])