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

Porting to C++ to WASM #53

Open
avalero opened this issue Jun 6, 2019 · 7 comments
Open

Porting to C++ to WASM #53

avalero opened this issue Jun 6, 2019 · 7 comments

Comments

@avalero
Copy link

avalero commented Jun 6, 2019

I am porting this great lib to C++ to be compiled to WASM using ecmscripten. Just to let you know. It is so to speak a blind porting, as I am not really going into the algorithms, just "translating" to C++.

The goal is to recude the computation time.

It is to be used in https://beta.bitbloq.cc/app/playground/3d

@chandlerprall
Copy link
Owner

FYI there is a https://github.com/chandlerprall/ThreeCSG/tree/v1 branch that is a complete rewrite. The split-plane selection algorithm needs small optimization pass, but otherwise it's stable.

@avalero
Copy link
Author

avalero commented Jun 6, 2019

Great to know .I wish I would have known one week ago! 😅 But I'll work on new version. Thanks! You've done a great job!

@avalero
Copy link
Author

avalero commented Jun 14, 2019

Hi @chandlerprall ,

I have migrated bitbloq to v1 and performace (from computation time point of view) is lower. CSG operations take 2 o 3 times more time to finish. Is this expected?

@chandlerprall
Copy link
Owner

That's almost definitely from the split-plane selection. I'll set a reminder for myself and address that in about 12 hours.

@chandlerprall
Copy link
Owner

I'm going to take some extra time to look at a wider spread of solutions for this, but for now, changing

https://github.com/chandlerprall/ThreeCSG/blob/v1/src/BSPNode.ts#L13

to return triangles[0];

resets that part of the algorithm to mimic what's on the master branch. It's a lot faster for generating BSPs, but the resulting BSP is far from optimal.

@WREQI
Copy link

WREQI commented Oct 30, 2019

@chandlerprall

我已将bitbloq迁移到v1,并且Performanceace(从计算时间的角度来看)较低。CSG操作需要2到3倍的时间才能完成。这是预期的吗?
Have you transplanted successfully now?How fast, I also wanted to make a wasm to speed up recently.

@makc
Copy link

makc commented Dec 1, 2019

this link is broken now; did it mean

function chooseDividingTriangle(triangles: Triangle[]): Triangle | undefined {
  return triangles[0];
}

?

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

4 participants