对于Java抽象2D几何库 [英] Abstract 2D geometry library for Java

查看:668
本文介绍了对于Java抽象2D几何库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有良好的2D几何体库的Java?我在寻找任何可以用旋转箱工作,可以帮我回答的问题,如:

  • 请这2盒相交?
  • 在这一点里面那个盒子?
  • 什么界限这套箱

等。没有与3D渲染所需的相关。在code是这样的:

  Box中的=新箱(0,0,100,50); //(0,0)尺寸中心(100,50)
盒B =新箱(50,50,50,100);
b.setRotation(45);
箱boundingBox的= Algo.getBoundingBox(A,B);
...
 

解决方案

试试这个: http://www.vividsolutions.com/jts/jtshome.htm

Are there any good 2D geometry libraries for Java? I'm looking for anything that can work with "rotatable boxes" and can help me answering the questions like:

  • Do these 2 boxes intersect?
  • Is this point inside that box?
  • What are the bounds for this set of boxes

etc. Nothing related with rendering required. The code is like:

Box a = new Box(0, 0, 100, 50); // center at (0,0) size is (100,50)
Box b = new Box(50, 50, 50, 100);
b.setRotation(45);
Box boundingBox = Algo.getBoundingBox(a, b);
...

解决方案

Try this one: http://www.vividsolutions.com/jts/jtshome.htm

这篇关于对于Java抽象2D几何库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆