Why does my extruded cube create triangles instead of clean square faces in Three.js or 3D modeling?

I’m trying to create an L-shaped 3D structure made by combining or extruding cube segments. In the first image, the geometry appears correct—each face is a clean square and there are no unnecessary diagonal edges:

:white_check_mark: Expected result (clean quad faces):

However, in the second image, which was created by manually using BoxGeometry or extruding incorrectly, I end up with triangulated faces instead of clean quads:

:cross_mark: Actual result (unwanted triangulation):

I’m looking for a way to generate geometry like the first image, with perfect square/quad faces, without any internal diagonals (triangles).

Questions:

  1. Why does this triangulation happen when I create a combined mesh?
  2. What is the proper approach to preserve square faces when extruding or combining cubes?
  3. Is there a modeling or geometry cleanup step that fixes this?

How did you create these images? The first one is hiding the truth from you: all geometry is always made of triangle meshes. A quad is made from two triangles, a cube is made from at least 12 triangles. Always. There is no way around it.

The first image is rendered in a way that only shows the cube’s outlines, the second shows the actual geometry as a wireframe overlay.

Maybe first image with THREE.edgeGeometry, LDraw.

Hi @harsh_98765
I do not know about extruding cube segments.
I would do like this:

1 Like

THREEJS internally has no awareness of anything but triangles. tools built on top of three are free to store information about ngons, but not many do.

Usually operations like this are better performed in 3d modellers like Blender.

If you can explain on a higher level what and why you are trying to achieve this, we may be able to help you better.

Are you making a minecraft thing? Some engineering tool?