ViewDesignEngine  3.1.0
高性能 CAD 计算几何引擎
modeling.h
浏览该文件的文档.
1 #pragma once
30 #include "vde/core/point.h"
31 #include "vde/brep/brep.h"
32 
33 namespace vde::brep {
34 using core::Point3D;
35 using core::Vector3D;
36 using core::AABB3D;
37 
38 // ═══════════════════════════════════════════════
39 // 扫掠特征
40 // ═══════════════════════════════════════════════
41 
64 [[nodiscard]] BrepModel extrude(const curves::NurbsCurve& profile, const Vector3D& dir);
65 
89 [[nodiscard]] BrepModel revolve(const curves::NurbsCurve& profile,
90  const Point3D& axis_origin,
91  const Vector3D& axis_dir,
92  double angle_rad = 2.0 * M_PI);
93 
114 [[nodiscard]] BrepModel sweep(const curves::NurbsCurve& profile,
115  const curves::NurbsCurve& path);
116 
137 [[nodiscard]] BrepModel loft(const std::vector<curves::NurbsCurve>& profiles);
138 
139 // ═══════════════════════════════════════════════
140 // 基本体
141 // ═══════════════════════════════════════════════
142 
160 [[nodiscard]] BrepModel make_box(double w, double h, double d);
161 
181 [[nodiscard]] BrepModel make_cylinder(double radius, double height, int segments = 32);
182 
199 [[nodiscard]] BrepModel make_sphere(double radius, int segments_u = 32, int segments_v = 16);
200 
201 // ═══════════════════════════════════════════════
202 // 编辑操作
203 // ═══════════════════════════════════════════════
204 
227 [[nodiscard]] BrepModel fillet(const BrepModel& body, int edge_id, double radius);
228 
243 [[nodiscard]] BrepModel chamfer(const BrepModel& body, int edge_id, double distance);
244 
265 [[nodiscard]] BrepModel shell(const BrepModel& body, int face_id, double thickness);
266 
267 } // namespace vde::brep
边界表示(B-Rep)核心数据结构
B-Rep 模型
Definition: brep.h:177
NURBS 曲线(Non-Uniform Rational B-Spline)
Definition: nurbs_curve.h:26
double distance(const Point3D &a, const Point3D &b)
两点之间的欧氏距离
Definition: brep.h:54
BrepModel fillet(const BrepModel &body, int edge_id, double radius)
对边做圆角处理
BrepModel extrude(const curves::NurbsCurve &profile, const Vector3D &dir)
沿方向挤出平面轮廓
BrepModel chamfer(const BrepModel &body, int edge_id, double distance)
对边做倒角
BrepModel make_sphere(double radius, int segments_u=32, int segments_v=16)
创建球体
BrepModel shell(const BrepModel &body, int face_id, double thickness)
抽壳(挖空实体)
BrepModel sweep(const curves::NurbsCurve &profile, const curves::NurbsCurve &path)
沿任意路径扫掠轮廓
BrepModel make_box(double w, double h, double d)
创建立方体
BrepModel make_cylinder(double radius, double height, int segments=32)
创建圆柱体
BrepModel loft(const std::vector< curves::NurbsCurve > &profiles)
在两个或多个轮廓曲线之间放样
BrepModel revolve(const curves::NurbsCurve &profile, const Point3D &axis_origin, const Vector3D &axis_dir, double angle_rad=2.0 *M_PI)
绕轴旋转平面轮廓
AABB< double > AABB3D
双精度三维包围盒
Definition: aabb.h:131
foundation::Vector3D Vector3D
双精度三维向量(重新导出)
Definition: point.h:49
foundation::Point3D Point3D
双精度三维点(重新导出)
Definition: point.h:31