|
ViewDesignEngine
3.1.0
高性能 CAD 计算几何引擎
|
分层容差管理类 更多...
#include <tolerance.h>
Public 成员函数 | |
| Tolerance (double absolute=1e-6, double relative=1e-8, double angular=1e-8, double snapping=1e-4) | |
| 构造容差对象 更多... | |
| bool | points_equal (const Eigen::MatrixXd &a, const Eigen::MatrixXd &b) const |
| 判断两点是否相等(基于绝对容差) 更多... | |
| template<typename T > | |
| bool | is_zero (T value) const |
| 判断值是否接近零 更多... | |
| template<typename T > | |
| bool | equals (T a, T b) const |
| 混合容差相等判断 更多... | |
| double | absolute () const |
| 获取绝对容差 更多... | |
| double | relative () const |
| 获取相对容差 更多... | |
| double | angular () const |
| 获取角度容差 更多... | |
| double | snapping () const |
| 获取吸附容差 更多... | |
| Tolerance | tighten (double factor=0.1) const |
| 收紧容差 更多... | |
| Tolerance | relax (double factor=10.0) const |
| 放宽容差 更多... | |
静态 Public 成员函数 | |
| static Tolerance | min (const Tolerance &a, const Tolerance &b) |
| 合并两个容差,取更严格的(更小的) 更多... | |
| static Tolerance & | global () |
| 获取全局容差实例 更多... | |
| static void | set_global (const Tolerance &tol) |
| 设置全局容差 更多... | |
| static constexpr double | Modeling () |
| 建模级精度 (1e-6):通用几何建模 更多... | |
| static constexpr double | Fitting () |
| 拟合级精度 (1e-3):曲面拟合、近似计算 更多... | |
| static constexpr double | Intersection () |
| 求交级精度 (1e-8):精确求交、布尔运算 更多... | |
| static constexpr double | Snapping () |
| 吸附级精度 (1e-4):点合并、顶点焊接 更多... | |
分层容差管理类
提供四级容差(绝对、相对、角度、吸附),支持全局实例和局部作用域覆盖。 用于数值比较、几何判定和点合并时的精度控制。
四级容差含义:
预设精度等级:
在文件 tolerance.h 第 29 行定义.
|
inline |
构造容差对象
| absolute | 绝对容差,默认 1e-6 |
| relative | 相对容差,默认 1e-8 |
| angular | 角度容差(弧度),默认 1e-8 |
| snapping | 吸附容差,默认 1e-4 |
在文件 tolerance.h 第 39 行定义.
|
inline |
获取绝对容差
在文件 tolerance.h 第 93 行定义.
|
inline |
获取角度容差
在文件 tolerance.h 第 97 行定义.
|
inline |
混合容差相等判断
综合使用绝对和相对容差: |a - b| < absolute + relative * max(|a|, |b|)
| T | 数值类型 |
| a | 第一个值 |
| b | 第二个值 |
在文件 tolerance.h 第 88 行定义.
|
inlinestaticconstexpr |
拟合级精度 (1e-3):曲面拟合、近似计算
在文件 tolerance.h 第 171 行定义.
|
inlinestatic |
|
inlinestaticconstexpr |
求交级精度 (1e-8):精确求交、布尔运算
在文件 tolerance.h 第 173 行定义.
|
inline |
|
inlinestaticconstexpr |
建模级精度 (1e-6):通用几何建模
在文件 tolerance.h 第 169 行定义.
|
inline |
判断两点是否相等(基于绝对容差)
使用欧氏距离与绝对容差比较。
| a | 第一个点(Eigen 矩阵) |
| b | 第二个点(Eigen 矩阵) |
在文件 tolerance.h 第 55 行定义.
|
inline |
获取相对容差
在文件 tolerance.h 第 95 行定义.
|
inline |
放宽容差
所有容差乘以 factor(> 1),用于在上层操作中降低精度要求。
| factor | 放宽因子(默认 10.0) |
在文件 tolerance.h 第 128 行定义.
引用了 Tolerance().
|
inlinestatic |
设置全局容差
| tol | 新的全局容差 |
在文件 tolerance.h 第 164 行定义.
被这些函数引用 vde::foundation::ToleranceScope::ToleranceScope() , 以及 vde::foundation::ToleranceScope::~ToleranceScope().
|
inlinestaticconstexpr |
吸附级精度 (1e-4):点合并、顶点焊接
在文件 tolerance.h 第 175 行定义.
|
inline |
获取吸附容差
在文件 tolerance.h 第 99 行定义.
|
inline |
收紧容差
所有容差乘以 factor(< 1),用于在子操作中提高精度要求。
| factor | 收紧因子(默认 0.1) |
在文件 tolerance.h 第 116 行定义.
引用了 Tolerance().