Skip to content

Perform Set Operations (Union|Intersection|Difference) on SVG Paths

Notifications You must be signed in to change notification settings

Tanmay53/set-operations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SET OPERATION

Perform set operations like Union | [ Soon to be added : Intersection | Difference ] on SVG Paths.

Supported Path Commands

  • M: Move To
  • Z: Close Path
  • L: Line To
  • Q: Qubic Bezier Curve To

Usage

Install through NPM

npm i set-operations-svg

Import

const { union } = require('set-operations-svg')

Use

let a = "M0 0L0 100L100 100L100 0Z"
let b = "M50 50L50 150L150 150L150 50Z"

let result = union(a, b)
// M0 0L0 100L50 100L50 150L150 150L150 50L100 50L100 0z

About

Perform Set Operations (Union|Intersection|Difference) on SVG Paths

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published