Coder Social home page Coder Social logo

michael-f-bryan / adventures-in-motion-control Goto Github PK

View Code? Open in Web Editor NEW
32.0 6.0 4.0 7.74 MB

A realistic simulator for a 3D printer motion controller

Home Page: http://adventures.michaelfbryan.com/

License: Apache License 2.0

Rust 77.03% JavaScript 0.62% HTML 0.74% Vue 14.43% TypeScript 7.17%
rust motion-controller blog-series embedded-systems 3d-printing cnc

adventures-in-motion-control's Introduction

Adventures in Motion Control

Build Status

(API Documentation/Blog Series)

A realistic simulator for a 3D printer motion controller.

Think of this as a worked example of how embedded systems are made. The project is a lot more than just a gcode interpreter, it gives you a full-blown motion controller which behaves like a real 3D printer complete with automation sequences and diagnostics.

To follow along with the making of this project, check out the Adventures in Motion Controller blog series.

Getting Started

This project has components from two different languages, which makes building things a little... complex.

First you'll need to generate the WASM bundle for the sim crate using wasm-pack.

$ wasm-pack build --release sim
$ ls sim/pkg
  aimc_sim.d.ts aimc_sim.js aimc_sim_bg.d.ts aimc_sim_bg.wasm package.json
  README.md sim.d.ts sim.js sim_bg.d.ts sim_bg.wasm

The generated WASM also needs to be linked into our JavaScript. In order to do this first go to sim/pkg

$ cd sim/pkg
$ yarn link

This will globally register aimc_sim package. Next go to frontend

$ cd frontend
$ yarn link aimc_sim

Next, you'll need to compile the frontend JavaScript code. During development, you'll probably want to use the dev server:

$ yarn install
$ yarn serve

Or to generate a production build:

$ yarn run build
$ ls dist
  0.bootstrap.js 1.bootstrap.js bootstrap.js ea9e01c84ad93861b0ad.module.wasm
  index.html

If you want the code to be automatically recompiled whenever there are any changes, you can usewatchexec. Open new terminal and execute.

TL;DR:

watchexec \
    --clear \
    --restart \
    --ignore 'sim/pkg/*' \
    --ignore 'frontend/package.json' \
    --ignore 'frontend/yarn.lock' \
    --ignore 'frontend/node_modules/*' \
    'wasm-pack build --release sim'

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

adventures-in-motion-control's People

Contributors

dependabot[bot] avatar mars22 avatar michael-f-bryan avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

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.