将多维数据集曲面转换为球形多维数据集曲面(生成球形多维数据集)

编程入门 行业动态 更新时间:2024-10-11 03:23:16
本文介绍了将多维数据集曲面转换为球形多维数据集曲面(生成球形多维数据集)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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²)

更多推荐

将多维数据集曲面转换为球形多维数据集曲面(生成球形多维数据集)

本文发布于:2023-10-31 09:10:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1545685.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多维   曲面   球形   数据   转换为

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!