Geometry.center() affect the lookat property


if i use the geometry.center() it affect the look.at property
this is my below code :

if (shapeType === AvailableShapes.Cuboid) {
                const targetPosition = new THREE.Vector3();
                const hitObject = this.faceIdentifierSrv.objectHit;
                hitObject.getWorldPosition(targetPosition);
                this.generatedShape.lookAt(targetPosition);
                const orientation = hitObject.userData[Object3DUserData.orientationData];
                const isValidOrientation = validOrientations.some((validOrientation) => {
                return validOrientation.every((face, index) => orientation[index] === face);
                });
                if (isValidOrientation) {
                    this.generatedShape.rotateZ(-Math.PI / 2);
                }
                const offsetVector = new THREE.Vector3().subVectors(this.generatedShape.position, targetPosition).normalize().multiplyScalar(10);
                this.generatedShape.position.add(offsetVector);

                } 

how can i handle this i still need the lookat property for every flip the cuboid will come perpendicular to the right triangle shape hypotenuse face

lookat is a method of the object matrix, and geometry is a set of vertices for the matrix.
The matrix can be thought of as a box for the geometry.
The matrix can be rotated, moved, and scaled, but it does not change the geometry.

Ok thank you