统一代3D的分气缸/锥 [英] uniform generation of 3D points on cylinder/cone

查看:85
本文介绍了统一代3D的分气缸/锥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想随机均匀产生一个圆柱体和圆锥体(单独)点。汽缸是由它的中心,它的半径和高度限定。相同规格为锥形。我能够得到边框为每个形状,所以我想在边框内产生的点。不过,我不知道如何投影到圆柱体/圆锥或者如果这是个好主意。

I wish to randomly and uniformly generate points on a cylinder and a cone (separately). The cylinder is defined by its center, its radius and height. Same specifications for the cone. I am able to get the bounding box for each shape so I was thinking of generating points within the bounding box. However, I'm not sure how to project them onto the cylinder/cone or if this is the best idea.

有什么建议?

感谢。

推荐答案

圆柱壳实在是微不足道。如果半径r的气缸> 0和高度h> 0是对φ∈[0,2π[和z∈(X,Y,Z)=(R cosφ值河罪φ,z)上的图像[-h / 2,H / 2],那么只需选择φ和z随机对这些区间。当然,人们可以简单地parametrise锥体以及使用标准参数化,但随后的元件区域将不会对参数平面恒定,所以点的分布将不会是随机的。因此,你需要找到一个不同的参数化。我已经讨论了球体我AlgoSim网站本主题中的细节。

The cylinder case is trivial. If the cylinder of radius r > 0 and height h > 0 is the image of (x, y, z) = (r cos φ, r sin φ, z) on φ ∈ [0, 2π[ and z ∈ [-h/2, h/2], then simply choose φ and z randomly on these intervals. Of course one can simply parametrise the cone as well using the standard parametrisation, but then the area element will not be constant on the parameter plane, and so the distribution of points will not be random. Thus you need to find a different parametrisation. I have discussed this topic in detail for a sphere at my AlgoSim site.

这篇关于统一代3D的分气缸/锥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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