question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BufferGeometry need to be called with `new`

See original GitHub issue

The code uses https://github.com/spite/THREE.MeshLine/blob/master/src/THREE.MeshLine.js#L12

    THREE.BufferGeometry.call(this)

however recently threejs has some changes to make use of ES6 classes

All central engine components like Object3D, BufferGeometry or ShaderMaterial are now ES6 classes.

https://github.com/mrdoob/three.js/wiki/Migration-Guide#127--128

need an update now.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:37
  • Comments:5

github_iconTop GitHub Comments

20reactions
RenaudRohlingercommented, Sep 4, 2021

Hello! Thank you very much for this amazing library @spite. I made a new version of a library using vite and typescript. I would be happy to PR it on your repo but I went a bit yolo and had to use --allow-unrelated-histories. https://github.com/utsuboco/THREE.MeshLine

Temporary I published it on npm under the name meshline. It should work the same way, and it now exports es(2.89kb brotli) and umd(3.13kb). image

If anyone could take over in cleaning the code that would be amazing.

Here a working example with react-three/fiber: https://codesandbox.io/s/confetti-typescript-meshline-0f4mi?file=/src/index.tsx

EDIT: Added typescript definitions in 2.0.3

0reactions
jrmahechadcommented, Feb 10, 2022

interested in this fix

Read more comments on GitHub >

github_iconTop Results From Across the Web

BufferGeometry – three.js docs
To read and edit data in BufferGeometry attributes, see BufferAttribute ... You will have to call .dispose(), and create a new instance of...
Read more >
Three.js Custom BufferGeometry
BufferGeometry on the other hand uses named BufferAttribute s. ... If a vertex needs any part to be different then it must be...
Read more >
Updating THREE.Geometry to THREE.BufferGeometry
If you used the THREE.Geometry in any of your custom code, and you want to use THREE r125 or later, then you will...
Read more >
The Buffer Geometry Constructor in threejs
The buffer geometry constructor in threejs and what to know first ... I now just need to add this geometry to a mesh...
Read more >
Three.js – Buffer Geometry Art - YouTube
In this JavaScript tutorial, we'll build a colorful work of abstract art with basic JavaScript in THREE.jsHere's the final *sculpture*: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found