Hallo,
Ich möchte mithilfe der Intersect Methode eine Linie in ein Polygon einzeichnen dabei ergibt sich bei mir ein Problem welches ich am besten mal mit dem folgendem Bild darstelle...
die Linie hat auf jeden Fall die richtigen Koordinaten
ich verstehe nicht ganz wie dieses Problem zustande kommt...
Ich hoffe mir kann da jemand helfen.
LG Martin
Ich möchte mithilfe der Intersect Methode eine Linie in ein Polygon einzeichnen dabei ergibt sich bei mir ein Problem welches ich am besten mal mit dem folgendem Bild darstelle...
Java:
package application;
import java.util.ArrayList;
import javafx.scene.layout.Pane;
import javafx.scene.shape.Line;
import javafx.scene.shape.Shape;
public class Triangulation {
private ArrayList<Point> points;
private Shape poly;
private Pane drawPane;
public Triangulation(ArrayList<Point> points, Shape poly, Pane DrawPane){
this.drawPane = DrawPane;
this.poly = poly;
this.points = points;
}
public void triangulate(){
Line line = new Line();
line.setStartX(points.get(0).getXPos());
line.setStartY(points.get(0).getYPos());
line.setEndX(points.get(3).getXPos());
line.setEndY(points.get(3).getYPos());
Shape path = Shape.intersect(poly, line);
drawPane.getChildren().add(path);
}
}
die Linie hat auf jeden Fall die richtigen Koordinaten
ich verstehe nicht ganz wie dieses Problem zustande kommt...
Ich hoffe mir kann da jemand helfen.
LG Martin