Releases: TwoRingSoft/FastMath
Releases · TwoRingSoft/FastMath
[2.1.0] 2018-09-23
Added
- Add function to
LocationGraphNodeto assign a "color" to each leaf node (in the form of anIntvalue) such that the resulting triangulation is 4-colored: no two triangles adjacent on a common edge have the same color. - New unit tests for delaunay triangulation.
Fixed
- Various debugging improvements for Delaunay triangulation, like how edges and triangles created due to edge flips are named, and test Swift generation for Triangles.
[2.0.0] 2018-09-12
Changed
- Removed function to sort a
Set<Vertex>into counterclockwise order. - Converted IUO properties to nonoptional properties appropriately set before on init.
Edge.a/.b,Triangle.a/.b/.candVertex.x/.y. - Renamed a function to correctly capitalize a word:
assignNewtriangleNeighborsbecomesassignNewTriangleNeighbors. LocationGraphNode.getTriangles()is no longer optional. It will just return an empty set if no leaf nodes are found.
Added
Edge,TriangleandVertexmay now optionally have a name specified, or have one generated automatically on init. Helps read logs.- Show recursion depth in logs from recursive functions.
- Bunches of comments and diagrams documenting innards of
DelaunayTriangulator. - Add a function to
Triangleto output Swift code to reconstruct it, for e.g. unit tests. - Add functions for
Set<Triangle>to returnSet<Vertex>and aStringdescription of a sorted list of brief descriptions of all containedTriangles. - Typealiases for
DegreeandRadian. enums:TrigonometricRatiodefiningcos,sinetc and some helper functions.Quadrantdefining the four parts of the Cartesian plane and some query functions.
structs:PolarCoordinate2D.CartesianCoordinate2D.Angle(with anAngleOrientationenumthat needs to be reconciled withPlanarOrientation).
- A function to compute distance between two
CGPoints.
Fixed
- In
DelaunayTriangulator:- After an edge flip, not all of the necessary edges of the new pair of neighboring triangles received propagated legality testing. For two
Triangles adjacent on a commonEdge, the remaining fourEdgesbetween them are now used to propagate edge legalization. - During edge legality testing, an
Edgeand anotherVertexare used to construct aTrianglewhose circumscribed circle is queried to contain anotherVertex(call itxhere). Previously, the endpoints of theEdgewere treated specially for ghost points, and if none were there, execution proceeded directly to the incircle test. Ifxis a ghost point, the calculation is nonsensical. Inserted a new check to see ifxis a ghost point before proceeding to the actual incircle test.
- After an edge flip, not all of the necessary edges of the new pair of neighboring triangles received propagated legality testing. For two
- Querying
LocationGraphNodefor all leafTriangleinstances would leave all its nodes'visitedproperty set totrue, so subsequent queries would return the empty set. Reset all nodes'visitedproperty tofalsebefore returning the results of the query ingetTriangles(). - Comparisons of
Trianglenow consider equality between sets of itsVertexinstances, instead of sets of itsEdges.