The object is a simple line or surface

Ok, then the bounding box should be fine. Try this:

```
object.geometry.computeBoundingBox();
const size = new Vector3();
object.geometry.boundingBox.getSize( size );
const width = size.x;
```

Once you’ve got the width, you can scale the object as you need based on that width. For example, to make it one unit wide:

```
// Reset scale
object.scale.set( 1,1,1 );
// Now the object will be one unit wide
object.scale.multiplyScalar( 1 / width );
```

To write a linear scale method that matches the D3 method, it’s probably best to start by examining their code.

Maybe Matrix4 can help ?

If you’re comfortable with matrices and know what a 4x4 affine transformation matrix is, you can work with the object’s matrix directly. Otherwise it’s probably best to stick with using the scale.