Apache Commons Geometry用于几何处理的通用 Java 库
Apache Commons Geometry 是一个用于几何处理的通用 Java 库。该项目的主要目标是提供一组几何类型和实用程序:
- 在数学上是正确的
- 数值上是准确的
- 易于使用
- 优良性能
该代码起源于 commons-math 项目的 org.apache.commons.math3.geometry 包, 但为了更好的可维护性被拉到一个单独的项目中。从那以后,它经历了许多改进,包括对核心接口和类的重大重构。
该库的主要特点包括:
- 支持一、二、三维的欧几里得空间
- 支持一维和二维的球面空间
- 支持无限大小的几何元素
- 支持对区域的布尔运算(并集、交集、差集、xor)
- 支持读写常见的几何数据格式,如 STL 和 OBJ
- 单一的外部依赖(common-numbers)
下面的代码通过计算一个立方体和一个球体的近似值的差值,并使用 OBJ 数据格式将结果写入文件,给出了一个 API 的小样本。
// construct a precision instance to handle floating-point comparisons Precision.DoubleEquivalence precision = Precision.doubleEquivalenceOfEpsilon(1e-6); // create a BSP tree representing the unit cube RegionBSPTree3D tree = Parallelepiped.unitCube(precision).toTree(); // create a sphere centered on the origin Sphere sphere = Sphere.from(Vector3D.ZERO, 0.65, precision); // subtract a BSP tree approximation of the sphere containing 512 facets // from the cube, modifying the cube tree in place tree.difference(sphere.toTree(3)); // compute some properties of the resulting region double size = tree.getSize(); // 0.11509505362599505 Vector3D centroid = tree.getCentroid(); // (0, 0, 0) // convert to a triangle mesh TriangleMesh mesh = tree.toTriangleMesh(precision); // save as an OBJ file IO3D.write(mesh, Paths.get("target/cube-minus-sphere.obj"));
评论
Apache Commons ImagingJava 图像处理库
Apache Commons Imaging,以前被称为 Apache Commons Sansel
Apache Commons ImagingJava 图像处理库
0
Apache Commons ImagingJava 图像处理库
ApacheCommonsImaging,以前被称为ApacheCommonsSanselan,是一个可以读写各种图像格式的库,包括快速解析图像信息(大小、色彩空间、ICC配置文件等)和元数据。这个库
Apache Commons ImagingJava 图像处理库
0
Apache Commons SCXMLSCXML的Java实现
ApacheCommonsSCXML是SCXML引擎的Java实现版,最新发布的版本是0.9,但是功能基本上已经覆盖了SCXMLW3C规范的全部内容。
Apache Commons SCXMLSCXML的Java实现
0
Apache Commons SCXMLSCXML的Java实现
Apache Commons SCXML是 SCXML 引擎的 Java 实现版,最新发布的版本是
Apache Commons SCXMLSCXML的Java实现
0
Java Geometry Expert几何专家
《几何专家》提供了几何动态图形变换与板块操作,可以自动证明定理,并产生简单、漂亮的证明过程,还可以自动发现几何图形的丰富性质。自从吴文俊教授七十年代末提出几何定理自动证明的吴方法以来,中国学者在这方面
Java Geometry Expert几何专家
0
DirectXMesh几何处理库
DirectXMesh是微软开发的DirectX的几何处理库。示例代码:std::unique_ptr<WaveFrontReader<uint16_t>> mesh( new
DirectXMesh几何处理库
0