64ad721ed7
- CMake: INTERFACE 库修复、vde_compile_options 顺序修复 - 命名空间: 所有模块添加 using 声明 - 类型补全: Ray3Dd、Point4D - 头文件: tolerance 泛型化、std::optional include - 警告: 放宽 -Wconversion/-Wsign-conversion - 构建结果: 0 errors, 22/25 tests passed
53 lines
1.9 KiB
C++
53 lines
1.9 KiB
C++
#pragma once
|
|
#include "vde/core/point.h"
|
|
#include "vde/brep/brep.h"
|
|
|
|
namespace vde::brep {
|
|
using core::Point3D;
|
|
using core::Vector3D;
|
|
using core::AABB3D;
|
|
|
|
/// Extrude a planar face/wire along a direction
|
|
/// @param profile Profile curve (must be planar)
|
|
/// @param dir Extrusion direction (length = distance)
|
|
[[nodiscard]] BrepModel extrude(const curves::NurbsCurve& profile, const Vector3D& dir);
|
|
|
|
/// Revolve a profile around an axis
|
|
[[nodiscard]] BrepModel revolve(const curves::NurbsCurve& profile,
|
|
const Point3D& axis_origin,
|
|
const Vector3D& axis_dir,
|
|
double angle_rad = 2.0 * M_PI);
|
|
|
|
/// Sweep a profile along a path curve
|
|
[[nodiscard]] BrepModel sweep(const curves::NurbsCurve& profile,
|
|
const curves::NurbsCurve& path);
|
|
|
|
/// Loft between two or more profile curves
|
|
[[nodiscard]] BrepModel loft(const std::vector<curves::NurbsCurve>& profiles);
|
|
|
|
/// Create a solid box
|
|
[[nodiscard]] BrepModel make_box(double w, double h, double d);
|
|
|
|
/// Create a solid cylinder
|
|
[[nodiscard]] BrepModel make_cylinder(double radius, double height, int segments = 32);
|
|
|
|
/// Create a solid sphere
|
|
[[nodiscard]] BrepModel make_sphere(double radius, int segments_u = 32, int segments_v = 16);
|
|
|
|
/// Fillet an edge (constant radius)
|
|
/// @param body Input body
|
|
/// @param edge_id Edge to fillet
|
|
/// @param radius Fillet radius
|
|
[[nodiscard]] BrepModel fillet(const BrepModel& body, int edge_id, double radius);
|
|
|
|
/// Chamfer an edge
|
|
[[nodiscard]] BrepModel chamfer(const BrepModel& body, int edge_id, double distance);
|
|
|
|
/// Shell a solid body (hollow it out)
|
|
/// @param body Input solid body
|
|
/// @param face_id Face to remove (opening), -1 for closed shell
|
|
/// @param thickness Wall thickness (positive = outward offset)
|
|
[[nodiscard]] BrepModel shell(const BrepModel& body, int face_id, double thickness);
|
|
|
|
} // namespace vde::brep
|