THREE.MeshLine icon indicating copy to clipboard operation
THREE.MeshLine copied to clipboard

Error in README

Open samyhocine opened this issue 4 years ago • 1 comments

Hi,

There is an error in the README.md file:

It's written:

const line = new MeshLine();
line.setPoints(points);
// p is a decimal percentage of the number of points
// ie. point 200 of 250 points, p = 0.8
line.setPoints(geometry, p => 2); // makes width 2 * lineWidth
line.setPoints(geometry, p => 1 - p); // makes width taper
line.setPoints(geometry, p => 2 + Math.sin(50 * p)); // makes width sinusoidal

and it shall be setGeometry instead of setPoints when using a BufferGeometry or Geometry object.

Here is the patch:

const line = new MeshLine();
line.setPoints(points);
// OR
line.setGeometry(geometry);

And

// p is a decimal percentage of the number of points
// ie. point 200 of 250 points, p = 0.8
line.setGeometry(geometry, p => 2); // makes width 2 * lineWidth
line.setGeometry(geometry, p => 1 - p); // makes width taper
line.setGeometry(geometry, p => 2 + Math.sin(50 * p)); // makes width sinusoidal

Really grateful for the work you've done ;) I was struggling with line width of 1 on Windows (Linux was OK).

Best regards,

Samy

samyhocine avatar Dec 13 '20 01:12 samyhocine

Had to check source code to figure this out! I really wish typescript support happens soon.

Blakeinstein avatar Jan 23 '21 15:01 Blakeinstein