在 3D 框上均匀生成点 [英] uniform generation of points on 3D box

查看:26
本文介绍了在 3D 框上均匀生成点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在由 (minx, miny, minz) 和 (maxx, maxy, maxz) 角定义的 3D 框上生成随机点.我正在考虑在盒子内部生成一个随机点,然后以某种方式将其投影到盒子的一侧.但是,我没有盒子侧面的明确平面信息,这似乎不会产生均匀分布的点,因为如果盒子的某些侧面比其他侧面大,则这些侧面应该生成更多点.

I would like to generate random points on a 3D box defined by its (minx, miny, minz) and (maxx, maxy, maxz) corners. I was thinking of generating a random point inside of the box and then somehow projecting it onto one of the box sides. However, I don't have explicit plane information for the box sides and this seems like it will not produce a uniform distribution of points since if some sides of the box are bigger than others, those sides should have more points generated on them.

感谢任何建议.

谢谢.

推荐答案

  1. 随机选择一方加权它的区域(备用链接这个 ...)
  2. 从均匀分布中随机选择一个点放在那一边
  3. 起泡、冲洗、重复.

或者交替

  1. 决定点的密度
  2. 用一组具有该密度的随机点依次填充每一侧

它更均匀(即随机性更小)但看起来不错,只要密度足够高,每边都有多个点

which is more uniform (i.e. less random) but will look fine as long as the density is high enough for each side to have more than a handful of points

这篇关于在 3D 框上均匀生成点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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