将多维数据集曲面转换为球形多维数据集曲面(生成球形多维数据集) [英] Transforming Cube Surface to Spherical Cube Surface (Generating Spherical Cube)

查看:65
本文介绍了将多维数据集曲面转换为球形多维数据集曲面(生成球形多维数据集)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个空立方体的点的坐标,就像下面一样:

I have the coordinates of points of an empty cube just like down below:

我想做的就是将那个立方体转换成这样的东西:

What I would like to do is transform that cube to something like this:

有两种选择:

1-编辑初始立方体的坐标以使其为球形

1- Edit the initial cube's coordinates to make it spherical

2-从头开始生成球形立方体

2- Generate spherical cube from scratch

到目前为止,我还没有想到一个解决方案.如何生成球形立方体?

I couldn't think of a solution so far. How can I generate a spherical cube?

编辑-我的生成多维数据集的代码如下.它基本上会创建一个填充的多维数据集,然后减去内部的节点.NL_sph是立方体表面坐标的最终数组.

Edit - My code that generates the cube is below. It basically creates a filled cube and then subtracts the nodes on the inside. NL_sph is the final array of the coordinates of the cube surface.


s = 0.1
m = 4
v = 3

b = np.linspace(s*(m+1),s*(m+v-1),v-1)
    
xi, yi, zi = np.meshgrid(b, b, b)
    
xi = np.array([xi.flatten('F')]).T
yi = np.array([yi.flatten('F')]).T
zi = np.array([zi.flatten('F')]).T
    
NL_inc = np.around(np.hstack([xi,yi,zi]), decimals = 5)


c = np.linspace(s*(m),s*(m+v),v+1)
    
xc, yc, zc = np.meshgrid(c, c, c)
    
xc = np.array([xc.flatten('F')]).T
yc = np.array([yc.flatten('F')]).T
zc = np.array([zc.flatten('F')]).T
    
NL_sph = np.around(np.hstack([xc,yc,zc]), decimals = 5)

for i in range(np.size(NL_inc,0)):
    
    idx = np.where((NL_sph == NL_inc[i,:]).all(axis=1))[0]
    
    if len(idx) != 0:
            
        NL_sph = np.delete(NL_sph, idx, axis = 0)

推荐答案

在Faces多维数据集上绘制网格并将所需的每个点径向投影到球体上.假设立方体的中心在原点,变换

Draw grids on the faces cube and project every point that you need radially onto the sphere. Assuming the center of the cube at the origin, transform

(x, y, z) -> (x, y, z) / √(x² + y² + z²)

这篇关于将多维数据集曲面转换为球形多维数据集曲面(生成球形多维数据集)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆