Examples of Triangle


Examples of org.opengis.geometry.coordinate.Triangle

    tDoubleList.add(new double[][]{{0,100},{100,100},{50,200}});
    tDoubleList.add(new double[][]{{50,200},{100,100},{150,200}});
    ArrayList<Triangle> triangleList = tCoordFactory.createTriangles(tDoubleList);
     
    for (int i=0; i < triangleList.size(); i++) {
      Triangle triangle1 = triangleList.get(i);
      //System.out.println(triangle1);
    }
     
      //System.out.println(triangle1.get.getEnvelope());
     
View Full Code Here

Examples of org.opensphere.geometry.triangulation.model.Triangle

      Edge edgeB = this.edges.get(this.segments.get(sB));
      Edge edgeC = this.edges.get(this.segments.get(sC));
      if (edgeA == null || edgeB == null || edgeC == null)
          continue;

      Triangle triangle = new Triangle(i, qet.isBorder()?true:false);
      triangle.addEdge(edgeA);
      triangle.addEdge(edgeB);
      triangle.addEdge(edgeC);

      edgeA.addTriangle(triangle);
      edgeB.addTriangle(triangle);
      edgeC.addTriangle(triangle);

      this.triangles.put(i, triangle);
      i++;
    }

    // add triangle neighbourood
    for (Edge edge : this.edges.values()) {
      if (edge.getTriangles().size() > 1) {
        Triangle tA = edge.getTriangles().get(0);
        Triangle tB = edge.getTriangles().get(1);
        tA.addNeighbour(tB);
        tB.addNeighbour(tA);
      }
    }

   
    // concave hull algorithm
    int index = 0;
    while (index != -1) {
      index = -1;

      Edge e = null;

      // find the max length (smallest id so first entry)
      int si = this.lengths.size();

      if (si != 0) {
        Entry<Integer, Edge> entry = this.lengths.firstEntry();
        int ind = entry.getKey();
        if (entry.getValue().getGeometry().getLength() > this.threshold) {
          index = ind;
          e = entry.getValue();
        }
      }

      if (index != -1) {
        Triangle triangle = e.getTriangles().get(0);
        List<Triangle> neighbours = triangle.getNeighbours();
        // irregular triangle test
        if (neighbours.size() == 1) {
          this.shortLengths.put(e.getId(), e);
          this.lengths.remove(e.getId());
        } else  {
          Edge e0 = triangle.getEdges().get(0);
          Edge e1 = triangle.getEdges().get(1);
          // test if all the vertices are on the border
          if (e0.getOV().isBorder() && e0.getEV().isBorder()
              && e1.getOV().isBorder() && e1.getEV().isBorder()) {
            this.shortLengths.put(e.getId(), e);
            this.lengths.remove(e.getId());
          } else {
            // management of triangles
                  if (neighbours.size() < 1) continue; //not sure this is safe
            Triangle tA = neighbours.get(0);
            Triangle tB = neighbours.get(1);
            tA.setBorder(true); // FIXME not necessarily useful
            tB.setBorder(true); // FIXME not necessarily useful
            this.triangles.remove(triangle.getId());
            tA.removeNeighbour(triangle);
            tB.removeNeighbour(triangle);
           
            // new edges
            List<Edge> ee = triangle.getEdges();
            Edge eA = ee.get(0);
            Edge eB = ee.get(1);
View Full Code Here

Examples of powercrystals.minefactoryreloaded.circuits.wave.Triangle

    MFRRegistry.registerRedNetLogicCircuit(new Scaler());
    MFRRegistry.registerRedNetLogicCircuit(new SchmittTrigger());
    MFRRegistry.registerRedNetLogicCircuit(new Sine());
    MFRRegistry.registerRedNetLogicCircuit(new Square());
    MFRRegistry.registerRedNetLogicCircuit(new Subtractor());
    MFRRegistry.registerRedNetLogicCircuit(new Triangle());
    MFRRegistry.registerRedNetLogicCircuit(new Xnor2());
    MFRRegistry.registerRedNetLogicCircuit(new Xnor3());
    MFRRegistry.registerRedNetLogicCircuit(new Xnor4());
    MFRRegistry.registerRedNetLogicCircuit(new Xor2());
    MFRRegistry.registerRedNetLogicCircuit(new Xor3());
View Full Code Here

Examples of railo.runtime.img.interpolation.Triangle

  
   
    private static Interpolation getInterpolation(int interpolation) throws ExpressionException {
    switch (interpolation) {
   
      case 0return new Triangle();
      case Image.IP_HERMITE:  return new Hermite();
      case Image.IP_HANNING:  return new Hanning();
      case Image.IP_MEDIUMQUALITY:
      case Image.IP_HIGHPERFORMANCE:
      case Image.IP_HAMMING:  return new Hamming();
View Full Code Here

Examples of ru.dubov.primitives.Triangle

    public Triangle removeEar() {
       
        DoublyLinkedCyclicList<Point>.Node adjLeft = ears.head().value.prev;
        DoublyLinkedCyclicList<Point>.Node adjRight = ears.head().value.next;
       
        Triangle ear = new Triangle(adjLeft.value,
                ears.head().value.value, adjRight.value);     

        ears.head().value.delete(); // Delete in vertices
        ears.head().delete(); // Delete in ears
       
View Full Code Here

Examples of ru.dubov.primitives.Triangle

       
        if (! isConvex(node, isClockwise)) {
            return false;
        }
       
        Triangle tr = new Triangle(node.prev.value, node.value, node.next.value);
       
        DoublyLinkedCyclicList<Point>.Node cur = vertices.head();
        do {
            if (tr.pointInside(cur.value)) return false;
            cur = cur.next;
        } while(cur != vertices.head());
       
        return true;
    }
View Full Code Here

Examples of ru.dubov.primitives.Triangle

       
        if(p.size() < 3) {
            return;
        }
        if(p.size() == 3) {
            result.add(new Triangle(p.get(0), p.get(1), p.get(2)));
            return;
        }
       
        boolean diag = true;
        int start = 0, finish = 0;
View Full Code Here

Examples of ru.dubov.primitives.Triangle

       
        while (p.size() > 3) {
           
            int li = -1;
            Point l, v, r;
            Triangle tr;
            boolean isEar;
            int tryings = 0;
           
            do {
                tryings ++;
               
                if (tryings >= p.size()) {
                    // Endless loop; bad input
                    return null;
                }
               
                li ++;
                l = p.get(li % p.size());
                v = p.get((li+1) % p.size());
                r = p.get((li+2) % p.size());
                tr = new Triangle(l, v, r);
               
                isEar = Point.isLeftTurn(l, v, r) ^ isClockwise;
               
                if (isEar) { // Further analysis required
                    for (int i = 0; i < p.size(); i++) {
                        if (tr.pointInside(p.get(i))) {
                            isEar = false;
                            break;
                        }
                    }
                }
               
            } while(! isEar); // Until we've discovered an ear
           
            // Guaranteed that we got an ear here
           
            result.add(tr);
            p.remove((li+1) % p.size());
           
        }
       
        if (p.size() == 3) { // The last triangle
            result.add(new Triangle(p.get(0), p.get(1), p.get(2)));
        }
       
        return result;
    }
View Full Code Here

Examples of ru.dubov.primitives.Triangle

        Stack<Point> S = new Stack<Point>();
        S.push(p0);
        S.push(points.get(0));
       
        Point top, nextToTop;
        Triangle lastAdded = null, temp = null,
                 lastAddedInStack = null, tempInStack = null;
       
        for (int i = 0; i < points.size(); i++) {
           
            if (i < points.size() - 1) {
               
                // Adding new "narrow" triangle with p0 as one of its vertices
                temp = new Triangle(p0, points.get(i), points.get(i+1));
               
                 // Linking the triangles (!)
                temp.link(lastAdded);
               
                result.add(temp);
                lastAdded = temp;
            }
           
            if (i > 0) {
               
                // using the idea of Graham's scan
                // to make the triangulation "convex" (!)
               
                top = S.peek();
                nextToTop = S.elementAt(S.size() - 2);
               
                while (isRightTurn(nextToTop, top, points.get(i))) {
                   
                    tempInStack = new Triangle(nextToTop, top, points.get(i));
                   
                    // Linking the triangles (!)
                    tempInStack.link(lastAddedInStack);
                    int k = 0;
                    for (int j = result.size()-1; j >= 0; j--) {
View Full Code Here

Examples of se.llbit.math.Triangle

    int c0 = (0xF & (data >> 16)) % 8;
    int c1 = (0xF & (data >> 20)) % 8;
    int c2 = (0xF & (data >> 24)) % 8;
    int c3 = (0xF & (data >> 28)) % 8;
    Triangle triangle = t012[c0][c1][c2];
    if (triangle.intersect(ray)) {
      ray.n.set(triangle.n);
      ray.n.scale(QuickMath.signum(-ray.d.dot(triangle.n)));
      ray.t = ray.tNear;
      hit = true;
    }
    triangle = t230[c2][c3][c0];
    if (triangle.intersect(ray)) {
      ray.n.set(triangle.n);
      ray.n.scale(QuickMath.signum(-ray.d.dot(triangle.n)));
      ray.t = ray.tNear;
      ray.u = 1-ray.u;
      ray.v = 1-ray.v;
      hit = true;
    }
    triangle = westt[c0][c3];
    if (triangle.intersect(ray)) {
      ray.n.set(triangle.n);
      ray.n.scale(QuickMath.signum(-ray.d.dot(triangle.n)));
      ray.t = ray.tNear;
      hit = true;
    }
    triangle = westb[c0];
    if (triangle.intersect(ray)) {
      ray.n.set(triangle.n);
      ray.n.scale(QuickMath.signum(-ray.d.dot(triangle.n)));
      ray.t = ray.tNear;
      ray.u = 1-ray.u;
      ray.v = 1-ray.v;
      hit = true;
    }
    triangle = eastt[c1][c2];
    if (triangle.intersect(ray)) {
      ray.n.set(triangle.n);
      ray.n.scale(QuickMath.signum(-ray.d.dot(triangle.n)));
      ray.t = ray.tNear;
      hit = true;
    }
    triangle = eastb[c1];
    if (triangle.intersect(ray)) {
      ray.n.set(triangle.n);
      ray.n.scale(QuickMath.signum(-ray.d.dot(triangle.n)));
      ray.t = ray.tNear;
      ray.u = 1-ray.u;
      ray.v = 1-ray.v;
      hit = true;
    }
    triangle = southt[c0][c1];
    if (triangle.intersect(ray)) {
      ray.n.set(triangle.n);
      ray.n.scale(QuickMath.signum(-ray.d.dot(triangle.n)));
      ray.t = ray.tNear;
      hit = true;
    }
    triangle = southb[c1];
    if (triangle.intersect(ray)) {
      ray.n.set(triangle.n);
      ray.n.scale(QuickMath.signum(-ray.d.dot(triangle.n)));
      ray.t = ray.tNear;
      ray.u = 1-ray.u;
      ray.v = 1-ray.v;
      hit = true;
    }
    triangle = northt[c2][c3];
    if (triangle.intersect(ray)) {
      ray.n.set(triangle.n);
      ray.n.scale(QuickMath.signum(-ray.d.dot(triangle.n)));
      ray.t = ray.tNear;
      hit = true;
    }
    triangle = northb[c2];
    if (triangle.intersect(ray)) {
      ray.n.set(triangle.n);
      ray.n.scale(QuickMath.signum(-ray.d.dot(triangle.n)));
      ray.t = ray.tNear;
      ray.u = 1-ray.u;
      ray.v = 1-ray.v;
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.