GithubHelp home page GithubHelp logo

eriksom / clipper2-wasm Goto Github PK

View Code? Open in Web Editor NEW
32.0 32.0 3.0 308 KB

WASM port of Clipper 2 for Polygon Clipping and Offsetting

License: Boost Software License 1.0

HTML 45.10% C++ 37.29% Shell 4.24% JavaScript 13.36%
boolean-operations polygon-clipping polygon-offsetting wasm webassembly

clipper2-wasm's Issues

Out of Memory Issue

Hi,

I am a big fan of the plugin and its super useful. However I am getting an issue with the plugin eventually running out of memory despite clearing and deleting structures after use and then flushing pending deletes. I wondered if you could give me any advice on how to fix this

Best wishes

Math Whittaker

MakePath64 very slow

        const { MakePath64, Paths64, FillRule, Union64 } = MainModule

        for (let i = 0; i < 10000; i++)
        {

            let a = [-5070000, -23550000, 7710000, -23550000, 7710000, 22590000, -5070000, 22590000];
            let b = [0, 0, 7140200, 0, 7140200, 860200, 0, 860200];

            const subject = new Paths64();
            const clip = new Paths64();

            const combinedNfp1 = Union64(subject, clip, FillRule.NonZero);
            subject.push_back(MakePath64(a));

            const subject1 = new Paths64();
            subject1.push_back(MakePath64(b));
            let finalNfp1 = clipperCpp.lib2.Difference64(subject1, combinedNfp1, FillRule.NonZero);

            let fnfp = [];
            for (let i = 0; i < finalNfp1.size(); i++)
            {
                let path = finalNfp1.get(i);
                path.size();
                let arr = [];
                for (let j = 0; j < path.size(); j++)
                {
                    let p = path.get(j);
                    arr.push({ x: p.x, y: p.y });
                }

                fnfp.push(arr);
            }

            // console.log(fnfp);
        }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.