Giter VIP home page Giter VIP logo

cp-editor's Introduction

Crease Pattern Editor

This is a draft of a web software tool for drawing quick crease/slit patterns. Currently it works well for crease patterns that fit on an integer grid.

Features So Far

  • Graph-based: Always maintain a planar graph, automatically subdividing and merging together touching vertices
  • Draw a crease with two clicks or with dragging
  • Recolor existing creases as different types by dragging over them (easily recoloring just part of a line)
  • Fold angle support: enter degrees (or formula for degrees) to adjust mountain/valley fold amount (drawn via opacity)
  • Erase existing creases by dragging over them
  • Move vertices by dragging them (bringing all connected edges with them)
  • Snapping to grid or existing vertex (e.g. from intersection)
  • Cleanup to remove extra degree-0 or -2 vertices
  • Undo/redo
  • Save/export to .fold/.svg, including cutting (unwelding) of slits
  • CLI for bulk conversion: node cpedit.js --cleanup --fold --svg filename.cp
  • Title setting for document (file_title in fold format)
  • Page size setting (width and height)
  • Transform document by reflection or 90° rotation
  • Keyboard shortcuts:
    • Escape key cancels current operation
    • z for undo, Z or y for redo
    • Modes and line types list their key shortcut

Installation

  • Type npm install to do the necessary preparation
  • Type git submodule update --init --recursive to use Origami Simulator integration
  • Open cpedit.html in a web browser such as Chrome

cp-editor's People

Contributors

edemaine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cp-editor's Issues

Rename .cp -> .fold

FOLD 1.2 now supports "C" edges so we can use that as our primary format.
It's still helpful to have a "Save as exploded FOLD" or similar wording to switch from "C" to "B".

Flat folding or Origami Simulator

It'd be nice to turn on a side-by-side integration with flat folding computation (now supported by Fold) or Origami Simulator.

Update: Pop-out Origami Simulator now supported!

Off grid

Should be able to disable grid snapping

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.