jonobr1 / jonobr1/two.js

Add Boolean Operations as WASM Modules to Two.js

Open
#596 9 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
8.7k
Forks
463
Avg merge
2d 1h
Merged PRs (30d)
8

Description

Is your feature request related to a problem? Please describe.
Boolean operations are a common, but computationally expensive and mathematically complicated operations in vector drawing suites.

Describe the solution you'd like
For the types of projects Two.js aspires to help make possible, it's important to have these features:

  • Union: Combine two paths into one.
  • Subtraction: Remove one path's form from another's.
  • Intersection: Get the overlapping area of two paths as a new path.
  • Exclusion: Get the non-overlapping area of two paths as a new path.

Essentially these (taken from Adobe Illustrator):
Screen Shot 2022-01-12 at 5 53 25 PM

Additional context
Paper.js has great examples of these running in JavaScript: http://paperjs.org/examples/boolean-operations/ • It would be prudent to port these to Rust as a separate library and compile them to WASM into Two.js as extras.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start with the referenced Paper.js boolean-operations examples and evaluate the proposed Rust library compiled to WASM for Two.js; done means Union, Subtraction, Intersection, and Exclusion are available for Two.js paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, rust, wasm
Domain
computer-graphics, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.