Minecraft – How to create a doughnut shape in WorldEdit

minecraft-java-editionminecraft-worldedit

I'm attempting to recreate the Star Wars Trade Federation ships, and I would like to create a massive doughnut (shape) using WorldEdit. The shape should have a diameter of 147 blocks and thickness of 21 blocks.

How would I go around to doing this in WorldEdit?

Best Answer

From the worldedit wiki:

Example: Torus of major radius 0.75 and minor radius 0.25
//g stone (0.75-sqrt(x^2+y^2))^2+z^2 < 0.25^2

If you'd like to modify the size of the torus, substitute the minor and major radiuses for different values.

//g stone ([Major Radius]-sqrt(x^2+y^2))^2+z^2<[Minor Radius]^2
  • The minor radius is the radius of the inside of the torus.
  • The major radius is the total radius of the torus.

Please note that this equation only creates a regular torus, where the radius is consistent all around and sizes are in Minecraft blocks.


For your case, you'll want to substitute the major radius with 147 and your minor radius as 147-21, resulting in:

//g stone (147-sqrt(x^2+y^2))^2+z^2<(147-21)^2

or

//g stone (147-sqrt(x^2+y^2))^2+z^2<126^2