Skip to content

Commit

Permalink
Mark as 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
micycle1 committed Jul 28, 2023
1 parent af901f5 commit 69c9243
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 70 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to PGS will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Dates are *YYYY-MM-DD*.

## **1.3.1** *(2023-06-xx)*
## **1.4.0** *(2023-06-xx)*

### Added
* `sobolLDS()` to `PGS_PointSet`. Generates a set of 2D deterministic stratified points from the Sobol low discrepancy sequence.
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>micycle</groupId>
<artifactId>PGS</artifactId>
<version>1.3.1-SNAPSHOT</version>
<version>1.4.0</version>
<name>Processing Geometry Suite</name>
<description>Geometric algorithms for Processing</description>

Expand Down Expand Up @@ -33,7 +33,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3</version>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand Down Expand Up @@ -247,7 +247,7 @@
<dependency>
<groupId>org.tinspin</groupId>
<artifactId>tinspin-indexes</artifactId>
<version>1.7.1</version>
<version>1.8.0</version>
</dependency>
<dependency> <!-- for test running -->
<groupId>org.junit.jupiter</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/micycle/pgs/PGS_CirclePacking.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private PGS_CirclePacking() {
* @return A list of PVectors, where each PVector represents a circle. The x and
* y components of the PVector represent the center of the circle, and
* the z component represents the radius of the circle.
* @since 1.3.1
* @since 1.4.0
*/
public static List<PVector> obstaclePack(PShape shape, Collection<PVector> pointObstacles, double areaCoverRatio) {
final Geometry geometry = fromPShape(shape);
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/micycle/pgs/PGS_Construction.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public static PShape createArc(double centerX, double centerY, double width, dou
* @param centerY the y-coordinate of the center of the shape
* @param radius the radius of the shape
* @return a PShape representing the Taijitu shape
* @since 1.3.1
* @since 1.4.0
*/
public static PShape createTaijitu(double centerX, double centerY, double radius) {
Coordinate center = new Coordinate(centerX, centerY);
Expand Down Expand Up @@ -289,7 +289,7 @@ public static PShape createTaijitu(double centerX, double centerY, double radius
* @param radius radius of the largest (enclosing) circle
* @param notchPosition the fractional position, between 0 and 1, along the
* diameter where the notch will be
* @since 1.3.1
* @since 1.4.0
* @return a PShape representing the Arbelos shape
*/
public static PShape createArbelos(double centerX, double centerY, double radius, double notchPosition) {
Expand Down Expand Up @@ -426,7 +426,7 @@ public static PShape createHeart(final double centerX, final double centerY, fin
* @param height height of the teardrop
* @param m order of the curve. Values of [2...5] give good results
* @return
* @since 1.3.1
* @since 1.4.0
*/
public static PShape createTeardrop(final double centerX, final double centerY, double height, final double m) {
// https://mathworld.wolfram.com/TeardropCurve.html
Expand Down Expand Up @@ -457,7 +457,7 @@ public static PShape createTeardrop(final double centerX, final double centerY,
* @param radius maximum radius of gear teeth
* @param n number of gear teeth
* @return the gear shape
* @since 1.3.1
* @since 1.4.0
*/
public static PShape createGear(final double centerX, final double centerY, final double radius, final int n) {
// https://mathworld.wolfram.com/GearCurve.html
Expand Down Expand Up @@ -562,7 +562,7 @@ public static PShape createRing(double centerX, double centerY, double outerRadi
* shapes).
* @param seed the seed for the random number generator
* @return the sponge shape
* @since 1.3.1
* @since 1.4.0
*/
public static PShape createSponge(double width, double height, int generators, double thickness, double smoothing, int classes,
long seed) {
Expand Down Expand Up @@ -761,7 +761,7 @@ public static PShape createRectangularSpiral(float x, float y, float width, floa
* @param cellHeight visual/pixel width of each cell
* @return a stroked PATH PShape
* @see #createRandomSFCurve(int, int, double, double, long)
* @since 1.3.1
* @since 1.4.0
*/
public static PShape createRandomSFCurve(int nColumns, int nRows, double cellWidth, double cellHeight) {
return createRandomSFCurve(nColumns, nRows, cellWidth, cellHeight, System.nanoTime());
Expand All @@ -780,7 +780,7 @@ public static PShape createRandomSFCurve(int nColumns, int nRows, double cellWid
* @param seed random seed
* @return a stroked PATH PShape
* @see #createRandomSFCurve(int, int, double, double)
* @since 1.3.1
* @since 1.4.0
*/
public static PShape createRandomSFCurve(int nColumns, int nRows, double cellWidth, double cellHeight, long seed) {
RandomSpaceFillingCurve factory = new RandomSpaceFillingCurve(nColumns, nRows, seed);
Expand Down Expand Up @@ -822,7 +822,7 @@ public static PShape createRandomSFCurve(int nColumns, int nRows, double cellWid
* recommended. This is akin to increasing the depth of
* fractal curve.
* @param seed the seed for the random number generator
* @since 1.3.1
* @since 1.4.0
*/
public static PShape createSuperRandomPolygon(double dimensions, int cells, double markFraction, int smoothing, int depth,
boolean orthogonal, boolean holes, long seed) {
Expand Down Expand Up @@ -857,7 +857,7 @@ public static PShape createSuperRandomPolygon(double dimensions, int cells, doub
* more "spiky".
* @param seed the seed for the random number generator
* @return the random polygon shape
* @since 1.3.1
* @since 1.4.0
*/
public static PShape createRandomBezierPolygon(int nPoints, double scale, double radius, double spikiness, long seed) {
BezierShapeGenerator bsg = new BezierShapeGenerator(nPoints, 3, radius, spikiness);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/micycle/pgs/PGS_Contour.java
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ public static PShape distanceField(PShape shape, double spacing) {
* @return A new PShape representing the smoothed longest center line of the
* input shape.
* @see #centerLine(PShape, double, double)
* @since 1.3.1
* @since 1.4.0
*/
public static PShape centerLine(PShape shape) {
return centerLine(shape, 0.7, 50);
Expand Down Expand Up @@ -682,7 +682,7 @@ public static PShape centerLine(PShape shape) {
* value to use is ~50.
* @return A new PShape representing the smoothed longest center line of the
* input shape.
* @since 1.3.1
* @since 1.4.0
*/
public static PShape centerLine(PShape shape, double straightnessWeighting, double smoothing) {
/*
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/micycle/pgs/PGS_Conversion.java
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ private static Geometry fromPrimitive(PShape shape) {
*
* @param vertices
* @return a POINTS PShape
* @since 1.3.1
* @since 1.4.0
*/
public static final PShape toPointsPShape(PVector... vertices) {
return toPointsPShape(Arrays.asList(vertices));
Expand Down Expand Up @@ -806,7 +806,7 @@ public static final PShape toPointsPShape(Collection<PVector> points) {
* The x and y components represent the center of the circle, and
* the z component represents the radius.
* @return The PShape object representing the collection of circles.
* @since 1.3.1
* @since 1.4.0
*/
public static final PShape toCircles(Collection<PVector> circles) {
return toPShape(circles.stream().map(c -> PGS_Construction.createEllipse(c.x, c.y, c.z, c.z)).collect(Collectors.toList()));
Expand Down Expand Up @@ -895,7 +895,7 @@ public static SimpleGraph<PVector, PEdge> toGraph(PShape shape) {
*
* @param graph the graph to be converted into a PShape.
* @return a PShape representing the polygonized edges of the graph.
* @since 1.3.1
* @since 1.4.0
*/
public static PShape fromGraph(SimpleGraph<PVector, PEdge> graph) {
return PGS.polygonizeEdges(graph.edgeSet());
Expand Down Expand Up @@ -988,7 +988,7 @@ public static SimpleGraph<PShape, DefaultEdge> toDualGraph(PShape mesh) {
* containing no graph loops or multiple edges. Each vertex in the graph
* represents the centroid of a face in the input mesh, and each edge
* represents adjacency between two faces.
* @since 1.3.1
* @since 1.4.0
* @see #toDualGraph(PShape)
* @see PGS_ShapePredicates#centroid(PShape)
*/
Expand Down Expand Up @@ -1102,7 +1102,7 @@ public static byte[] toWKB(PShape shape) {
* @param shape shape to process
* @param filename Absolute file path (with filename and extension). Prefix with
* "./" for a relative path.
* @since 1.3.1
* @since 1.4.0
*/
public static void toWKB(PShape shape, String filename) {
WKBWriter writer = new WKBWriter();
Expand Down Expand Up @@ -1341,7 +1341,7 @@ public static PShape fromPVector(PVector... vertices) {
* @param shell vertices of the shell of the polygon
* @param holes (optional) list of holes
* @return
* @since 1.3.1
* @since 1.4.0
*/
public static PShape fromPVector(List<PVector> shell, @Nullable List<List<PVector>> holes) {
boolean closed = false;
Expand Down Expand Up @@ -1397,7 +1397,7 @@ public static PShape fromPVector(List<PVector> shell, @Nullable List<List<PVecto
* @param keepClosed flag to determine whether to keep the (last) closing vertex
* in the output if the input forms a closed polygon
* @return coordinate array in the form [[x1, y1], [x2, y2]]
* @since 1.3.1 an array of coordinates representing the PShape
* @since 1.4.0 an array of coordinates representing the PShape
* @see #fromArray(double[][])
*/
public static double[][] toArray(PShape shape, boolean keepClosed) {
Expand All @@ -1421,7 +1421,7 @@ public static double[][] toArray(PShape shape, boolean keepClosed) {
* open line) [[x1, y1], [x2, y2]...]
* @param close close the coordinates (if unclosed)
* @return a PShape represented by the coordinates
* @since 1.3.1
* @since 1.4.0
* @see #toArray(PShape)
*/
public static PShape fromArray(double[][] shape, boolean close) {
Expand Down Expand Up @@ -1595,7 +1595,7 @@ public static PShape setAllStrokeToFillColor(PShape shape, double strokeWeight)
* @param comparator PShape comparison function
* @return a new GROUP PShape object having its children in a different order.
* Child shapes reference the same objects as the input.
* @since 1.3.1
* @since 1.4.0
*/
public static PShape reorderChildren(PShape shape, Comparator<PShape> comparator) {
List<PShape> children = getChildren(shape);
Expand Down Expand Up @@ -1703,7 +1703,7 @@ public static PShape copy(PShape shape) {
* @param controlPoint
* @param end
* @return
* @since 1.3.1
* @since 1.4.0
*/
public static PShape fromQuadraticBezier(PVector start, PVector controlPoint, PVector end) {
// convert to cubic bezier form
Expand All @@ -1721,7 +1721,7 @@ public static PShape fromQuadraticBezier(PVector start, PVector controlPoint, PV
* @param controlPoint2
* @param end
* @return
* @since 1.3.1
* @since 1.4.0
*/
public static PShape fromCubicBezier(PVector start, PVector controlPoint1, PVector controlPoint2, PVector end) {
CubicBezier bezier = new CubicBezier(start.x, start.y, controlPoint1.x, controlPoint1.y, controlPoint2.x, controlPoint2.y, end.x,
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/micycle/pgs/PGS_Meshing.java
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ public static PShape spiralQuadrangulation(List<PVector> points) {
* isn't conforming (i.e. adjacent edges do not necessarily have
* identical start and end coordinates)
* @return the input shape, having been noded and polygonized
* @since <code>public</code> since 1.3.1
* @since <code>public</code> since 1.4.0
*/
public static PShape nodeNonMesh(PShape shape) {
final List<SegmentString> segmentStrings = new ArrayList<>(shape.getChildCount() * 3);
Expand Down Expand Up @@ -604,7 +604,7 @@ public static PShape nodeNonMesh(PShape shape) {
* merged.
* @param seed the seed for the random number generator
* @return a new GROUP PShape representing the result of the operation
* @since 1.3.1
* @since 1.4.0
*/
public static PShape stochasticMerge(PShape mesh, int nClasses, long seed) {
final RandomGenerator random = new XoRoShiRo128PlusRandomGenerator(seed);
Expand Down Expand Up @@ -668,7 +668,7 @@ public static PShape stochasticMerge(PShape mesh, int nClasses, long seed) {
* Generally this should be set to true, otherwise the
* mesh will shrink as it is smoothed.
* @return the smoothed mesh
* @since 1.3.1
* @since 1.4.0
*/
public static PShape smoothMesh(PShape mesh, int iterations, boolean preservePerimeter) {
PMesh m = new PMesh(mesh);
Expand Down Expand Up @@ -704,7 +704,7 @@ public static PShape smoothMesh(PShape mesh, int iterations, boolean preservePer
* perimeter). Generally this should be set to true,
* otherwise the mesh will shrink as it is smoothed.
* @return the smoothed mesh
* @since 1.3.1
* @since 1.4.0
*/
public static PShape smoothMesh(PShape mesh, double displacementCutoff, boolean preservePerimeter) {
displacementCutoff = Math.max(displacementCutoff, 1e-3);
Expand All @@ -730,7 +730,7 @@ public static PShape smoothMesh(PShape mesh, double displacementCutoff, boolean
* @param preservePerimeter whether to only simplify inner-boundaries and
* leaving outer boundary edges unchanged.
* @return GROUP shape comprising the simplfied mesh faces
* @since 1.3.1
* @since 1.4.0
*/
public static PShape simplifyMesh(PShape mesh, double tolerance, boolean preservePerimeter) {
Geometry[] geometries = PGS_Conversion.getChildren(mesh).stream().map(s -> PGS_Conversion.fromPShape(s)).toArray(Geometry[]::new);
Expand All @@ -751,7 +751,7 @@ public static PShape simplifyMesh(PShape mesh, double tolerance, boolean preserv
*
* @param mesh The conforming mesh shape to extract inner edges from.
* @return A shape representing the dissolved linework of inner mesh edges.
* @since 1.3.1
* @since 1.4.0
*/
public static PShape extractInnerEdges(PShape mesh) {
List<PEdge> edges = PGS_SegmentSet.fromPShape(mesh);
Expand All @@ -775,7 +775,7 @@ public static PShape extractInnerEdges(PShape mesh) {
* faces. Any faces smaller than this threshold will be
* consolidated into their neighboring faces.
* @return GROUP shape comprising the merged mesh faces
* @since 1.3.1
* @since 1.4.0
*/
public static PShape areaMerge(PShape mesh, double areaThreshold) {
PShape merged = AreaMerge.areaMerge(mesh, areaThreshold);
Expand All @@ -793,7 +793,7 @@ public static PShape areaMerge(PShape mesh, double areaThreshold) {
* split into. Should be a positive integer, but if less than 1,
* it's reset to 1.
* @return A new mesh PShape created from the split edges.
* @since 1.3.1
* @since 1.4.0
*/
public static PShape splitEdges(PShape split, int parts) {
parts = Math.max(1, parts);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/micycle/pgs/PGS_Morphology.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public static PShape simplifyDCE(PShape shape, int targetNumVertices) {
* tightly it is "pulled" towards underlying vertices). Suitable
* domain is [0.666...3].
* @return a Hobby Curve
* @since 1.3.1
* @since 1.4.0
*/
public static PShape simplifyHobby(PShape shape, double tension) {
tension = Math.max(tension, 0.668); // prevent degeneracy
Expand Down Expand Up @@ -462,7 +462,7 @@ public static PShape smoothGaussian(PShape shape, double sigma) {
* @return A new PShape, simplified through the application of the Elliptic
* Fourier Descriptors up to the indicated order. This shape will always
* have the same number of vertices as the original.
* @since 1.3.1
* @since 1.4.0
*/
public static PShape smoothEllipticFourier(PShape shape, int descriptors) {
Geometry g = fromPShape(shape);
Expand Down
Loading

0 comments on commit 69c9243

Please sign in to comment.