Skip to content

1.3.0#48

Merged
micycle1 merged 109 commits intomasterfrom
dev
Oct 20, 2022
Merged

1.3.0#48
micycle1 merged 109 commits intomasterfrom
dev

Conversation

@micycle1
Copy link
Copy Markdown
Owner

@micycle1 micycle1 commented Jan 16, 2022

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() (PGS_Processing.slice() returns nullpointer exception in P2D render mode #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 (Conversion: handle multi-contour/shape PShapes #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.

micycle1 and others added 12 commits January 5, 2022 12:18
*Total -- 13,929.32kb -> 10,699.55kb (23.19%)

/resources/point_set/removeWithinDistance.gif -- 1,596.90kb -> 292.94kb (81.66%)
/resources/tiling/islamic.png -- 71.85kb -> 23.52kb (67.27%)
/resources/meshing/spiralQuadrangulation.gif -- 82.89kb -> 30.83kb (62.8%)
/resources/geometry_processing/perimeterExtract.gif -- 197.55kb -> 74.82kb (62.12%)
/resources/meshing/quadrangulation.png -- 449.05kb -> 247.77kb (44.82%)
/resources/meshing/ecQuadrangulation.png -- 376.21kb -> 238.42kb (36.62%)
/resources/tiling/rectSubdivision.png -- 9.67kb -> 6.16kb (36.28%)
/resources/tiling/randomSubdivision.png -- 310.30kb -> 198.93kb (35.89%)
/resources/meshing/centroidQuadrangulation.png -- 366.28kb -> 235.57kb (35.69%)
/resources/tiling/triangleSubdivision.png -- 398.42kb -> 258.00kb (35.25%)
/resources/tiling/penrose.png -- 119.07kb -> 77.18kb (35.18%)
/resources/tiling/doyeSpiral2.png -- 358.24kb -> 244.52kb (31.74%)
/resources/examples/voronoiCutout.png -- 433.89kb -> 296.69kb (31.62%)
/resources/geometry_processing/partition.png -- 132.75kb -> 91.95kb (30.73%)
/resources/tiling/hex.png -- 153.51kb -> 111.56kb (27.33%)
/resources/examples/leafColoring.png -- 120.66kb -> 95.29kb (21.03%)
/resources/tiling/doyeSpiral1.png -- 122.03kb -> 98.24kb (19.49%)
/resources/examples/spiralOutline.png -- 189.44kb -> 155.18kb (18.09%)
/resources/morphology/morph.gif -- 1,480.94kb -> 1,255.00kb (15.26%)
/resources/pgs/fermatSpiral.gif -- 3,066.72kb -> 2,930.90kb (4.43%)
/resources/pgs/spiral.gif -- 3,892.92kb -> 3,736.08kb (4.03%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
@micycle1 micycle1 marked this pull request as draft March 23, 2022 16:38
@micycle1 micycle1 linked an issue Oct 9, 2022 that may be closed by this pull request
micycle1 and others added 8 commits October 10, 2022 00:36
*Total -- 4,837.53kb -> 4,242.59kb (12.3%)

/resources/morphology/slivers.gif -- 45.13kb -> 24.70kb (45.26%)
/resources/morphology/snapHull.gif -- 504.86kb -> 338.11kb (33.03%)
/resources/morphology/polyHull.gif -- 1,452.26kb -> 1,199.75kb (17.39%)
/resources/morphology/reducePrecision.gif -- 106.47kb -> 100.33kb (5.77%)
/resources/segment_set/parallel.gif -- 2,728.81kb -> 2,579.70kb (5.46%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
@micycle1 micycle1 changed the title 1.2.1 1.3.0 Oct 10, 2022
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug B 4 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 76 Code Smells

No Coverage information No Coverage information
0.6% 0.6% Duplication

@micycle1 micycle1 marked this pull request as ready for review October 20, 2022 15:16
@micycle1 micycle1 merged commit 7894ca2 into master Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

2 participants