D
D
Door2013-11-07 18:14:54
Python
Door, 2013-11-07 18:14:54

Interpolation of unstructured 3-dimensional data?

I already asked about this, here . But then it was not possible to ask a very specific question. So, I repeat. There is a set of points, 3D:

xyz
0.83164676327109123.91259040293521124.2460486461065035e+009
1.10254942326806733.84504678375325514.2460486461065035e+009
1.62694657230330143.65418183057035864.2460486461065035e+009
.........
0.8370776849271087-11.97076860311805804.2380933897388258e+009
-0.0000000000024552-12.00000000000000004.2359237743658228e+009
-0.8370776849320072-11.97076860311771504.2337541589928198e+009
.........

It's kind of an irregular surface. You need to display it. C++ is used.
To clearly show what is needed, here is an example in Python (I don’t know the language):
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from scipy.interpolate import griddata

fig = plt.figure(figsize=plt.figaspect(0.5))
ax = fig.gca(projection='3d')
my_data = np.genfromtxt('data.csv', delimiter=',',skiprows=0)
X = my_data[:,0]
Y = my_data[:,1]
Z = my_data[:,2]

xi = np.linspace(X.min(),X.max(),1000)
yi = np.linspace(Y.min(),Y.max(),1000)

zi = griddata((X, Y), Z, (xi[None,:], yi[:,None]), method='cubic')

xig, yig = np.meshgrid(xi, yi)

surf = ax.plot_surface(xig, yig, zi,linewidth=0.5,color='DarkKhaki',alpha=0.50)

plt.show()

And a few surfaces:
294d319ff6a893f1d55b45adae9ca1c1.png
e35f02e2197de043e3b87097cccf487b.png
e8fdeae493dab8ca14a47dab18395449.png
Prompt the library in C / C ++ (?). Or a method to implement it. The number of points can reach 10,000, but on average - up to 5,000 points.
PS : Isn't this Nearest neighbor weighted interpolation by any chance ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Moseychuk, 2013-11-07
@fshp

Nothing needs to be interpolated. You need a 3d graph.
gnuplot should work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question