Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Processing Geometry Suite

NotificationsYou must be signed in to change notification settings

micycle1/PGS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lines of Code

Processing Geometry Suite

Processing Geometry Suite is a software project that provides easy access to 2D geometric algorithms in the form of aProcessing library. Over time it has grown to include an incredibly comprehensive range of algorithms.

The focus of the library is on visualisation rather than providing underlying data structures. To this end all methods in the library are static and most of them take in and returnPShapes orPVectors.

Docs are hosted viaGitHub Pageshere.

Overview

Library functionality is split over the following classes:

  • PGS_CirclePacking
    • Circle packings of shapes, subject to varying constraints and patterns of tangencies.
  • PGS_Coloring
    • Minimal colorings of meshes (or mesh-like shapes).
  • PGS_Construction
    • Construct uncommon/interesting 2D primitives.
  • PGS_Contour
    • Methods that produce various contours from shapes: medial axes, straight skeletons, offset curves, etc.
  • PGS_Conversion
    • Conversion betweenProcessing PShapes andJTS Geometries (amongst other formats)
  • PGS_Hull
    • Convex and concave hulls of polygons and point sets.
  • PGS_Meshing
    • Mesh generation (excluding triangulation) and processing.
  • PGS_Morphology
    • Methods that affect the geometry or topology of shapes (buffering, simplification, smoothing, etc.).
  • PGS_Optimisation
    • Solve geometric optimisation problems, such as finding the maximum inscribed circle, or the closest vertex to a coordinate.
  • PGS_PointSet
    • Generates sets of 2D points having a variety of different distributions and constraints.
  • PGS_Processing
    • Methods that process a shape in some way: partition, slice, clean, etc.
  • PGS_SegmentSet
    • Generates sets of random non-intersecting line segments.
  • PGS_ShapeBoolean
    • Boolean set-operations for 2D shapes.
  • PGS_ShapePredicates
    • Various shape metrics (area, circularity, etc.) and predicates ("do these shapes intersect?").
  • PGS_Tiling
    • Tiling, tessellation and subdivision of the plane using periodic or non-periodic geometric shapes.
  • PGS_Transformation
    • Various geometric and affine transformations that affect vertex coordinates.
  • PGS_Triangulation
    • Delaunay triangulation (constrained and refined) and earcut triangulation of shapes and point sets.
  • PGS_Voronoi
    • Voronoi Diagrams of shapes and point sets.

Installation

Processing

PGS is available on Processing's contribution manager as "Geometry Suite for Processing".

image

Maven/Gradle

PGS is hosted as an artifact for use in Maven or Gradle projects viaJitpack — follow the instructions there (very easy).

Examples

A number of example Processing sketches are provided inexamples.

Illustrations

Much of the functionality (but by no means all) is demonstrated below:

2D Boolean Operations

UnionIntersectionSubtractionSymmetric Difference
ComplementMesh UnionMesh IntersectionMesh Subtraction

Transformation

Rotate AroundTranslate ToTouch Scale
Rotate a shape around its centroid or an arbitrary point.Translate a shape such that its centroid matches some position.Scale one shape such that it touches another.
ResizeHomothetic TransformationShearAlign
Projection-transform a shape with respect to a fixed point.Maximum-overlap alignment.

Geometric Predicates & Metrics

IntersectsContains ShapeContains PointContaining Cell

Do shapes intersect with each other?

Does one shape fully contain another?

For individual points and point sets.

Which cell contains the query point?

Metrics

  • Length/perimeter
  • Width & Height
  • Diameter
  • Circularity
  • Similarity
  • Sphericity
  • Elongation
  • Density
  • Holes
  • Maximum interior angle
  • Is simple?
  • Is convex?
  • Equal? (structural and topological equivalence)
  • Distance
  • Area
  • Centroid
  • Median

Contour

IsolinesOffset Curves
Isolines from intra-shape euclidean distance, or point sets.Inner and exterior offset curves; based onmiter, bevel orround offset styles.
Straight SkeletonMedial AxisChordal Axis
Medial axis transform with feature pruning via distance, area oraxial angle.Chordal Axis Transform
Distance FieldCenter Line
A contour map based on a distance field of a shape

Morphology

BufferErosion-DilationMinkowski Addition
A negative followed by a positive buffer (in a single operation).Minkowski sum and difference (a.k.a buffer one shape using another shape; the examples add a rotating & growing triangle).
SmoothingGaussian SmoothingRounding
Radial WarpSine WarpField Warp
SimplificationChaikin CuttingInterpolation
Variable BufferPrecision ReductionHobby Curve SimplificationElliptic Fourier Smoothing
Pinch Warp

Hull

Concave HullConvex Hull of Polygons
Concave hull of point sets via breadth-first or depth-first approaches.
Convex HullSnap Hull
A variable-convexity hull.

Geometry Processing

Points on PerimeterPoint on PerimeterPerimeter Extraction
FindN points (evenly distributed) along the perimeter of a shape, or points everyD distance (with optional perpendicular offset).Find a point some fraction along the perimeter of a shape (with perpendicular offset).
SplittingConvex PartitioningEqual PartitioningTrapezoid Partitioning
Subdivide (recursively) a shape into quadrants.Partition a shape into convex polygons.Partition a shape into N equal area polygons.
SlicingConstrained Random Point SetSegment Set Intersection
Slice a shape in two along a given line.Generate constrained random point sets where all points lie within a shape.Find all points of intersection between a collection of line segments.
Shape IntersectionPolygonize LinesHidden Line Removal
Find all points of intersection between two shapes.Find the polygonal faces formed by a set of intersecting line segments.Remove linework occulted by shapes (for pen plotting)
DensificationTangent AngleEliminate SliversSegments on Exterior
Extract HolesNest

Triangulation

Delaunay TriangulationEarcut Triangulation
Poisson Delaunay Triangulation
Delaunay triangulation of shapes wheresteiner points generated by poisson disk sampling are inserted.

Voronoi Diagrams

Voronoi Diagram (inner)Voronoi Diagram (compound)
Centroidal RelaxationMultiplicatively Weighted Voronoi

Meshing

Urquhart FacesGabriel FacesTriangulation Dual
Polygon faces of anUrquhart Graph (derived from a triangulation).Polygon faces of aGabriel Graph (derived from a triangulation).
Relative Neighbour FacesSpanner FacesCentroid QuadrangulationEdge Collapse Quadrangulation
Split QuadrangulationSpiral QuadrangulationMesh SmoothingMesh Subdivision
Mesh SimplificationStochastic MergeArea MergeExtract Inner Edges
Extract Inner VerticesFix Breaks

Geometric Optimisation

Maximum Inscribed CircleMinimum Bounding RectangleMaximum Inscribed RectangleMaximum Perimeter Square
Minimum Bounding CircleMinimum Bounding Ellipse
Minimum Bounding TriangleEnvelopeProblem of Apollonius
Largest Empty CircleLargest Empty CirclesClosest Point PairFarthest Point Pair
Closest VertexCircle CoveringVisibility Polygon / Isovist
Bin PackRectangle Bin Pack
Hilbert Sort Faces

Circle Packing

Front ChainTrinscribed
Maximum InscribedStochastic
RepulsionSquare Lattice
Hex LatticeTangency Pack
Obstacle

Coloring

Construction

SupercircleSupershapeStar
Random Convex PolygonHeartRingArc
Linear SpiralFermat SpiralRectangular SpiralHilbert Curve
Sierpinski CarpetSierpinski CurveSierpinski Tri-Curve (TRI)Sierpinski Tri-Curve (TETRA)
Koch SnowflakeBlobbieRSFCTaijitu
ArbelosTeardropSponge
GearSuper Random PolygonRandom Bezier Polygon

Point Sets

RandomGaussianSquare GridHex Grid
PhyllotaxisPoissonHexagonRing
Halton LDSHammersley LDSPlastic LDSJittered Plastic LDS
Sobol LDSN-Rooks LDSThomas ClustersHilbert Sort
EMSTShortest Tour (TSP)ClusterWeighted Median
Distance Prune

Segment Sets

Graph-matchedStochasticNoded
ParallelPolygon Interior Segments

Tiling & Subdivision

Random Quad SubdivisionRandom Rect SubdivisionRandom Triangle SubdivisionHatch Subdivision
Islamic TilingDoyle SpiralHexagon Tiling
Penrose TilingSquare-Triangle Tiling

[8]ページ先頭

©2009-2025 Movatter.jp