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

Maximum call stack size exceeded with ...vertices spread operator in BVH #18

Closed
Glidias opened this issue Feb 17, 2020 · 3 comments
Closed

Comments

@Glidias
Copy link

Glidias commented Feb 17, 2020

It happens for a large data set i'm working with.

For the interest of performance/stability, would converting the spread operator line at https://github.com/Mugen87/yuka/blob/master/src/math/BVH.js#L84 to something like for (let e of vertices) this.root.primitives.push(e); suffice?

possibly related: nodejs/node#16870

@Mugen87
Copy link
Owner

Mugen87 commented Feb 17, 2020

It happens for a large data set i'm working with.

I'm curious. How many entries do you have in the vertices array?

According to the discussion it seems a for loop should solve this problem. I'll fix this 👍

@Mugen87
Copy link
Owner

Mugen87 commented Feb 17, 2020

We are using the spread operator at other places, too. But since its syntax is so elegant, I would only provide further patch if you run into the same issue elsewhere.

Fix a505f08. I'll also upgrade the npm package.

@Glidias
Copy link
Author

Glidias commented Feb 18, 2020

How big the data set? I'm not sure if it happens for the first BVH case or the second BVH case.

  • 22603 tris , 67809 soup vertices : Initial Navmesh polygons of test floor area
  • 44647 tris , 133941 soup vertices : Extruded Navmesh borders (extruded polygon extents) for borders/chamfering corners of navmesh when accounting for specific agent radius (car width size..).

A visual cap (entire land area of a re-generated navmesh from floor-area accounting for specific agent radius Regenerated Navmesh = ((Triangles ∈ Navmesh) ¬ (borders + chamfers)) ):
image
Closeup:
image
image

On a sidenote for potentially future framework consideration, it'd be cool if CellSpacePartioning and BVH (or whatever partitioning implementation, etc.) could adopt some common interface methods (similar to Graph search implementations), so Navmesh could swap various partitioning strategies interchangably. I understand that BVH is a completely different implementation as of now outside the partition package.

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

No branches or pull requests

2 participants