[
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17120964#comment-17120964
]
Matt Juntunen commented on GEOMETRY-95:
---------------------------------------
bq. Interesting. Could you expand on that? Or is it in the documentation?
It's better for BSP trees because it is more uniform. With UV-spheres the
boundaries near the equator are large while the one near the poles can get
incredibly small. This means that during construction of the tree, the regions
at the poles are subject to floating point precision issues much earlier than
the ones at the equator. This limits the overall number of facets that can be
produced. The icosphere version does not have this issue because all of the
boundary triangles have the same size. This uniformity also makes it much
easier to produce balanced trees, which equals better performance.
bq. Do you mean that it would it be relatively easy to implement a general
algorithm to implement all the 3D shapes described by the two numbers defined
here?
No. The logic for building the UV-sphere was very complicated because it needed
to create different types of boundary shapes (triangles at the poles and quads
everywhere else) while trying to insert internal cuts in the tree to keep it
balanced. The icosphere version is just a simple recursive algorithm.
bq. Wouldn't it be better to keep the alternatives (e.g. if just to compare
their relative merits, depending on user needs)?
Not in this case, IMHO. UV-spheres may be useful for meshes and texture mapping
but they are not good when it comes to BSP trees. The only case where I can
imagine that someone would need a UV-sphere BSP tree would be if they
immediately wanted to extract the boundaries from the tree and use them in a
mesh or something, in which case constructing the intermediate BSP tree is
simply a waste of time. I would rather keep the API simple and just provide the
best, most robust, and most performant algorithm in the {{Sphere}} class.
> CSG Examples
> ------------
>
> Key: GEOMETRY-95
> URL: https://issues.apache.org/jira/browse/GEOMETRY-95
> Project: Apache Commons Geometry
> Issue Type: New Feature
> Reporter: Matt Juntunen
> Priority: Major
> Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new
> users to the library use these features.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)