23 static const int n_heights =
24 std::max(2,
static_cast<int>(std::round(
26 double h_step = (height - dh) / (n_heights - 1);
29 for (
int i = 0; i < n_heights; ++i) {
30 double z = i * h_step;
31 double radius_factor = std::sqrt(1.0 - std::pow((z + r_z - height) / r_z, 2));
32 auto ellipse =
EllipseVerticesZ(radius_factor * r_x, radius_factor * r_y, i * h_step);
33 std::move(ellipse.begin(), ellipse.end(), it);
34 it = it + ellipse.size();
std::vector< R3 > EllipseVerticesZ(double r_x, double r_y, double z)
Generate vertices of centered horizontal ellipse with given semi-axes at height z.
Defines class TruncatedEllipsoidNet.
std::vector< R3 > m_vertices
List of vertices initialized during construction.
static const size_t N_Circle
TruncatedEllipsoidNet(double r_x, double r_y, double r_z, double height, double dh)
~TruncatedEllipsoidNet() override