Files
ViewDesignEngine/include/vde/brep/modeling.h
T

53 lines
1.9 KiB
C++
Raw Normal View History

2026-07-23 07:19:13 +00:00
#pragma once
#include "vde/core/point.h"
2026-07-23 07:19:13 +00:00
#include "vde/brep/brep.h"
namespace vde::brep {
using core::Point3D;
using core::Vector3D;
using core::AABB3D;
2026-07-23 07:19:13 +00:00
/// 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