Why The geometry exchange Y-axies and Z-axies when loaded a STL campare to OBJ or FBX?

I use STLLoader.load(url), and callback function is

const loadCallback = (geo: BufferGeometry<NormalBufferAttributes>) => {
      const blockMaterial = new MeshStandardMaterial();
      const obj = new Mesh(geo, blockMaterial);
      return obj
    };

meanwhile fbx just returned what I got in FBXLoader;
This cause Texture maps are not suitable so that I couldn’t solve the problem by setRotation the mesh
correct fbx file shows


error stl file shows

and the fuction that adding texture list here. hope it helpful

const pbr = new MeshStandardMaterial({});
  if (texture.pbr) {
    pbr.metalnessMap = texture.pbr;
    pbr.roughnessMap = texture.pbr;
  } else {
    pbr.metalness = 0;
    pbr.roughness = 0.5;
  }
  if (texture.normal) {
    pbr.normalMap = texture.normal;
  }
  pbr.map = texture.diffuse;

Threejs uses y as the up axis. Blender and many modellers use z as the up axis, so the exporters often have a checkbox to convert to Y up.

this code resolve the problem which you mentioned:

const positionAttribute = geometry.getAttribute("position");

      if (positionAttribute) {
        for (let i = 0, il = positionAttribute.count; i < il; i ++) {
          const orginalY = positionAttribute.getY(i);
          const orginalZ = positionAttribute.getZ(i)
          positionAttribute.setY(i, orginalZ);
          positionAttribute.setZ(i, -orginalY);
        }
      }

howerver, the texture still have only one color. Is STL file not record the uv info?

I don’t think stl format handles anything but points and maybe colors. Use gltf if possible. There are many good reasons to.

STL files describe only the surface geometry of a three-dimensional object without any representation of color, texture or other common CAD model attributes.