-
Notifications
You must be signed in to change notification settings - Fork 21
PGS 2.1 #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
more robust complement()
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Added
smoothLaneRiesenfeldtoPGS_Morphology. Smooths a shape using Lane-Riesenfeld curve subdivision with 4-point refinement to reduce contraction.PGS_Conversion.roundVertexCoords()that accepts a number of decimal places.interiorAngles()toPGS_ShapePredicates. Calculates all interior angles of a polygon.forEachShape()andforEachShapeWithIndex()* toPGS_Processing. Applies a specified transformation function of a desired typeTto each child of the given PShape, returning a list ofT(*additionally with child's index).maximumInscribedTriangle()toPGS_Optimisation. Finds an approximate largest area triangle (of arbitrary orientation) contained within a polygon.closestPoint()toPGS_Optimisation. Finds the closest point in a collection of points to a specified point.distanceTree()toPGS_Contour. Generates a tree structure representing the shortest paths from a start point to all other vertices in a mesh.vertexCount()toPGS_ShapePredicates. Returns the total number of vertices that make up a shape.matchingQuadrangulation()toPGS_Meshing. Converts a triangulation into a quadrangulation, by pairing up triangles and merging them into high-quality quads.filterNear()toPGS_SegmentSet. Removes segments that are near others.spiralSortFaces()toPGS_Optimisation. Reorders the faces of a mesh into an anti-clockwise “spiral” (breadth-first rings) starting from a given face.centroidSortFaces()toPGS_Optimisation. Reorders the faces of a mesh by the x and then y coordinates of their centroids.radialSortFaces()toPGS_Optimisation. Sorts the faces of a mesh radially around a given centre.unionLines()toPGS_ShapeBoolean. Unions the linework of two shapes, creating polygonal faces from their intersecting lines.closestVertex()andfarthestVertex()toPGS_Optimisation. Returns the closest/farthest vertex of a shape to a query point.farthestPoint()toPGS_Optimsation. Finds the farthest point in the collection from a specified point.annularBricks()toPGS_Tiling. Generates a geometric arrangement composed of annular-sector bricks arranged in concentric circular rings.overlapRegions()toPGS_ShapeBoolean. Finds the regions where at least two shapes overlap.normalise()toPGS_Processing. Normalises a shape by standardising its vertex ordering and orientation.boundingBox()toPGS_Hull. Calculates the axis-aligned bounding box (replacesenvelope()inPGS_Optimisation.)farthestPointVoronoi()toPGS_Voronoi. Generates a farthest-point Voronoi diagram for a given set of sites and a bounding box.intersections()toPGS_SegmentSet. Computes all intersection points between two collections of line segments.minimumWidthAnnulus()toPGS_Optimisation. Computes the minimum-width annulus (ring) that encloses the vertices of a shape.minimumBoundingCircle()andmaximumInscribedCircle()that accept a PVector to output the circle center and radius.createRect()toPGS_Construction. Creates a rectangle with uniformly rounded cornersPGS_Meshing.areaMerge()that allows merging faces until the mesh contains exactly a user-specified number of faces.minimumInteriorAngle()toPGS_ShapePredicates. Computes the minimum interior angle of a shape.isolines()having an intervals parameter that specifies the number of contour levels to generate.straightSkeleton()that accepts an integer to control the number of nearest neighboring edges considered during collision detection.contrastField()toPGS_Contour. Generates vector contour lines representing a "contrast field" of a shape with respect to a given reference point.arcDivisiontoPGS_Tiling. Creates a cellular partition of the plane using arcs formed by circles seeded along its boundary.sliceDivisiontoPGS_Tiling. Divides the plane into randomly “sliced” polygonal regions.pointsOnExterior()having a starting point offset parameter that specifies the distance along the perimeter to start sampling points.centroidSplit()toPGS_Processing. Splits the input shape into n wedge-shaped regions by connecting the centroid to points along the perimeter.createHobbyCurve()toPGS_Construction. Creates a Hobby curve from a set of control points.pruneRandomRemoveN()toPGS_PointSet. Randomly removes exactly N points from a list of points.pruneRandomToN()toPGS_PointSet. Randomly prunes a list of points to exactly N points.convexMaximumInscribedCircle()toPGS_Optimisation. Computes the largest inscribed circle of a convex polygon (faster and exact).Changes
PGS_CirclePacking.tangencyPack(). It's now around 1.5-2x faster and has higher precision.PGS_Conversion.roundVertexCoords()now returns a rounded copy of the input (rather than mutating the input).PGS_Conversion.toDualGraph()will now always iterate deterministically on inputs with the same geometry but having a different structure.PGS_Contour.straightSkeleton()now always uses a more robust approach (which has been sped up considerably too).ColoringAlgorithm.RLF(the speed increase grows with input size).PGS_PointSet.findShortestTour()TSP algorithm. It now uses a more effective heuristic that finds shorter tours in less time.PGS_Meshing.extractInnerEdges()no longer dissolves edges in the output.PGS_Morphology.simplifyHobby()is much faster, particularly on shapes with many vertices.PGS_Processing.maximumPerimeterSquare(). It's about 2x faster.sigmainPGS_smoothGaussian()no longer causes "wobblyness" in the output.PGS_Morphology.buffer()that accepts a cap style parameter.PGS_PointSet.squareGrid()now populates the grid with points upto and includingxMaxandyMax(inclusive).PGS_Transformation.touchScale()algorithm. It's now more performant and robust.PGS_Tiling.triangleSubdivision()can now begin from both diagonal axes, not just the top-left to bottom-right diagonal.PGS_Processing.pointsOnExterior()methods now return points on all elements of a shape, not just the perimeter of the first polygon.PGS_Processing.segmentsOnExterior()now return segments on all elements of a shape, not just the perimeter of the first polygon.PGS_Morphologynow process any and all polygon/line elements in a shape:chaikinCut(),smoothGaussian(),simplifyDCE(),simplifyHobby(),smoothEllipticFourier(),round().dissolve()toPGS_Processing. Dissolves the linear components of a shape into a set of unique maximal-length linesFixed
PGS_Morphology.rounding()no longer gives invalid results.PGS_ShapePredicates.elongation()now correctly measures shape elongation (previously inverted, now returns 1 for highly elongated shapes).PGS_Conversion.toGraph()now processesLINESshapes correctly.PGS_Meshing.urquhartFaces()no longer errors on triangulation inputs with no constraints.PGS_Tiling.triangleSubdivision()subdivision is now deterministic acrossmaxDepthfor a given seed.PGS_Tiling.rectSubdivision()subdivision is now deterministic acrossmaxDepthfor a given seed.PGS_Morphology.pinchWarp()now preserves closed polygon inputs.Removed