2 * Sixth 3D engine. Author: Svjatoslav Agejenko.
3 * This project is released under Creative Commons Zero (CC0) license.
8 package eu.svjatoslav.sixth.e3d.renderer.raster.slicer;
10 import eu.svjatoslav.sixth.e3d.geometry.Point2D;
11 import eu.svjatoslav.sixth.e3d.geometry.Point3D;
13 import java.util.Comparator;
15 public class BorderLine implements Comparator<BorderLine> {
17 public final int count;
18 final PolygonCoordinate c1;
19 final PolygonCoordinate c2;
21 public BorderLine(final PolygonCoordinate c1, final PolygonCoordinate c2,
29 public int compare(final BorderLine o1, final BorderLine o2) {
30 return Double.compare(o1.getLength(), o2.getLength());
33 public double getLength() {
34 return c1.space.getDistanceTo(c2.space);
37 public PolygonCoordinate getMiddlePoint() {
38 return new PolygonCoordinate(new Point3D().computeMiddlePoint(c1.space,
39 c2.space), new Point2D().getMiddle(c1.texture,