spite / THREE.MeshLine

Mesh replacement for THREE.Line
MIT License
2.18k stars 380 forks source link

Error in README #120

Open samyhocine opened 3 years ago

samyhocine commented 3 years ago

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

Blakeinstein commented 3 years ago

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