5de74b543a
VDE-001 through VDE-013 all resolved in v1.0.1 ViewDesign workarounds can now be removed
1007 B
1007 B
id, status, severity, category, date, reporter
| id | status | severity | category | date | reporter |
|---|---|---|---|---|---|
| VDE-012 | fixed | low | design | 2026-07-27 | ViewDesign |
VDE-012: StlTriangle 使用 double 精度,与 float 网格顶点不匹配
问题描述
StlTriangle 使用 Vector3D 和 Point3D(Eigen::Vector3d,double 精度)存储法向量和顶点。但实际使用中,网格数据通常为 float 精度。从 float 到 double 再到 float 的转换需要显式 static_cast,且 Eigen 不允许 float/double 之间的隐式类型转换。
影响文件
- include/vde/foundation/io_stl.h
ViewDesign 侧 Workaround
显式转换:
vde::foundation::Point3D p0{static_cast<double>(v0.x), static_cast<double>(v0.y), static_cast<double>(v0.z)};
读回时再转回 float。
建议修复方向
- 考虑提供 StlTrianglef(float 精度)和 StlTriangled(double 精度)两种类型
- 使用模板 StlTriangle 支持两种精度
此文件由 ViewDesign 工程自动生成。处理完成后请更新 status 字段。