Load an obj file, and draw it multipe times

Hi,

I’m very new to three js so maybe this question is too easy but I can’t figure it out.

I have found this code at github: GitHub - arekp09/Pallet-Configurator: This application was developed to visualise and calculate different options of stacking boxes on pallet.
It’s an pallet configurator where you can give dimensions of the pallet and the box and he will calculate some stacking patterns.
It uses three js to visualise the generated patterns in 3d. For that it uses this code:

var materialPallet = new THREE.MeshLambertMaterial({ map: new THREE.TextureLoader().load('images/palletTexture.jpg') });
var materialBox = new THREE.MeshLambertMaterial({ map: new THREE.TextureLoader().load('images/boxTexture.jpg'), color: 0xb38600 });

function generateBox(boxSize, posX, posY, posZ) {
        var geometryBox = new THREE.BoxGeometry(boxSize.X, boxSize.Y, boxSize.Z);
        var meshBox = new THREE.Mesh(geometryBox, materialBox);
        scene.add(meshBox);
        meshTop.add(meshBox);
        meshBox.position.set(posX, posY, posZ);
    }

(file PalletConfig.Web\wwwroot\jsdrawModel.js from the given github repo)
of course there is a lot more code, but this draws the boxes.
Instead of using a MeshLambertMaterial I want to use an obj file (jerrycan) instead of the drawn boxes.

How can I use that obj file instead of the boxes? and also give the right dimensions to the obj?