bedatadriven / appengine-export Goto Github PK
View Code? Open in Web Editor NEWCollection of libraries for producing PDF, RTF, EMF, PNG, etc. files ported to AppEngine
Collection of libraries for producing PDF, RTF, EMF, PNG, etc. files ported to AppEngine
here is a Graphics2D example, https://gist.github.com/4230687
but it will stop at "leaf1.intersect(leaf2);" after some debug, I found it should a bug in the cubicNewton method of org.apache.harmony.awt.geom.GeometryUtil
first, if d==0 it will be infinity loop,
second, if Math.sqrt((t - t1) * (t - t1) + (s - s1) * (s - s1)) > EPSILON, it will be always true, also a infinity loop, because it do the same job every time.
private static void cubicNewton(double xCoefs1[], double yCoefs1[], double xCoefs2[],
double yCoefs2[], double[] params) {
double t = 0.0, s = 0.0;
double t1 = params[0];
double s1 = params[1];
double d, dt, ds;
while (Math.sqrt((t - t1) * (t - t1) + (s - s1) * (s - s1)) > EPSILON) {
d = -(3 * t * t * xCoefs1[0] + 2 * t * xCoefs1[1] + xCoefs1[2]) *
(3 * s * s * yCoefs2[0] + 2 * s * yCoefs2[1] + yCoefs2[2]) +
(3 * t * t * yCoefs1[0] + 2 * t * yCoefs1[1] + yCoefs1[2]) *
(3 * s * s * xCoefs2[0] + 2 * s * xCoefs2[1] + xCoefs2[2]);
dt = (t * t * t * xCoefs1[0] + t * t * xCoefs1[1] + t * xCoefs1[2] +
xCoefs1[3] - s * s * s * xCoefs2[0] - s * s * xCoefs2[1] -
s * xCoefs2[2] - xCoefs2[3]) * (- 3 * s * s * yCoefs2[0] -
2 * s * yCoefs2[1] - yCoefs2[2]) + (t * t * t * yCoefs1[0] +
t * t * yCoefs1[1] + t * yCoefs1[2] + yCoefs1[3] - s * s *s * yCoefs2[0] -
s * s * yCoefs2[1] - s * yCoefs2[2] - yCoefs2[3]) *
(3 * s * s * xCoefs2[0] + 2 * s * xCoefs2[1] + xCoefs2[2]);
ds = (3 * t * t * xCoefs1[0] + 2 * t * xCoefs1[1] + xCoefs1[2]) *
(t * t * t * yCoefs1[0] + t * t * yCoefs1[1] + t * yCoefs1[2] +
yCoefs1[3] - s * s * s * yCoefs2[0] - s * s * yCoefs2[1] -
s * yCoefs2[2] - yCoefs2[3]) - (3 * t * t * yCoefs1[0] +
2 * t * yCoefs1[1] + yCoefs1[2]) * (t * t * t * xCoefs1[0] +
t * t * xCoefs1[1] + t * xCoefs1[2] + xCoefs1[3] -
s * s * s * xCoefs2[0] - s * s * xCoefs2[1] - s * xCoefs2[2] - xCoefs2[3]);
t1 = t - dt / d;
s1 = s - ds / d;
}
params[0] = t1;
params[1] = s1;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.