v0.1.0: 初始工程骨架 — 7模块 40头文件 32源文件 17文档 Apache-2.0
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
#include "vde/core/point.h"
|
||||
#include <vector>
|
||||
|
||||
namespace vde::curves {
|
||||
|
||||
class BezierSurface {
|
||||
public:
|
||||
BezierSurface(std::vector<std::vector<Point3D>> control_grid);
|
||||
|
||||
[[nodiscard]] Point3D evaluate(double u, double v) const;
|
||||
[[nodiscard]] Vector3D derivative_u(double u, double v) const;
|
||||
[[nodiscard]] Vector3D derivative_v(double u, double v) const;
|
||||
[[nodiscard]] Vector3D normal(double u, double v) const;
|
||||
|
||||
[[nodiscard]] int degree_u() const { return static_cast<int>(cp_.size()) - 1; }
|
||||
[[nodiscard]] int degree_v() const { return static_cast<int>(cp_[0].size()) - 1; }
|
||||
|
||||
private:
|
||||
std::vector<std::vector<Point3D>> cp_;
|
||||
[[nodiscard]] Point3D de_casteljau(double t, const std::vector<Point3D>& pts) const;
|
||||
};
|
||||
|
||||
} // namespace vde::curves
|
||||
Reference in New Issue
Block a user