[
https://issues.apache.org/jira/browse/GEOMETRY-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16889968#comment-16889968
]
Dirk Bonekämper commented on GEOMETRY-59:
-----------------------------------------
Hi [~mattjuntunen]! Both of our approaches rely on the fact that a facet is a
simple polygon in a plane. In a plane, the polygon has a well defined
orientation. We both try to ensure that plane representing the facet has the
same orientation as the facet.
You do it by first computing a normal to the plane. Then you compute the signed
area of the polygon, where the sign represents the orientation. Then you flip
the normal if necessary and construct boundary plane.
I try to select a triplet of facet vertices that are guaranteed to have the
same orientation as the facet, Then I construct the boundary plane using that
triplet.
How do theses approaches compare? Mine might take less computation. (Although
you would really need to measure the difference ...) Your approach is (IMO)
more obvious and thus easier to understand for someone looking at the code.
Btw, I wonder if your algorithm could be simplified by summing the cross
products of all adjacent edges. The resulting vector is perpendicular to the
plane and has a magnitude of twice the signed area. (
[http://mathworld.wolfram.com/PolygonArea.html] )
> unexpected output from PolyhedronsSet::checkPoint
> -------------------------------------------------
>
> Key: GEOMETRY-59
> URL: https://issues.apache.org/jira/browse/GEOMETRY-59
> Project: Apache Commons Geometry
> Issue Type: Bug
> Components: Euclidean 3D
> Reporter: Dirk Bonekämper
> Priority: Major
> Labels: pull-request-available
> Attachments: InsideProblemTest.java
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> In my project I'm working with 3D Regions modeled as prisms. The base
> polygons are mostly concave. I got wrong results and boiled it down to the
> attached unit test. It creates a prism with a concave base. A point that is
> above the prism gets classified as INSIDE.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)