Files
ViewDesignEngine/include/vde/brep/brep_position.h
T
茂之钳 4a83780e62
Build & Test / build-and-test (push) Waiting to run
Build & Test / python-bindings (push) Blocked by required conditions
CI / Build & Test (push) Failing after 34s
CI / Release Build (push) Failing after 32s
fix(v1.0.1): VDE-018 resolved (file clean) + VDE-022 position-based API
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.
2026-07-28 17:27:18 +08:00

39 lines
1.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#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