Extrude geometry bevel is sinusoidal not elliptical.

Description of the problem

I needed the bevel to be eliptical to look nice for my project. I looked through the source code for the extrude geometry and noticed that of the two parameters, bs and z, z steps linearly while bs is a sine function.

So I changed: z = bevelThickness * ( 1 - t );
to: z = bevelThickness * Math.cos( t * Math.PI / 2 );
And that made it work like I expected. (And looks way better)

Is there a reason that it’s sinusoidal? I think the default should be eliptical.

Three.js version
  • Dev
  • r78
  • r72
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • Linux
  • Android
  • IOS

Author: Fantashit

1 thought on “Extrude geometry bevel is sinusoidal not elliptical.

  1. @bhouston This is actually only my second time even interacting with github so I am in no way familiar with the process of making a pull request.

    @zz85 Here are some screen shots:
    sinusoidal
    sinusoidal box

    As you can see it makes a very noticeable square outline at the end where it doesn’t smoothly align.

    eliptical bevel
    beveled box

    Where as the new function makes it look nicely rounded.

Comments are closed.