JsClipper | Original : http : //sourceforge.net/projects/jsclipper

 by   Delapouite JavaScript Version: Current License: No License

kandi X-RAY | JsClipper Summary

kandi X-RAY | JsClipper Summary

JsClipper is a JavaScript library. JsClipper has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

a javascript library to perform boolean operations (union, difference etc…​) between two svg paths. online demo : 5.0.2.1 - 12 january 2013 * update: clipper library updated to version 5.0.2. the area algorithm has been updated and is faster. checkinputs parameter of the offsetpolygons function has been renamed autofix. * added: clipperlib.clean(), which removes too near vertices to avoid micro-self-intersection-artifacts when offsetting. * added: clipperlib.lighten(), which reduces count of vertices using perpendicular distance reduction algorithm. * added: clipperlib.clone(), which make true clone of polygons. several updates to the main demo: * added: clean, simplify, lighten buttons * change: custom polygons: input boxes to textareas to
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              JsClipper has a low active ecosystem.
              It has 68 star(s) with 21 fork(s). There are 5 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 3 open issues and 1 have been closed. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of JsClipper is current.

            kandi-Quality Quality

              JsClipper has no bugs reported.

            kandi-Security Security

              JsClipper has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              JsClipper does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              JsClipper releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of JsClipper
            Get all kandi verified functions for this library.

            JsClipper Key Features

            No Key Features are available at this moment for JsClipper.

            JsClipper Examples and Code Snippets

            No Code Snippets are available at this moment for JsClipper.

            Community Discussions

            QUESTION

            How to simplify shapes for triangulation with three.js and jsclipper
            Asked 2019-Mar-20 at 06:53

            I try to display geometry which is constructed by constructpath commands like moveto lineto beziercurveto in Three.js. Therefore I create a THREE.ShapePath(); and execute the command toShapes(isClockwise). After this I use THREE.ExtrudeBufferGeometry to create the 3D shape.

            Unfortunately the shapes are sometimes really complex and are not created correctly which means they are distorted.

            Using libtess as triangulation library solves some issues. But I have still distorted geometry.

            Now I want to use jsclipper to simplify the shapes prior triangulation.

            I modified three.js in such way:

            in the method addShape in ExtrudeBufferGeometry I have added:

            ...

            ANSWER

            Answered 2019-Mar-20 at 06:53

            A bit hard to figure out what the problem is actually. Clipper (also when using SimplifyPolygons or SimplifyPolygon) can only produce weakly-simple polygons, which means that there can be pseudo-duplicate points: although sequential coordinates are quaranteed to be not indentical, some of the next points can share the same coordinate. Also a coordinate can be on the line between two points.

            After simplifying (or any other boolean operation) you could make a cleaning step using Offsetting with a small negative value: https://sourceforge.net/p/jsclipper/wiki/documentation/#clipperlibclipperoffsetexecute.

            This possibly removes all of the pseudo-duplicate points.

            I have made also a float version of Clipper (http://jsclipper.sourceforge.net/6.4.2.2_fpoint/). It is extensively tested, but because Angus Johnson, the author of the original C# Clipper (of which JS-version is ported from), has thought that using floats causes robustness problems although according to my tests the are no such, the original C# float version does not exists. The float version is simpler to use and you can try there a small negative offset: eg. -0.001 or -0.01.

            You could also give a try to PolyTree or ExPolygons (https://sourceforge.net/p/jsclipper/wiki/ExPolygons%20and%20PolyTree%206/). ExPolygons can be used to get holes and contours and PolyTree can be used to get the full parent-child-relationship of holes and contours.

            The last resort is a broken-pen-nib -function. It detects all pseudo-duplicate points and make a broken-pen-nib -effect to them, so that the result is free of any duplicates. The attached images shows what this effect means using large nib-effect-value to make the effect meaning clearer. Three.js polygon triangulation fails in pseudo duplicate points. There are a discussion https://github.com/mrdoob/three.js/issues/3386 of this subject.

            Source https://stackoverflow.com/questions/55210827

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install JsClipper

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/Delapouite/JsClipper.git

          • CLI

            gh repo clone Delapouite/JsClipper

          • sshUrl

            git@github.com:Delapouite/JsClipper.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular JavaScript Libraries

            freeCodeCamp

            by freeCodeCamp

            vue

            by vuejs

            react

            by facebook

            bootstrap

            by twbs

            Try Top Libraries by Delapouite

            emmet-cli

            by DelapouiteShell

            lodash.math

            by DelapouiteHTML

            kakoune-explain

            by DelapouiteJavaScript

            kakoune-ink

            by DelapouiteJavaScript

            eslint-formatter-kakoune

            by DelapouiteJavaScript