简体   繁体   English

是否有Java的几何库? (不是JTS)

[英]Is there a geometry library for Java? (not JTS)

I'm hoping for the equivalent of CGAL (in C++)--I want convex partitioning of polygons or at least triangulation. 我希望相当于CGAL(在C ++中) - 我想要多边形的凸分区或至少三角剖分。 It also has to be free. 它也必须是免费的。 A previous question suggested JTS , but it doesn't seem to have those functions. 之前的一个问题提出了JTS ,但它似乎没有这些功能。

JTS supports delaunay triangulation, but not constrained triangulation (holes): JTS支持delaunay三角测量,但不支持三角测量(空洞):
http://lin-ear-th-inking.blogspot.com/2009/04/delaunay-triangulation-in-jts-111.html http://lin-ear-th-inking.blogspot.com/2009/04/delaunay-triangulation-in-jts-111.html

For constrained delaunay triangulation you can use Poly2Tri . 对于受约束的delaunay三角测量,您可以使用Poly2Tri Works quite good, but could not triangulate polygons with holes, where the holes touch the outline or touch another polygon. 工作得很好,但无法对带有孔的多边形进行三角测量,其中孔接触轮廓或触摸另一个多边形。

At the moment I use the OpenGl Tesselator (glut) with the java wrapper jogl ( http://jogamp.org/ ) for triangulation in java. 目前,我使用OpenGl Tesselator(glut)和java wrapper jogl( http://jogamp.org/ )进行java中的三角测量。 You have to implement the correct callbacks and do some fiddling in there. 你必须实现正确的回调并在那里做一些摆弄。

Neither of them satisfies all (my) needs, but until now I haven't found a better one. 它们都不满足所有(我的)需求,但直到现在我还没有找到更好的需求。

CGAL has SWIG driven bindings since 2012. 2D conforming triangulation and meshes is part of it. 自2012年以来,CGAL已经开启了SWIG驱动绑定。符合3D三角测量和网格的2D是其中的一部分。 Please visit the github wiki for furhter info's. 请访问github wiki获取更多信息。

GeoTools has a pretty extensive library of geometry manipulation algorithms, but of course just like JTS it is somewhat GIS-oriented. GeoTools有一个非常广泛的几何操作算法库,但当然就像JTS一样,它有点面向GIS。

http://www.geotools.org/ http://www.geotools.org/

您可以尝试GeoLib ,这是一个出色的几何包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM