Skip to content

joeedh/fairmotion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

366 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo

Demo

Installing and running the alpha package

Requirements:

  1. Python www.python.org

#Intro

Fairmotion is an advanced vector graphics/animation editor based on polynomial clothoids (similar to Spiros).

Instead of hard to use polynomial curves, Fairmotion simulates real-world
wooden drafting splines mathematically. The result is much easier to use.

Math

For a deep dive into polynomial clothoids and elastica, see Raph Levien's PhD thesis:

http://www.levien.com/phd/phd.html

Intead of interpolating x and y separately with two polynomials, one polynomial (a cubic bezier) is used to define a plane curve's curvature function. This is then reverse integrated to get a much nicer looking curve than you would get from stuff like Bezier curves or B-Splines.

Fairmotion is very much a work in progress, and should be considered pre-alpha.

Another Example

Extjs

Fairmotion was originally coded in my own type-annotated language based on ES6, and is currently being converted to typescript. As part of this process I added typescript syntax to my existing transpiler.

Build

To build, open a command prompt where you downloaded fairmotion and execute these commands:

pip install ply
python configure.py
./js_build

Excluding PhoneGap From Build

The phonegap build can be a bit slow. To exclude it, open platforms/build_local.py (which was generated by configure.py) and uncomment all the lines except for platforms.PhoneGap.build,, like so:

#example build_local.py

import platforms.chromeapp.build
import platforms.html5.build
import platforms.PhoneGap.build
import platforms.Electron.build

build_platforms = [
  platforms.chromeapp.build,
  platforms.html5.build,
  #platforms.PhoneGap.build,
  platforms.Electron.build
]

Note that if inkscaped is installed, the build process will attempt to render an SVG iconsheet (see src/datafiles/iconsheet.svg). The build system treats iconsheet.svg as any other source file, and will detect changes to it.

Running The Electron App

./dist/run_electron.sh

Or for Windows:

.\dist\run_electron.bat

Refactoring

Fairmotion was forked from an ancient 3D modeler of mine, which I later rewrote from scratch to create webgl-app-framework.

I've backported a lot of architectural changes from webgl-app-framework, but more remain.

Refactor todos (list may not be up to date):

  • Finish porting extjs code to typescript.
  • Replace event dag with webgl-app-framework's graph solver.
  • Finish scene graph refactor.
  • Review OffscreenCanvas and ImageBitmap usage in workers and make sure they do what you'd expect (and don't copy excessively between GPU and CPU).

About

Vector Graphics & Animation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors