epicycle | boilerplate framework for building isomorphic applications | Runtime Evironment library
kandi X-RAY | epicycle Summary
kandi X-RAY | epicycle Summary
node.js + motorcycle.js == isomorphism. epicycle is a foundational/boilerplate project for building reactive, isomorphic applications with [motorcycle.js] and [node.js] starting a new web application these days is annoyingly overburdened with setup and ceremony, not to mention all of the repetitive groundwork required to establish a solid foundation for the rest of the application to be built upon. depending on what you’re trying to do, it can take anywhere from hours to days to get to a point where you’re writing your actual project-specific code. this project is designed to take that pain out of the equation and give you the fastest possible starting point when developing a new isomorphic web application using [motorcycle.js] simply put, it’s ridiculously fast, while being idiomatically the same as [cycle.js] so if you know cycle, you should be able to get into motorcycle pretty easily. the underlying streams library is [most] which is a little different in behaviour to to rxjs, but it’s literally two orders of magnitude faster, so the small learning curve is worth it. it is impossible to be unopinionated when it comes to build tools, because there
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of epicycle
epicycle Key Features
epicycle Examples and Code Snippets
Community Discussions
Trending Discussions on epicycle
QUESTION
I have an svg image that contains a continuous path, and I want to extract its cartesian coordinates (x,y) preferably to a csv file.
I’m doing this to recreate 3B1B’s animation of any arbitrary path using epicycles. Link here https://youtu.be/-qgreAUpPwM
Is there any library or tools I can use to do this?
...ANSWER
Answered 2021-Jan-22 at 20:02For example I'm parsing ballons.svg file below.
Variant 1. Using Python (see also Variant 2 using JavaScript).
First I'm using xml.dom
module to find path
entries inside file. Then path
entries are parsed by svg.path
library (needs to be installed by pip install svg.path
).
There are many different types of objects can be inside path
entry, e.g. Line, Arc, CubicBezier, QuadraticBezier, Close, etc.
For each path first I print all objects as they are inside Objects:
section. Then if you need coordinates of those objects then there are start
/end
attributes available in this objects. They point to start/end point of corresponding objects.
Start point (X, Y) of object inside path is (obj.start.real, obj.start.imag)
. End point (X, Y) of object is (obj.end.real, obj.end.imag)
. But these are only ending points, intermediate points of curve are not contained inside SVG file and need to be calculated mathematically.
QUESTION
Before we begin, you may want to read my previous post which lead to the creation of this question:
Drawing/Rendering 3D objects with epicycles and fourier transformations [Animation]
Context:
Using the P5.js library and following a tutorial from The Coding Train (Coding Challenge #130.1 --> #130.3) i was able to animate and recreate any parametric drawing using epicycles and fourier transforms. (Read the Previous Post, trust me, it will help)
I am now looking to expand this to three Dimensions!
A helpful community member suggested breaking the 3D drawing into two planes. This way, i dont have to write new code, and could use my preexisting 2D code! cool right!
Another User suggested using the Three.JS library to create a 3D scene for this process.
So Far i have created 3 planes. I would like to essentially use these planes as TV Screens. TV screens where i can then display my 2D version from written in P5js and project a new point in 3D space to generate/draw a new 3D drawing.
...ANSWER
Answered 2019-Jul-24 at 02:06Dabbled a bit more with what I think is your basic concept. Believe it or not, more than 50% of the effort involved working around dithering issues associated with overlapping transparent objects in motion, an area where three.js is a bit weak. But, after a bit of searching, one can mitigate the dithering issues with adjustments to the Z alignment of the objects and the renderOrder.
In any event, take a look at the code below, which extends your effort, introducing 5 randomly sized and rotating transparent circles. For drawing lines, take a look at the following link https://threejs.org/docs/#manual/en/introduction/How-to-update-things .
QUESTION
First Note: They wont let me embed images until i have more reputation points (sorry), but all the links are images posted on imgur! :) thanks
I have replicated a method to animate any single path (1 closed path) using fourier transforms. This creates an animation of epicylces (rotating circles) which rotate around each other, and follow the imputed points, tracing the path as a continuous loop/function.
I would like to adopt this system to 3D. the two methods i can think of to achieve this is to use a Spherical Coordinate system (two complex planes) or 3 Epicycles --> one for each axis (x,y,z) with their individual parametric equations. This is probably the best way to start!!
2 Cycles, One for X and one for Y:
Picture: One Cycle --> Complex Numbers --> For X and Y
Fourier Transformation Background!!!:
• Eulers formula allows us to decompose each point in the complex plane into an angle (the argument to the exponential function) and an amplitude (Cn coefficients)
• In this sense, there is a connection to imaging each term in the infinite series above as representing a point on a circle with radius cn, offset by 2πnt/T radians
• The image below shows how a sum of complex numbers in terms of phases/amplitudes can be visualized as a set of concatenated cirlces in the complex plane. Each red line is a vector representing a term in the sequence of sums: cne2πi(nT)t
• Adding the summands corresponds to simply concatenating each of these red vectors in complex space:
Animated Rotating Circles:
Circles to Animated Drawings:
• If you have a line drawing in 2D (x-y) space, you can describe this path mathematically as a parametric function. (two separate single variable functions, both in terms of an auxiliary variable (T in this case):
• For example, below is a simple line drawing of a horse, and a parametric path through the black pixels in image, and that path then seperated into its X and Y components:
• At this point, we need to calculate the Fourier approximations of these two paths, and use coefficients from this approximation to determine the phase and amplitudes of the circles needed for the final visualization.
Python Code: The python code used for this example can be found here on guithub
I have successful animated this process in 2D, but i would like to adopt this to 3D.
The Following Code Represents Animations in 2D --> something I already have working:
[Using JavaScript & P5.js library]
The Fourier Algorithm (fourier.js):
...ANSWER
Answered 2019-Jul-19 at 18:54The method that I would suggest is as follows. Start with a parametrized path v(t) = (v_x(t), v_y(t), v_z(t))
. Consider the following projection onto the X-Y plane: v1(t) = (v_x(t)/2, v_y(t), 0)
. And the corresponding projection onto the X-Z plane: v2(t) = (v_x(t)/2, 0, v_z(t))
.
When we add these projections together we get the original curve. But each projection is now a closed 2-D curve, and you have solutions for arbitrary closed 2-D curves. So solve each problem. And then interleave them to get a projection where your first circle goes in the X-Y plane, your second one in the X-Z plane, your third one in the X-Y plane, your fourth one in the X-Z plane ... and they sum up to your answer!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install epicycle
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page