Skip to content

Commit c4001ab

Browse files
committed
assorted
1 parent 75636c3 commit c4001ab

8 files changed

+8
-8
lines changed

resources/contour/distanceField.png

251 KB
Loading

resources/contour/isolines.gif

4 MB
Loading

src/main/java/micycle/pgs/PGS_Coloring.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
* @since 1.2.0
4444
*/
4545
public final class PGS_Coloring {
46+
47+
public static long SEED = 1337;
4648

4749
private PGS_Coloring() {
4850
}
@@ -256,10 +258,10 @@ private static Coloring<PShape> findColoring(Collection<PShape> shapes, Coloring
256258
break;
257259
case RLF_BRUTE_FORCE_4COLOR :
258260
int iterations = 0;
259-
long seed = 1337;
261+
long seed = SEED; // init as default
260262
do {
261263
coloring = new RLFColoring<>(graph, seed).getColoring();
262-
seed = ThreadLocalRandom.current().nextLong();
264+
seed = ThreadLocalRandom.current().nextLong(); // randomise seed
263265
iterations++;
264266
} while (coloring.getNumberColors() > 4 && iterations < 250);
265267
break;

src/main/java/micycle/pgs/PGS_Construction.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ public static PShape createRandomSFCurve(int nColumns, int nRows, double cellWid
796796
* @param cellWidth visual/pixel width of each cell
797797
* @param cellHeight visual/pixel width of each cell
798798
* @param seed random seed
799-
* @return a stroked PATH PShape
799+
* @return a mitered stroked PATH PShape
800800
* @see #createRandomSFCurve(int, int, double, double)
801801
* @since 1.4.0
802802
*/

src/main/java/micycle/pgs/PGS_PointSet.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ public static List<PVector> random(double xMin, double yMin, double xMax, double
239239
final SplittableRandom random = new SplittableRandom(seed);
240240
final List<PVector> points = new ArrayList<>(n);
241241
for (int i = 0; i < n; i++) {
242-
final float x = (float) (xMin + (xMax - xMin) * random.nextDouble());
243-
final float y = (float) (yMin + (yMax - yMin) * random.nextDouble());
242+
final float x = (float) random.nextDouble(xMin, xMax);
243+
final float y = (float) random.nextDouble(yMin, yMax);
244244
points.add(new PVector(x, y));
245245
}
246246
return points;

src/main/java/micycle/pgs/PGS_Voronoi.java

-1
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,6 @@ public static PShape multiplicativelyWeightedVoronoi(Collection<PVector> sites,
533533
* @since 2.0
534534
*/
535535
public static PShape multiplicativelyWeightedVoronoi(Collection<PVector> sites, double[] bounds, boolean forceConforming) {
536-
537536
var faces = MultiplicativelyWeightedVoronoi.getMWVFromPVectors(sites.stream().toList(), bounds);
538537
Geometry geoms = PGS.GEOM_FACTORY.createGeometryCollection(faces.toArray(new Geometry[] {}));
539538
if (forceConforming) {

src/main/java/micycle/pgs/commons/MultiplicativelyWeightedVoronoi.java

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import java.util.ArrayList;
44
import java.util.Collection;
5-
import java.util.Collections;
65
import java.util.List;
76
import java.util.stream.Collectors;
87

src/main/java/micycle/pgs/commons/PMesh.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ private static class PMeshVertex {
372372

373373
final PVector originalVertex;
374374
final PVector smoothedVertex;
375-
boolean onBoundary;
375+
boolean onBoundary = false;
376376
List<PMeshVertex> neighbors;
377377

378378
public PMeshVertex(PVector v) {

0 commit comments

Comments
 (0)