Package toxi.geom

Examples of toxi.geom.Line3D$LineIntersection


    // sample curve
    return s.computeVertices(20);
  }

  public List<Vec3D> getHalfCircle(Vec3D p1, Vec3D p2, float weight, boolean upside) {
    Line3D line = new Line3D(p1, p2);
    Vec3D midPoint = line.getMidPoint();

    float dist = line.getLength();
    float startAngle = p1.sub(p2).headingXY();

    float radius = dist / 2;
    List<Vec3D> vertices = new ArrayList<Vec3D>();
    float step = PApplet.PI / NUM_STEPS;
View Full Code Here


    public void testClosestPoint() {
        Vec3D a = new Vec3D();
        Vec3D b = new Vec3D(100, 0, 0);
        Vec3D c = new Vec3D(50, 50, 0);
        Line3D line = new Line3D(a, b);
        Vec3D isec = line.closestPointTo(c);
        assertEquals(MathUtils.abs(isec.x - c.x) < 0.5, true);
        c = new Vec3D(-50, -50, 0);
        isec = line.closestPointTo(c);
        assertEquals(isec.equals(a), true);
    }
View Full Code Here

        isec = line.closestPointTo(c);
        assertEquals(isec.equals(a), true);
    }

    public void testHashing() {
        Line3D l1 = new Line3D(new Vec3D(100, 420, -50), new Vec3D(-888, 230,
                2999));
        Line3D l2 = new Line3D(new Vec3D(-888, 230, 2999), new Vec3D(100, 420,
                -50));
        assertTrue(l1.equals(l2));
        assertEquals(l1.hashCode(), l2.hashCode());
        l2.a = new Vec3D();
        assertFalse(l1.equals(l2));
        l1.b.clear();
        assertTrue(l1.equals(l2));
        HashMap<Line3D, WingedEdge> map = new HashMap<Line3D, WingedEdge>();
View Full Code Here

TOP

Related Classes of toxi.geom.Line3D$LineIntersection

Copyright © 2018 www.massapicom. 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.