Skip to content

Commit

Permalink
Adding UNCLASSIFIED and COINCIDENT classification types.
Browse files Browse the repository at this point in the history
This is so that geometric intersection can "pre-classify" an
intersection as coincident.
  • Loading branch information
dhermes committed Feb 15, 2018
1 parent a7a6cbd commit 8b1c59d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/bezier/_intersection_helpers.py
Expand Up @@ -403,6 +403,8 @@ class IntersectionClassification(enum.Enum):
Provided as the output values for :func:`.classify_intersection`.
"""

UNCLASSIFIED = -1
"""The intersection has not yet been classified."""
FIRST = 0
"""The first curve is on the interior."""
SECOND = 1
Expand All @@ -417,6 +419,8 @@ class IntersectionClassification(enum.Enum):
"""Intersection at a corner, interiors don't intersect."""
TANGENT_BOTH = 6
"""Tangent intersection, both curves are interior from some perspective."""
COINCIDENT = 7
"""Intersection is actually an endpoint of a coincident segment."""


class Intersection(object): # pylint: disable=too-few-public-methods
Expand Down
6 changes: 5 additions & 1 deletion src/bezier/surface_intersection.f90
Expand Up @@ -33,12 +33,14 @@ module surface_intersection
remove_node, finalize_segment, check_contained
public &
Intersection, CurvedPolygonSegment, &
IntersectionClassification_UNCLASSIFIED, &
IntersectionClassification_FIRST, IntersectionClassification_SECOND, &
IntersectionClassification_OPPOSED, &
IntersectionClassification_TANGENT_FIRST, &
IntersectionClassification_TANGENT_SECOND, &
IntersectionClassification_IGNORED_CORNER, &
IntersectionClassification_TANGENT_BOTH, SurfaceContained_NEITHER, &
IntersectionClassification_TANGENT_BOTH, &
IntersectionClassification_COINCIDENT, SurfaceContained_NEITHER, &
SurfaceContained_FIRST, SurfaceContained_SECOND, newton_refine, &
locate_point, classify_intersection, add_st_vals, &
surfaces_intersection_points, get_next, to_front, add_segment, &
Expand Down Expand Up @@ -73,13 +75,15 @@ module surface_intersection
real(c_double), parameter :: LOCATE_EPS = 0.5_dp**47
integer(c_int), parameter :: MAX_EDGES = 10
! Values of IntersectionClassification enum:
integer(c_int), parameter :: IntersectionClassification_UNCLASSIFIED = -1
integer(c_int), parameter :: IntersectionClassification_FIRST = 0
integer(c_int), parameter :: IntersectionClassification_SECOND = 1
integer(c_int), parameter :: IntersectionClassification_OPPOSED = 2
integer(c_int), parameter :: IntersectionClassification_TANGENT_FIRST = 3
integer(c_int), parameter :: IntersectionClassification_TANGENT_SECOND = 4
integer(c_int), parameter :: IntersectionClassification_IGNORED_CORNER = 5
integer(c_int), parameter :: IntersectionClassification_TANGENT_BOTH = 6
integer(c_int), parameter :: IntersectionClassification_COINCIDENT = 7
! Values of SurfaceContained enum:
integer(c_int), parameter :: SurfaceContained_NEITHER = 0
integer(c_int), parameter :: SurfaceContained_FIRST = 1
Expand Down

0 comments on commit 8b1c59d

Please sign in to comment.