Skip to content

PGS 1.3.0

Compare
Choose a tag to compare
@micycle1 micycle1 released this 20 Oct 15:46
· 95 commits to master since this release

Added

Classes

  • PGS_Hull — a dedicated class for convex and concave hulls of polygons and point sets.
  • PGS_SegmentSet — a class that generates random sets of non-intersecting line segments.

Methods

  • equalPartition() to PGS_Processing. Partitions a shape into N approximately equal area polygons.
  • trapezoidPartition() to PGS_Processing. Partitions a shape into axis-aligned trazepoids.
  • fromChildren() to PGS_Conversion. Creates a single GROUP parent shape from a list of child shapes.
  • WKT and WKB conversion methods to PGS_Conversion. Converts PShapes to and from their Well-Known Text / Well-Known Binary representation.
  • Encoded Polyline conversion methods to PGS_Conversion. Converts PShapes to and from a Google Encoded Polyline representation.
  • GeoJSON conversion methods to PGS_Conversion. Converts PShapes to and from a GeoJSON representation.
  • toJava2D() and fromJava2D() to PGS_Conversion. Converts PShapes to and from Java2D/java.awt shape objects.
  • originScale() to PGS_Transformation. Scales a shape relative to the origin (0, 0).
  • resizeByWidth() and resizeByHeight() to PGS_Transformation. Resizes a shape to a given width/height, whilst resizing the height/width to maintain the original aspect ratio.
  • resizeByMajorAxis() to PGS_Transformation. Resizes a shape (based on the longest axis of its envelope) to a given size.
  • translateEnvelopeTo() and translateCornerTo() to PGS_Transformation. These methods translate a shape based on its envelope.
  • A new mesh-coloring algorithm: GENETIC, which finds a coloring via a genetic algorithm.
  • toGraph() to PGS_Conversion. Converts a shape to a (jGraphT) graph, representing its dual-graph (this method was previously private).
  • fromGraph() to PGS_Conversion. Converts a (jGraphT) graph to a shape, using a Force-Directed placement algorithm.
  • sphericity(), elongation() and maximumInteriorAngle() to PGS_ShapePredicates.
  • findContainingShape() to PGS_ShapePredicates. Finds the child shape in a GROUP shape that contains a query point.
  • overlap() to PGS_ShapePredicates. Measures the degree of mutual overlap between two shapes.
  • equalsExact(), equalsNorm() and equalsTopo() to PGS_ShapePredicates. These methods test for equality between two shapes according to different criteria.
  • createRectangularSpiral() to PGS_Construction. Creates a rectangular-shaped spiral.
  • createBlobbie() to PGS_Construction. Creates a "blob"-like shape.
  • largestEmptyCircle() to PGS_Optimisation. Finds the largest empty circle in a set of obstacle geometries.
  • hilbertSort() to PGS_PointSet. Sorts a list of points according to their location on a Hilbert curve.
  • tangentAngle() to PGS_Processing. Finds the angle a the line tangent to a shape at a certain point on its perimeter.
  • variableBuffer() to PGS_Morphology. Buffers a shape with a buffer whose distance varies along the shape's perimeter.
  • toGraph() and toDualGraph() to PGS_Triangulation. Converts a triangulation mesh to a direct, or dual, (jGraphT) graph representation.
  • chordalAxis() to PGS_Contour. Finds the chordal axis (a type of skeleton) of a shape.
  • tangencyPack() to PGS_CirclePacking. Generates a circle packing having a pattern of tangencies specified by a triangulation.
  • Added methods for Hilbert Curve, Sierpinski Carpet, Koch Snowflake and Sierpinski Tri-Curves to PGS_Construction.
  • poissonN() to PGS_PointSet. Produces as Poisson distribution having exactly N points.
  • removeHiddenLines() to PGS_Processing. Removes hidden lines from a set of overlapping/occluded polygons.
  • relativeNeighborFaces() to PGS_Meshing. Finds the relative neighbour faces of a triangulation.
  • spannerFaces() to PGS_Meshing. Finds the relative neighbour faces of a greedy sparse spanner of a triangulation.
  • minimumSpanningTree() to PGS_PointSet. Finds the Euclidean minimum spanning tree of a set of points.
  • repulsionPack() to PGS_CirclePacking. Generates a circle packing of a shape via iterative pair-repulsion.
  • simplifyDCE() to PGS_Morphology. Simplifies a shape using Discrete Curve Evolution.
  • compoundVoronoi() to PGS_Voronoi. Creates a Voronoi diagram for a set of disjoint shapes.
  • Additional method signature for buffer() that accepts a buffer style parameter.
  • Additional method signature for offsetCurvesInward() that accepts a curves number parameter.
  • intersectMesh() and subtractMesh() to PGS_ShapeBoolean. Performs the associated boolean operations on mesh-like shapes, preserving individual faces during the operation (rather than dissolving remaining elements).
  • dilationErosion() to PGS_Morphology. Applies a positive followed by a negative buffer (in a single operation).
  • eliminateSlivers() to PGS_Processing. Removes narrow areas ("slivers") from a shape.
  • reducePrecision() to PGS_Morphology. Reduces the precision of a shape, whilst ensuring the output shape is valid.
  • distanceField() to PGS_Contour. Generates a contour map based on a distance field of a shape.
  • hatchSubdivision() to PGS_Tiling. Randomly subdivides the plane into equal-width strips having varying lengths.
  • squareTriangleTiling() to PGS_Tiling. Generates a non-periodic tiling, comprising squares and equilateral triangles.
  • cleanCoverage() to PGS_Processing. Removes gaps and overlaps from meshes/polygon collections.
  • sineWarp() to PGS_Morphology. Warps/perturbs a shape by displacing vertices according to a sine wave following the perimeter.
  • hilbertSortFaces() to PGS_Optimisation. Sorts the faces of a GROUP shape according to hilbert curve index of each face's centroid coordinate.

Changed

  • NOTE: Moved all hull methods from PGS_Processing to PGS_Hull.
  • Renamed partition() to convexPartition().
  • PGS_Conversion.fromPShape() (a major method used internally) now applies any shape affine transformations (such as rotate(), scale(), translate()) to the resulting geometry.
  • earCutTriangulation() now uses JTS' implementation which supports inputs with holes.
  • PGS_Morphology.smoothGaussian() now uses a higher default resolution.
  • PGS_Contour.straightSkeleton() now supports multi-polygonal inputs and outputs faces (in addition to bones and branches, as before).
  • PGS_Contour.straightSkeleton() uses a different implementation that is ~50x faster!
  • Renamed maximumInscribedRectangle() to maximumInscribedAARectangle() ("axis-aligned").
  • PGS_Optimisation.maximumInscribedRectangle() now finds the maximum-area inscribed rectangle of arbitrary orientation.
  • PGS_Transformation.touchScale() now scales shapes that are contained within a larger shape.
  • Reimplemented PGS_CirclePacking.maximumInstribedPack(). New algorithm is perfectly accurate and is ~10x faster!
  • PGS_Conversion.fromPVector() now outputs an unclosed path shape if the input vertices are unclosed (rather than always treating the input as a closed polygon).
  • PGS_Transformation.resize() now resizes a shape with respect to its center.
  • PGS_Morphology.smoothGaussian() now supports polygons with holes.
  • Reimplemented PGS_PointSet.poisson(). New algorithm is faster and produces better quality point set outputs.
  • Styling methods in PGS_Conversion() (such as setAllFillColor()) now return the (mutated) input (rather than being public void), to help method chaining.
  • GROUP PShapes having different child types (paths and polygons for instance) are now fully preserved during PShape<->Geometry conversion.
  • snapHull() now uses a JTS-based implementation which improves the range of output and meaningfulness of the snap parameter (now 0...1).
  • All methods in PGS_ShapePredicates() now output double.

Fixed

  • NPE when shapes created with createShape() in the P2D renderer were passed to fromPShape() (#55).
  • slice() would sometimes fail to return some rectangular slices on a concave input (and it's more robust too now).
  • Error if a GROUP shape was passed to point(s)OnExterior() methods.
  • Triangulation methods now respect holes on shapes whose vertices wind opposite to convention (such as letter shapes created from PFonts).
  • fromPShape() now properly converts singular shapes consisting of multiple contours that in turn represent multiple polygons (#67). (Note boolean flag HANDLE_MULTICONTOUR should be toggled to enabled this feature).
  • Conversion error with shapes created via createShape(TRIANGLE).
  • edgeCollapse and centroid quadrangulation methods now respect shape/triangulation holes.

Removed

  • earCutTriangulation(List<PVector> points) from PGS_Triangulation.
  • isolinesFromGrid() from PGS_Contour (dependency too large).
  • voronoiCirclesDiagram() from PGS_Voronoi (achieved by compoundVoronoi()).
  • voronoiCells() from PGS_Voronoi (replaced by innerVoronoi()).
  • voronoiDiagram(IncrementalTin tin) from PGS_Voronoi.

Bonus: the size of the .jar has been reduced a lot by removing a couple of dependencies that had many transitive dependencies!