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

Multiple uinions cause StackOverflow Error #59

Open
Fliens opened this issue Mar 21, 2020 · 2 comments
Open

Multiple uinions cause StackOverflow Error #59

Fliens opened this issue Mar 21, 2020 · 2 comments

Comments

@Fliens
Copy link

Fliens commented Mar 21, 2020

I've written this code:

public class Main {

    public static void main(String[] args) throws IOException {
        CSG cube = STL.file(Paths.get("cube.stl"));

        CSG union = cube;
        for (int x = 0; x < 100; x++) {
            union = union.union(cube.transformed(Transform.unity().translateX(x * 10)));
        }

        try {
            FileUtil.write(Paths.get("sample.stl"), union.toStlString());
        } catch (IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

}

But after 26 unions i get this error:

Exception in thread "main" java.lang.StackOverflowError
at java.util.stream.AbstractPipeline.wrapSink(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.collect(Unknown Source)
at eu.mihosoft.jcsg.Node.build(Node.java:244)
at eu.mihosoft.jcsg.Node.build(Node.java:265)

I'm trying to combine multiple objects to one but unluckily i get this error :/

@skanga
Copy link

skanga commented Oct 7, 2020

Try increasing the size of your stack on the Java command line by using something bigger like -Xss1024m

@madhephaestus
Copy link
Contributor

This may be related to #54 and has PR #64 to address it.

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

3 participants