Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError offset is out of bounds - Float32Array.set #170

Open
loicroybon opened this issue Jun 21, 2024 · 1 comment
Open

RangeError offset is out of bounds - Float32Array.set #170

loicroybon opened this issue Jun 21, 2024 · 1 comment

Comments

@loicroybon
Copy link

loicroybon commented Jun 21, 2024

Hello,

I've this issue only with certain meshes.

RangeError offset is out of bounds - Float32Array.set

Stack Trace

../node_modules/***/src/modules/nexus/Nexus3D.js dans Nexus3D.createNodeGeometry à la ligne 491:18

        const m = this.mesh;
        const nv = m.nvertices[id];
        const indices = data.index;
        const vertices = new ArrayBuffer(nv * m.vsize);
        const position = new Float32Array(vertices, 0, nv * 3);
        position.set(data.position);
        let off = nv * 12;
        if (m.vertex.texCoord) {
            const uv = new Float32Array(vertices, off, nv * 2);
            uv.set(data.uv);
            off += nv * 8;

../node_modules/***/src/modules/nexus/Nexus3D.js dans this.mesh.createNodeGeometry à la ligne 124:15


    open(url) {
        const t = this;
        this.mesh.open(url);
        this.mesh.createNode = (/* id */) => {};
        this.mesh.createNodeGeometry = (id, geometry) => {
            t.createNodeGeometry(id, geometry);
        };
        this.mesh.createTexture = (id, image) => {
            t.createTexture(id, image);
        };
        this.mesh.deleteNodeGeometry = id => {

../node_modules/***/src/modules/nexus/Cache.js dans _Cache.prototypereadyGeometryNode à la ligne 466:14


            }
        } else {
            geometry = buffer;
        }
        mesh.createNodeGeometry(id, geometry);
        mesh.status[id]--;
        if (mesh.status[id] === 2) {
            this.readyNode(mesh, id);
        }

../node_modules/***/src/modules/nexus/Cache.js dans corto.onmessage à la ligne 124:24


        corto.onmessage = function (e) {
            const request = e.data.request;
            const node = this.requests[request];
            delete this.requests[request];
            node.model = e.data.model;
            node.cache.readyGeometryNode(node.mesh, node.id, node.model);
        };
        this.corto = corto;
    },

Any idea ?

@ponchio
Copy link
Contributor

ponchio commented Jun 21, 2024

Hard to say, its seems like nexus expected texture coordinates while corto didn't. Could you provide a sample?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants