Increasing Line Thickness in Ammo.js Rope Physics Example

I’m working on a small project similar to the Ammo.js softbody rope demo and am having some trouble increasing the thickness of the rope.

By process of elimination (OpenGL no longer supports line thickness and THREE.MeshLine doesn’t seem to work currently) I’ve ended up using THREE.Line2, but I can’t get the rope to update properly with the physics. When the scene loads, the rope physics object works fine and interacts with my other objects, but the actual rope geometry doesn’t move with it and the mesh flickers while sitting in its initial position.

Is there a better way to go about this rather than using Line2? If not, how would I go about using it in the context of the Ammo.js softbody rope demo?

You could try using ExtrudeGeometry using a circle shape. Points are the real-time location of the bodies making up the rope.

private points: Array<Vector3> = [];

    this.geo = new ExtrudeGeometry(this.shape, {
      steps: this.steps,
      extrudePath: new CatmullRomCurve3(this.points),
    })

  private initShape() {
    const circle: Array<Vector2> = [];
    const factor = Math.PI * 2 / (this.sides);
    let angle = factor;
    for (let i = 1; i < this.sides + 1; i++) {
      circle.push(new Vector2(Math.cos(angle) * this.width, Math.sin(angle) * this.width));
      angle += factor;
    }
    this.shape = new Shape(circle);
  }

This example shows how its done. physics cable code is here