Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rep-movsd/flower
vector graphics DSL
https://github.com/rep-movsd/flower
Last synced: about 1 month ago
JSON representation
vector graphics DSL
- Host: GitHub
- URL: https://github.com/rep-movsd/flower
- Owner: rep-movsd
- Created: 2023-10-01T17:59:44.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-01T18:21:33.000Z (about 1 year ago)
- Last Synced: 2023-10-01T22:07:59.035Z (about 1 year ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# flower
Flower is actually Flow-erIt is a tool to convert code in the Flower DSL into SVG graphics
The basic concept is what are called "Flows" which are nothing but a pair of "begin" and "end" states.
In the simplest example, these states would be co-ordinates of pointsA "flow" is the conceptual continous transformation from the "begin" to "end" state.
Since states are basically numeric, they can be interpolated over the normalized range 0 to 1 where 0 is the start and 1 is the endThis representation allows some things to be done easily:
- Animation is merely rendering the state in a flow between t = 0 and t = 1
- You can inherit and modify an existing flow to make a new one easily
- The starting and ending states could have different numbers of points (TODO)
- There could be things other than co-ordinates as a state if you provide the semantics of continuity between any 2 (TODO)
- Flows state could be linked to other flows states allowing complex animation possibilitiesThe DSL is a series of lines with RPN expressions
- Anything in lowercase is an identifier
- Anything starting with non-lowercase is a Type constructor or Operator
- Points are in polar form
- / means add to the points angle
- \+ and - mean change the points distance
- \* means scale the points distanceThe "compiler" takes the DSL file and will (eventually) generate an SVG file that draws a flow with basic animation if desired.
For more complex graphics JS code will be added in the output (TODO).Syntax is evolving, code is incomplete - look at the sample file(s) for elaborate syntax description (TODO).