Files
ViewDesignEngine/docs/feedback/VDE-012.md
T
茂之钳 5de74b543a docs: mark all 13 VDE issues as fixed
VDE-001 through VDE-013 all resolved in v1.0.1
ViewDesign workarounds can now be removed
2026-07-27 22:56:29 +08:00

1007 B
Raw Blame History

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 和 Point3DEigen::Vector3ddouble 精度)存储法向量和顶点。但实际使用中,网格数据通常为 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。

建议修复方向

  1. 考虑提供 StlTriangleffloat 精度)和 StlTriangleddouble 精度)两种类型
  2. 使用模板 StlTriangle 支持两种精度

此文件由 ViewDesign 工程自动生成。处理完成后请更新 status 字段。