title: Round Corners Box Geometry - threejs
body: <p>This question is more about Math, than about threejs but maybe there are usable Alternatives for my issue.</p>
  
  <p><img src="https://i.stack.imgur.com/cj1u1.png" alt="Example Image for issue"></p>
  
  <p>So what I want to do, is to go through every vertice in a Box Geometry and check weither it has to be moved down/up and move it then by a specific value. (it is only about the y-values of each vertice)</p>
  
  <pre><code>var width = 200,
      height = 100,
      depth = 50;
  var roundCornerWidth = var roundCornerHeight = 10;
  var helpWidth = width - 2*roundCornerWidth,
      helpHeight = height - 2*roundCornerHeight;
  
  var boxGeometry = new THREE.BoxGeometry(width, height, depth, 100, 50, 10);
  boxGeometry.vertices.forEach(v =&gt; {
    if(Math.abs(v.x)&gt;helpWidth/2){
      if(Math.abs(v.y)&gt;helpHeight/2){
        let helper = Math.abs(v.x)-helperWidth/2;
        v.y = Math.sign(v.y)*(helperHeight + Math.cos(helper/roundWidth * Math.PI/2)*roundHeight);
      }
    }
  });
  </code></pre>
  
  <p>The code above creates corners like you can see on the example image. Those aren't kind of beautiful! :( <br>Another "function" than <code>cos()</code> is needed.</p>