GithubHelp home page GithubHelp logo

liamsaliba / laserweb4 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from laserweb/laserweb4

0.0 2.0 0.0 44.57 MB

Collaborative effort on the next version of LaserWeb / CNCWeb

License: GNU Affero General Public License v3.0

JavaScript 96.03% CSS 3.80% Batchfile 0.17%

laserweb4's Introduction

LaserWeb (0.4.0-alpha)

Work In Progress...

Community

Check the LaserWeb/CNCWeb Google+ community for updates on the progress of this iteration of Laserweb.

Other than that, this is early, so check the Issues tab for "details".

Looking for a functional version ?

Head over LaserWeb3 instead if you'd like to use LaserWeb.

We'll let you know when LW4 is ready for Prime Time.

Developers Note!

We use GitHub Projects to manage this project! Since we are now a multiperson team, please consider talking to the team often to avoid duplication, and other issues

How to contribute ?

Same as Smoothieware github guidline :

  1. Fork the original repositiory.
  2. Clone the forked repository.
  3. Create a new branch for your bugfix/feature.
  4. Commit your changes and push it back on Github.
  5. Submit your pull request (Only one feature per pull request).

Developer Resources of interest:

@tbfleming provides the following guidelines

I can't think of a how-to, but here are some notes that may help.

  • Application state is in a redux store.

    • e.g. document tree, operations, settings, camera position, current tab
  • State is never modified, only replaced. This is critical for undo/redo support. New state shares objects with old state to save memory.

  • Reducers are the only thing which can create new state. Actions tell the reducers what to do. Components render the state. They also install event callbacks which create actions and dispatch them to the store.

  • Only objects which can be serialized to/from JSON go in the store, no regl objects, DOM nodes, image objects, etc. This is critical for state saving and loading.

    • e.g. Polygons are in a 2d arrays: [[x, y, x, y, ...], ...]
    • e.g. Images are in base-64-encoded strings
  • React components convert objects to other forms as needed. Functions in lib/ aid this.

  • The DocumentCacheHolder component converts document data into more usable forms.

    • It converts:
      • Polygon data [[x, y, x, y, ...], ...] into:
        • outlines: array of Float32Array of (x, y, x, y, ...). This draws polygon outlines in regl.
        • triangles: Float32Array of (x, y, x, y, ...), This draws polygon filled areas in regl.
      • Base-64-encoded image data into:
        • Browser's Image class
        • A regl texture
    • It monitors the store and regenerates cache data when needed.
    • It installs itself in React's context like react-redux's Provider.
    • withDocumentCache() wraps other React components like react-redux's connect(). It sets the component's props.documentCacheHolder.

Example: loading an SVG file.

  • The Cam component sets up a callback for the file input
  • The callback fetches the file, creates a loadDocument action with the file content, and dispatches it to the store
  • The documents reducer handles the loadDocument action. It looks at the file type, sees that it's image/svg+xml, and passes it to the loadSvg reducer.
  • The loadSvg reducer uses SnapSvg and functions in lib/ to convert the SVG and add it to a new state.
  • The store triggers a UI render.

One more note:

Don't commit changes that webpack makes to docs/ and dist/ . You have to keep a very careful eye on git; it keeps wanting to commit those files, which will cause problems viewing diffs.

The package list changes frequently; expect to do an npm install every time you do a git pull until things settle down.

Push update to live gh-pages version

Once tested, push updates to Github Pages

git checkout gh-pages && git pull && git merge dev-es6 && npm run bundle-dev && git add dist && git commit -m regen && git push && git checkout dev-es6

LaserWeb Development Environment


  • npm install - Install the development environment.
  • npm start - Start the live development server.
  • npm run bundle-dev - Bundle the project for development.
  • npm run bundle-prod - Bundle the project for production.
  • npm run build-docs - Build the sources documentations.
  • npm run installdev - Resolve git submodules and install.

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.