5#include "point_cloud/random_points.h"
10#include "common/eigen_utility.h"
13 namespace point_cloud {
17 auto size = cuboid.max() - cuboid.min();
18 if (size.minCoeff() <= 0.0)
19 throw std::invalid_argument(
"cuboid must have a positive volume.");
21 std::mt19937 gen(seed);
22 std::uniform_real_distribution<> dist(0.0, 1.0);
26 for (
auto p : common::row_range(points)) {
27 auto x = dist(gen) * size(0);
28 auto y = dist(gen) * size(1);
29 auto z = dist(gen) * size(2);
42 if (sphere.radius() <= 0.0)
43 throw std::invalid_argument(
"sphere must have a positive volume.");
45 std::mt19937 gen(seed);
46 std::uniform_real_distribution<> dist(-1.0, 1.0);
50 for (
auto p : common::row_range(points)) {
57 rsq = x1 * x1 + x2 * x2;
60 auto x = 2.0 * x1 * std::sqrt(1.0 - rsq);
61 auto y = 2.0 * x2 * std::sqrt(1.0 - rsq);
62 auto z = 1.0 - 2.0 * rsq;
Eigen::RowVector3d vector3d
3维向量
本系统的主命名空间,包含了common, examples, fmm, geometry, numeric, point_cloud等子命名空间