# SnapToJsClipper **Repository Path**: mirrors_TNG/SnapToJsClipper ## Basic Information - **Project Name**: SnapToJsClipper - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-08-27 - **Last Updated**: 2026-02-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SnapToJsClipper This is a [Snap.svg](http://snapsvg.io) plugin providing an interface to the [Javascript clipper](https://sourceforge.net/projects/jsclipper/) library. # Dependencies This plugin has only one explicit dependency: [Javascript clipper](https://sourceforge.net/projects/jsclipper/). It has been developed and tested with version `5.0.2.1` (download it [here](https://sourceforge.net/projects/jsclipper/files/Javascript_Clipper_5.0.2.1.zip/download)) and is _not_ compatible with version `6.0.x.y` yet! Note that `Javascript clipper` uses `Snap.svg`'s predecessor `Raphael` internally; in order to increase performance and to reduce reduncancy, one could think of re-writing `Javascript clipper` using `Snap.svg` only. ## Motivation Clipping the visible part of a given SVG file is easy when it comes to rendering for viewing purpose by just adding a partially transparent layer over it. When it comes to laser cutting or CNC milling, this becomes non trivial, since both techniques do not only need information about the visible/hidden parts of a `path`, but a continuous representation of the clipped `path` as a guidance for their cutting tools. This repository provides a [Snap](snapsvg.io) plugin that allows for the usage of the established `Javascript clipper` library to execute boolean operations on two overlaying polygons. Note that any SVG path commands different from `m/M`, `l/L` and `Z` will be ignored, so a simplification to polygon lines must be performed on each `path` before processed by `Javascript clipper`. ## Usage This plugin extends the API of each `Snap.Element` with the functions `unionClip()`, `intersectClip()` , `differenceClip()` and `xorClip()`. The input parameter for all functions is another `Snap.Element` which may or may not have a nested structure. ```html