创建对象 TriangulatedMesh 时出错
Error when creating an object TriangulatedMesh
我想创建一个字母 T
形式的图形
当我用这些点创建一个对象时,异常下降
有人遇到过这个吗?
我用FXyz3D
final List<Point3D> points = new ArrayList<>(//I am trying to create an array of points (x, y, 0)
Arrays.asList(
new Point3D(0,150,0),
new Point3D(0, 90,0),
new Point3D(10,90,0),
new Point3D(30,90,0),
new Point3D(40,90,0),
new Point3D(10,0,0),
new Point3D(30,0,0),
new Point3D(40,150,0))
);
TriangulatedMesh customShape = new
TriangulatedMesh(points,20);//Exception falls on this place
这是我运行程序
时的控制台输出
我不明白是什么问题
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: Intersecting Constraints
at org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:657)
at org.poly2tri.triangulation.delaunay.sweep.DTSweep.edgeEvent(DTSweep.java:631)
at org.poly2tri.triangulation.delaunay.sweep.DTSweep.edgeEvent(DTSweep.java:626)
at org.poly2tri.triangulation.delaunay.sweep.DTSweep.edgeEvent(DTSweep.java:348)
at org.poly2tri.triangulation.delaunay.sweep.DTSweep.sweep(DTSweep.java:110)
at org.poly2tri.triangulation.delaunay.sweep.DTSweep.triangulate(DTSweep.java:72)
at org.poly2tri.Poly2Tri.triangulate(Poly2Tri.java:108)
at org.poly2tri.Poly2Tri.triangulate(Poly2Tri.java:60)
at org.fxyz3d.shapes.primitives.TriangulatedMesh.createMesh(TriangulatedMesh.java:285)
at org.fxyz3d.shapes.primitives.TriangulatedMesh.createMesh(TriangulatedMesh.java:218)
at org.fxyz3d.shapes.primitives.TriangulatedMesh.updateMesh(TriangulatedMesh.java:112)
at org.fxyz3d.shapes.primitives.TriangulatedMesh.<init>(TriangulatedMesh.java:103)
at org.fxyz3d.shapes.primitives.TriangulatedMesh.<init>(TriangulatedMesh.java:93)
at org.fxyz3d.shapes.primitives.TriangulatedMesh.<init>(TriangulatedMesh.java:90)
at org.fxyz3d.shapes.primitives.TriangulatedMesh.<init>(TriangulatedMesh.java:82)
at sampleFxyz3D.Sample.start(Sample.java:89)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop(GtkApplication.java:277)
... 1 more
Exception running application sampleFxyz3D.Sample
final List<Point3D> points = new ArrayList<>(Arrays.asList(
new Point3D(0, 90,0),
new Point3D(0,150,0),
new Point3D(40,150,0),
new Point3D(40,90,0),
new Point3D(30,90,0),
new Point3D(30,0,0),
new Point3D(10,0,0),
new Point3D(10,90,0)
)
);
重要的是要对点进行排序以形成闭合多边形。
形式的图形
当我用这些点创建一个对象时,异常下降
有人遇到过这个吗?
我用FXyz3D
final List<Point3D> points = new ArrayList<>(//I am trying to create an array of points (x, y, 0)
Arrays.asList(
new Point3D(0,150,0),
new Point3D(0, 90,0),
new Point3D(10,90,0),
new Point3D(30,90,0),
new Point3D(40,90,0),
new Point3D(10,0,0),
new Point3D(30,0,0),
new Point3D(40,150,0))
);
TriangulatedMesh customShape = new
TriangulatedMesh(points,20);//Exception falls on this place
这是我运行程序
我不明白是什么问题
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: Intersecting Constraints
at org.poly2tri.triangulation.delaunay.sweep.DTSweep.flipEdgeEvent(DTSweep.java:657)
at org.poly2tri.triangulation.delaunay.sweep.DTSweep.edgeEvent(DTSweep.java:631)
at org.poly2tri.triangulation.delaunay.sweep.DTSweep.edgeEvent(DTSweep.java:626)
at org.poly2tri.triangulation.delaunay.sweep.DTSweep.edgeEvent(DTSweep.java:348)
at org.poly2tri.triangulation.delaunay.sweep.DTSweep.sweep(DTSweep.java:110)
at org.poly2tri.triangulation.delaunay.sweep.DTSweep.triangulate(DTSweep.java:72)
at org.poly2tri.Poly2Tri.triangulate(Poly2Tri.java:108)
at org.poly2tri.Poly2Tri.triangulate(Poly2Tri.java:60)
at org.fxyz3d.shapes.primitives.TriangulatedMesh.createMesh(TriangulatedMesh.java:285)
at org.fxyz3d.shapes.primitives.TriangulatedMesh.createMesh(TriangulatedMesh.java:218)
at org.fxyz3d.shapes.primitives.TriangulatedMesh.updateMesh(TriangulatedMesh.java:112)
at org.fxyz3d.shapes.primitives.TriangulatedMesh.<init>(TriangulatedMesh.java:103)
at org.fxyz3d.shapes.primitives.TriangulatedMesh.<init>(TriangulatedMesh.java:93)
at org.fxyz3d.shapes.primitives.TriangulatedMesh.<init>(TriangulatedMesh.java:90)
at org.fxyz3d.shapes.primitives.TriangulatedMesh.<init>(TriangulatedMesh.java:82)
at sampleFxyz3D.Sample.start(Sample.java:89)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop(GtkApplication.java:277)
... 1 more
Exception running application sampleFxyz3D.Sample
final List<Point3D> points = new ArrayList<>(Arrays.asList(
new Point3D(0, 90,0),
new Point3D(0,150,0),
new Point3D(40,150,0),
new Point3D(40,90,0),
new Point3D(30,90,0),
new Point3D(30,0,0),
new Point3D(10,0,0),
new Point3D(10,90,0)
)
);
重要的是要对点进行排序以形成闭合多边形。