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

Creating instance of Bend takes 30 seconds #7

Open
tmedanovic opened this issue Feb 4, 2024 · 5 comments
Open

Creating instance of Bend takes 30 seconds #7

tmedanovic opened this issue Feb 4, 2024 · 5 comments

Comments

@tmedanovic
Copy link

The code below hangs on new Bend line and takes around 30 seconds:

        this.modifier = new ModifierStack(this.result);
        const bendAngle = Math.PI / 180 * 90;
        const bend = new Bend(1.5, 0.2, bendAngle);
        bend.constraint = ModConstant.LEFT;

       this.modifier.addModifier(bend);
       this.result.rotateY(Math.PI / 180 * 45);

Am I doing something wrong or is this normal?

@drawcall
Copy link
Owner

drawcall commented Feb 5, 2024

https://b55p6.csb.app/

30 seconds? Not here. Is it caused by the new version of threejs?

@tmedanovic
Copy link
Author

Here are my dependencies:

"dependencies": { "three": "^0.153.0", "three-csg-ts": "^3.1.13", "three.modifiers": "^2.5.7" }
I will try to create a minimal repro and post it here.
I'm also using typescript with webpack.

@tmedanovic
Copy link
Author

tmedanovic commented Apr 22, 2024

Apologies for taking so long to post repro, here is a link to my sample: Repro.
Uncomment lines 158, 163, 168, 173 and the browser stops responding.

There is some overhead from the "online sandbox app", but running the sample locally takes about 15 sec to render, the browser doesn't stop responding locally however .

I changed SVGs a bit in this repro but the same code with original SVGs took around 30 secs. The problem is definitely in the SVGs somehow - when I created SVGs with random and more complicated shapes from scratch instead of those 3 in the code - rendering took 1sec.

Seems like something about those SVGs causes performance issues.
Can you take a look when you get a chance? I'm really curious what is causing this.

I can create a repo with code ready to run locally if that helps.

Edit: I originally mentioned that creating instance of new Bend causes the issue, but it seems like it's new ModifierStack

@drawcall
Copy link
Owner

mark

@tmedanovic
Copy link
Author

Hey @drawcall, did you get a chance to play around with this issue?

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