Examples of ParametricPlane


Examples of org.kabeja.math.ParametricPlane

        } else {
            directionX = MathUtils.crossProduct(DXFConstants.DEFAULT_Z_AXIS_VECTOR,
                    this.viewDirectionVector);
        }

        ParametricPlane plane = new ParametricPlane(this.viewTargetPoint,
                directionX,
                MathUtils.crossProduct(this.viewDirectionVector, directionX),
                this.viewDirectionVector);
        Bounds bounds = new Bounds();
        Point p = plane.getPoint(this.viewCenterPoint.getX() - modelW,
                this.viewCenterPoint.getY() - modelH);
        bounds.addToBounds(p);
        p = plane.getPoint(this.viewCenterPoint.getX() + modelW,
                this.viewCenterPoint.getY() + modelH);
        bounds.addToBounds(p);

        return bounds;
    }
View Full Code Here

Examples of org.kabeja.math.ParametricPlane

    public Bounds getBounds() {
        double alpha = this.getRotationAngle();
        Bounds bounds = new Bounds();

        ParametricPlane plane = new ParametricPlane(this.center,
                this.getExtrusion().getDirectionX(),
                this.getExtrusion().getDirectionY(),
                this.getExtrusion().getNormal());

        if ((this.startParameter == DEFAULT_START_PARAMETER) &&
                (this.endParameter == DEFAULT_END_PARAMETER) && (alpha == 0.0)) {
            double length = this.getHalfMajorAxisLength();

            bounds.addToBounds(plane.getPoint(length, length));
            bounds.addToBounds(plane.getPoint(-length, -length));
        } else {
            int n = 40;

            // we walking over the the ellipse or elliptical arc
            double h = (this.endParameter - this.startParameter) / n;

            double start = this.startParameter;
            //double major = this.getHalfMajorAxisLength();
            //double minor = major * this.ratio;

            Vector minorAxis = MathUtils.crossProduct(this.getExtrusion()
                                                          .getNormal(),
                    this.getMajorAxisDirection());
            minorAxis = MathUtils.scaleVector(minorAxis, this.ratio);

            for (int i = 0; i <= n; i++) {
                Vector v1 = MathUtils.scaleVector(this.getMajorAxisDirection(),
                        Math.cos(start));
                Vector v2 = MathUtils.scaleVector(minorAxis, Math.sin(start));

                //        double x = major * Math.cos(start);
                //        double y = minor * Math.sin(start);
                double x = v1.getX() + v2.getX();
                double y = v1.getY() + v2.getY();

                //        if (alpha != 0.0) {
                //          double lx = x;
                //          x = lx * Math.cos(alpha) - y * Math.sin(alpha);
                //          y = lx * Math.sin(alpha) + y * Math.cos(alpha);
                //        }
                Point p = plane.getPoint(x, y);

                bounds.addToBounds(p);

                start += h;
            }
View Full Code Here

Examples of org.kabeja.math.ParametricPlane

     * on the ellipse.
     * @param para in double (between 0.0 and 2*PI)
     * @return the point of the ellipse in world coordinates
     */
    public Point getPointAt(double para) {
        ParametricPlane plane = new ParametricPlane(this.center,
                this.getExtrusion().getDirectionX(),
                this.getExtrusion().getDirectionY(),
                this.getExtrusion().getNormal());
        Vector minorAxis = MathUtils.crossProduct(this.getExtrusion().getNormal(),
                this.getMajorAxisDirection());
        minorAxis = MathUtils.scaleVector(minorAxis, this.ratio);

        Vector v1 = MathUtils.scaleVector(this.getMajorAxisDirection(),
                Math.cos(para));
        Vector v2 = MathUtils.scaleVector(minorAxis, Math.sin(para));
        double x = v1.getX() + v2.getX();
        double y = v1.getY() + v2.getY();
        Point p = plane.getPoint(x, y);

        return p;
    }
View Full Code Here

Examples of org.kabeja.math.ParametricPlane

        Point start = this.getStartPoint();
        Point end = this.getEndPoint();
        bounds.addToBounds(start);
        bounds.addToBounds(end);

        ParametricPlane plane = new ParametricPlane(this.getExtrusion());
        Point center = plane.getPoint(this.center.getX(), this.center.getY());
        int startQ = MathUtils.getQuadrant(start, center);
        int endQ = MathUtils.getQuadrant(end, center);

        if (endQ < startQ) {
            endQ += 4;
View Full Code Here

Examples of org.kabeja.math.ParametricPlane

        // the local part
        double x = this.radius * Math.cos(Math.toRadians(angle));
        double y = radius * Math.sin(Math.toRadians(angle));

        // the wcs part
        ParametricPlane plane = new ParametricPlane(this.getExtrusion());
        Point p = plane.getPoint(x + this.center.getX(), y +
                this.center.getY());

        return p;
    }
View Full Code Here

Examples of org.kabeja.math.ParametricPlane

        return center;
    }

    public Bounds getBounds() {
        Bounds bounds = new Bounds();
        ParametricPlane plane = new ParametricPlane(this.getExtrusion());
        Point p = plane.getPoint(this.center.getX(), this.center.getY());
        bounds.setMaximumX(p.getX() + radius);
        bounds.setMinimumX(p.getX() - radius);
        bounds.setMaximumY(p.getY() + radius);
        bounds.setMinimumY(p.getY() - radius);
View Full Code Here

Examples of org.kabeja.math.ParametricPlane

        // the local part
        double x = this.radius * Math.cos(Math.toRadians(angle));
        double y = radius * Math.sin(Math.toRadians(angle));

        // the wcs part
        ParametricPlane plane = new ParametricPlane(this.getExtrusion());
        Point p = plane.getPoint(x + this.center.getX(), y +
                this.center.getY());

        return p;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.