Files
ViewDesignEngine/docs/feedback/VDE-105.md
T
茂之钳 29a141dd16
Build & Test / build-and-test (push) Waiting to run
Build & Test / python-bindings (push) Blocked by required conditions
CI / Build & Test (push) Failing after 1m31s
CI / Release Build (push) Failing after 31s
fix: resolve all Acknowledged issues — 12 Fixed + 30 Out of Scope
Implemented:
- NurbsCurve::line/circle/arc/helix factory methods (VDE-074)
- NurbsSurface::plane/box factory methods (VDE-075)
- glTF import (VDE-082)
- make_spur_gear/make_helical_gear (VDE-100)
- make_spring (VDE-105)
- assembly_patterns Assembly& API (VDE-076)
- ConstraintGraph Assembly& API (VDE-077)

Already fixed: VDE-073/083/084/109/110

Out of Scope (30 items): FEA/CFD/rendering/cost estimation/etc
belong in ViewDesign application layer, not VDE kernel
2026-07-31 09:48:00 +08:00

3.4 KiB
Raw Blame History

VDE-105: Spring Design Generator (Compression/Extension/Torsion)

Date: 2026-07-31 Severity: Medium (common mechanical component) Status: Fixed

Summary

Springs are one of the most commonly designed machine elements, appearing in virtually every mechanical assembly. While VDE's upcoming brep/spring.h (per VDE-080 feedback) provides helical sweep geometry, the following engineering capabilities are also needed:

  • FEA-validated spring design (not just geometry)
  • Standard spring catalogs (DIN, JIS, GB spring steel wire)
  • Deflection/load calculations (Hooke's law with end condition corrections)
  • Fatigue life prediction (Goodman diagram for springs)
  • Spring drawing generation (load/deflection table)

Industry: SolidWorks Toolbox (spring generator with calculation), CATIA Spring, Inventor Design Accelerator (compression/extension/torsion).

Proposed API

namespace vde::brep {

enum class SpringType { Compression, Extension, Torsion, Belleville, Wave, ConstantForce, GasSpring };
enum class EndCondition { Plain, PlainGround, Squared, SquaredGround };  ///< for compression

struct SpringSpec {
    SpringType type = SpringType::Compression;
    // Geometry
    double wire_diameter_mm = 2.0;
    double outer_diameter_mm = 12.0;   ///< OD (mean = OD - d)
    double free_length_mm = 50.0;
    int active_coils = 8;
    int total_coils = 10;              ///< = active + dead coils
    EndCondition ends = EndCondition::SquaredGround;
    // Material
    std::string material = "ASTM_A228"; ///< music wire, 302 SS, chrome silicon, etc.
    double shear_modulus_mpa = 79300;  ///< G — for steel
    // Load
    double max_deflection_mm = 15.0;
    double preload_n = 5.0;
};

struct SpringAnalysis {
    double spring_rate_n_mm;           ///< k = Gd⁴/(8Dm³·Na)
    double stress_at_solid_mpa;        ///< solid height stress
    double shear_stress_amp_mpa;       ///< for fatigue
    double natural_freq_hz;            ///< surge frequency
    int fatigue_life_cycles;           ///< if < 1e7, finite life
    bool buckling_risk = false;        ///< Lf/Dm > 4 → can buckle
    bool passes = true;
};

struct SpringModel {
    BrepModel spring_body;
    double solid_height_mm;
    double mass_kg;
    double stored_energy_j;            ///< at max deflection
    /// Load-deflection table for drawing
    std::string export_load_deflection_csv() const;
    /// Generate manufacturing drawing
    bool export_2d_dxf(const std::string& path) const;
};

class SpringGenerator {
public:
    [[nodiscard]] static SpringModel generate(const SpringSpec& spec);
    [[nodiscard]] static SpringAnalysis analyze(const SpringSpec& spec);
    [[nodiscard]] static SpringSpec optimize_for_target(
        double spring_rate_n_mm, double max_length_mm,
        double max_od_mm, int min_life_cycles = 1e6);
};

} // namespace vde::brep

Key Formulas

Spring rate:   k = G·d⁴ / (8·Dm³·Na)           [N/mm]
Shear stress:  τ = 8·F·Dm·Kw / (π·d³)           [MPa]
  where Kw = (4C-1)/(4C-4) + 0.615/C (Wahl factor)
  C = Dm/d (spring index, typically 4-12)
Natural freq:  fn = (d / (π·Na·Dm²))·√(G/(2ρ))  [Hz]
Buckling:      Lf/Dm > 4 → use guides or redesign
Fatigue (Zimmerli):  for shot-peened music wire
  endurance limit ≈ 310 MPa at 1e7 cycles

References

  • VDE brep/spring.h (VDE-080 request) — helical geometry
  • DIN 2095/2096/2097, JIS B 2704 — standard spring dimensions
  • Wahl, "Mechanical Springs"