GithubHelp home page GithubHelp logo

bedatadriven / appengine-export Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 5.0 6.58 MB

Collection of libraries for producing PDF, RTF, EMF, PNG, etc. files ported to AppEngine

Java 99.76% HTML 0.24%

appengine-export's People

Contributors

akbertram avatar bddbot avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

appengine-export's Issues

A bug of org.apache.harmony.awt.geom.GeometryUtil

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;
}

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.