ViewDesignEngine  3.1.0
高性能 CAD 计算几何引擎
bezier_surface.h
浏览该文件的文档.
1 #pragma once
2 #include "vde/core/point.h"
3 #include <vector>
4 
5 namespace vde::curves {
6 using core::Point3D;
7 using core::Vector3D;
8 
20 public:
30  BezierSurface(std::vector<std::vector<Point3D>> control_grid);
31 
39  [[nodiscard]] Point3D evaluate(double u, double v) const;
40 
48  [[nodiscard]] Vector3D derivative_u(double u, double v) const;
49 
56  [[nodiscard]] Vector3D derivative_v(double u, double v) const;
57 
65  [[nodiscard]] Vector3D normal(double u, double v) const;
66 
71  [[nodiscard]] int degree_u() const { return static_cast<int>(cp_.size()) - 1; }
72 
77  [[nodiscard]] int degree_v() const { return static_cast<int>(cp_[0].size()) - 1; }
78 
79 private:
80  std::vector<std::vector<Point3D>> cp_;
81 
88  [[nodiscard]] Point3D de_casteljau(double t, const std::vector<Point3D>& pts) const;
89 };
90 
91 } // namespace vde::curves
Bézier 张量积曲面
int degree_u() const
u 向阶次
int degree_v() const
v 向阶次
Vector3D derivative_v(double u, double v) const
v 方向偏导数 ∂S/∂v
BezierSurface(std::vector< std::vector< Point3D >> control_grid)
构造 Bézier 曲面
Point3D evaluate(double u, double v) const
求曲面点 S(u,v)
Vector3D normal(double u, double v) const
单位法向量 N(u,v) = (∂S/∂u × ∂S/∂v) / |…|
Vector3D derivative_u(double u, double v) const
u 方向偏导数 ∂S/∂u
foundation::Vector3D Vector3D
双精度三维向量(重新导出)
Definition: point.h:49
foundation::Point3D Point3D
双精度三维点(重新导出)
Definition: point.h:31