<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Çağrı Göktuğ Çelikdemir</title>
    <description>The latest articles on DEV Community by Çağrı Göktuğ Çelikdemir (@ca_go_celikdemir).</description>
    <link>https://dev.to/ca_go_celikdemir</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4124658%2F574e1156-159e-42d3-ac49-ea4d1b555079.png</url>
      <title>DEV Community: Çağrı Göktuğ Çelikdemir</title>
      <link>https://dev.to/ca_go_celikdemir</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ca_go_celikdemir"/>
    <language>en</language>
    <item>
      <title>Building an Interactive 3D Helical Spring Simulator with Three.js and Engineering Math</title>
      <dc:creator>Çağrı Göktuğ Çelikdemir</dc:creator>
      <pubDate>Mon, 14 Sep 2026 14:17:04 +0000</pubDate>
      <link>https://dev.to/ca_go_celikdemir/building-an-interactive-3d-helical-spring-simulator-with-threejs-and-engineering-math-1io5</link>
      <guid>https://dev.to/ca_go_celikdemir/building-an-interactive-3d-helical-spring-simulator-with-threejs-and-engineering-math-1io5</guid>
      <description>&lt;p&gt;I’m a mechanical engineer working mainly with machine design and manufacturing. Spring calculations are usually straightforward, but in practice they often end up in spreadsheets, PDF tables, or older engineering software.&lt;/p&gt;

&lt;p&gt;I wanted something more interactive, so I built a real-time 3D helical spring simulator for my free engineering platform, CelCalc.&lt;/p&gt;

&lt;p&gt;The idea is simple: change the spring dimensions or applied load and immediately see both the calculations and the 3D model update.&lt;/p&gt;

&lt;h2&gt;
  
  
  The engineering side
&lt;/h2&gt;

&lt;p&gt;The simulator calculates parameters such as spring index, Wahl factor, spring rate, deflection, solid length, and shear stress.&lt;/p&gt;

&lt;p&gt;For example, the spring index is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;C = (Dout - d) / d&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The Wahl factor is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;K = (4C - 1) / (4C - 4) + 0.615 / C&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The shear stress is calculated from the applied axial force:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;τ = K × (8FD) / (πd³)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;These calculations are connected directly to HTML sliders, so everything updates in real time.&lt;/p&gt;

&lt;p&gt;I also added a coil-bind check. If the calculated deflection would take the spring below its solid length, the simulator limits the movement and indicates the solid state.&lt;/p&gt;

&lt;h2&gt;
  
  
  Generating the 3D spring
&lt;/h2&gt;

&lt;p&gt;Since the dimensions are user-controlled, a fixed 3D model wouldn't work.&lt;/p&gt;

&lt;p&gt;I created a custom &lt;code&gt;THREE.Curve&lt;/code&gt; and generate the spring parametrically:&lt;/p&gt;

&lt;p&gt;class SpringCurve extends THREE.Curve {&lt;br&gt;
  constructor(meanRadius, length, totalCoils) {&lt;br&gt;
    super();&lt;br&gt;
    this.meanRadius = meanRadius;&lt;br&gt;
    this.length = length;&lt;br&gt;
    this.totalCoils = totalCoils;&lt;br&gt;
  }&lt;/p&gt;

&lt;p&gt;getPoint(t, optionalTarget = new THREE.Vector3()) {&lt;br&gt;
    const theta = t * this.totalCoils * Math.PI * 2;&lt;br&gt;
    const x = this.meanRadius * Math.cos(theta);&lt;br&gt;
    const z = this.meanRadius * Math.sin(theta);&lt;br&gt;
    const y = t * this.length;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return optionalTarget.set(x, y, z);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;I then use THREE.TubeGeometry to turn the curve into the actual spring.&lt;/p&gt;

&lt;p&gt;When a parameter changes, the old geometry is disposed and regenerated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj3wnchcsaipfs074ck2o.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj3wnchcsaipfs074ck2o.PNG" alt="Interactive 3D helical spring simulator showing real-time stress and deflection" width="800" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Making stress visible
&lt;/h2&gt;

&lt;p&gt;I also wanted the stress to be visible rather than just another number on the screen.&lt;/p&gt;

&lt;p&gt;For this simulation I use 850 MPa as the visualization limit. This is a simulation assumption, not a universal allowable stress for every spring material.&lt;/p&gt;

&lt;p&gt;As utilization increases, the spring changes from green to yellow to red.&lt;/p&gt;

&lt;p&gt;This makes it easier to see the effect of changing the geometry or applied load instead of only reading the calculated values.&lt;/p&gt;

&lt;p&gt;The model is intentionally simplified for interactive exploration. It is not intended to replace detailed spring design standards, material-specific allowable-stress checks, or FEA.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg38wf43hz9cu01e8gk03.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg38wf43hz9cu01e8gk03.PNG" alt="Helical spring simulation with adjustable dimensions and applied load" width="800" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;You can try the Helical Spring Simulator on CelCalc:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://celcalc.com/" rel="noopener noreferrer"&gt;https://celcalc.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’m curious: what engineering calculation would you like to see as an interactive web tool?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
