4a83780e62
VDE-018: Verified — extra braces and invalid using declarations already removed in prior VDE-016 fix iterations. File compiles clean. VDE-022: Added brep_position.h/.cpp with position-based lookup: - get_edge_by_position(body, nearPoint) → edge_id - get_face_by_position(body, nearPoint) → face_id - fillet_by_position / chamfer_by_position / shell_by_position Fixes mesh→BrepModel round-trip ID mismatch for ViewDesign.
39 lines
1.3 KiB
C++
39 lines
1.3 KiB
C++
#pragma once
|
||
#include "vde/brep/brep.h"
|
||
|
||
namespace vde::brep {
|
||
|
||
/** @brief 根据几何位置查找最近的边ID
|
||
* @param body B-Rep模型
|
||
* @param nearPoint 参考点
|
||
* @param tolerance 搜索容差(默认1e-6)
|
||
* @return 最近边的ID,未找到返回-1
|
||
*/
|
||
int get_edge_by_position(const BrepModel& body, const Point3D& nearPoint, double tolerance = 1e-6);
|
||
|
||
/** @brief 根据几何位置查找最近的面ID
|
||
* @param body B-Rep模型
|
||
* @param nearPoint 参考点
|
||
* @param tolerance 搜索容差
|
||
* @return 最近面的ID,未找到返回-1
|
||
*/
|
||
int get_face_by_position(const BrepModel& body, const Point3D& nearPoint, double tolerance = 1e-6);
|
||
|
||
/** @brief 基于几何位置的倒圆角
|
||
* @param body B-Rep模型
|
||
* @param nearPoint 靠近目标边的参考点
|
||
* @param radius 圆角半径
|
||
* @param tolerance 边搜索容差
|
||
*/
|
||
BrepModel fillet_by_position(const BrepModel& body, const Point3D& nearPoint, double radius, double tolerance = 1e-6);
|
||
|
||
/** @brief 基于几何位置的倒角
|
||
*/
|
||
BrepModel chamfer_by_position(const BrepModel& body, const Point3D& nearPoint, double distance, double tolerance = 1e-6);
|
||
|
||
/** @brief 基于几何位置的抽壳
|
||
*/
|
||
BrepModel shell_by_position(const BrepModel& body, const Point3D& nearPoint, double thickness, double tolerance = 1e-6);
|
||
|
||
} // namespace vde::brep
|