Skip to content

Repository files navigation

SKOPPIG

Primary idea

This project is based around building a webapp paint project with a node based brush editor allowing for the creation and (potentially heavy) optimisation of customised brushes. Tools within the editor are based around these customised brushes made along with multiple sketching tools.

Layout

The site can be separated into two main 'pages':

A Canvas page

This page is where the actual drawing is done, making use of the brushes created

Brush

Just apply the brush to the created canvas

Fill

Flood fill an area by tiling a brush back to back and cropping

Smart Fill

Flood fill an area by using a wfc algorithm and cropping.

It might be possible to do wfc via GPU (for canvas size C, brush size B, section size S):

  1. Precompute side hashes for each section of brush result - O((B/S)^2)
    1. Also could be done via GPU
  2. Whilst maximum entropy > 0
    1. Compute maximum + minimum entropy via GPU - O(logC)
    2. For each cell has entropy = the minimum entropy
      1. Assign random value to cell
      2. Mark cell for updates
    3. Whilst there are still cells to update, For each cell C to update
      1. Attempt to update the entropy of cells around C
      2. If a cell is updated, mark it for update and check

Ruler

Makes drawing straight lines easier by placing a limit on where can be drawn

A Design page

This page is dedicated to designing custom brushes via a node based system

The layout of the brush design page

The node system primarily uses beautiful-react-diagrams with the following edits made:

  • Typescript typing has been introduced for schema components
  • Additional config options have been added to the Diagram element
  • Multiple graph algorithms have been added to the shared functions, to allow for folding of nodes
  • Added options to provide custom port rendering (both via custom classNames and custom render functions)

The code for this modified version can be found in the ./lib/beautiful-react-diagrams directory

Getting Started

First, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.

API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.js.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Sources

About

A node based brush editor

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages