fix: format_utils normalize function sigs, iges_import class closing brace
This commit is contained in:
@@ -26,7 +26,7 @@ inline std::string fmt_double(double v, int precision = 12) {
|
||||
}
|
||||
|
||||
/// Format for IGES: uses D exponent
|
||||
inline std::string fmt_iges_real(double v) {
|
||||
inline std::string fmt_iges_real(double v, int /*precision*/ = 12) {
|
||||
auto s = fmt_double(v, 12);
|
||||
auto pos = s.find('e');
|
||||
if (pos != std::string::npos) s[pos] = 'D';
|
||||
@@ -35,8 +35,9 @@ inline std::string fmt_iges_real(double v) {
|
||||
|
||||
/// Format a Point3D as comma-separated reals
|
||||
inline std::string fmt_point(const core::Point3D& p, bool use_d = false) {
|
||||
auto format_fn = use_d ? fmt_iges_real : fmt_double;
|
||||
return format_fn(p.x()) + "," + fmt(p.y()) + "," + fmt(p.z());
|
||||
using FmtFn = std::string (*)(double, int);
|
||||
FmtFn fn = use_d ? static_cast<FmtFn>(fmt_iges_real) : fmt_double;
|
||||
return fn(p.x(), 12) + "," + fn(p.y(), 12) + "," + fn(p.z(), 12);
|
||||
}
|
||||
|
||||
/// Pad a string to exactly 72 characters with spaces
|
||||
|
||||
Reference in New Issue
Block a user