Move each application to its own submodule
Removed JOML and Bukkit depednencies for the standalone applications
This commit is contained in:
47
application/visualizer/Test7/dependency-reduced-pom.xml
Normal file
47
application/visualizer/Test7/dependency-reduced-pom.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<artifactId>mc-mesh-application-visualizer</artifactId>
|
||||
<groupId>com.aaaaahhhhhhh.bananapuncher714</groupId>
|
||||
<version>0.0.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>mc-mesh-application-visualizer-test-7</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.14.1</version>
|
||||
<configuration>
|
||||
<release>8</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<mainClass>com.aaaaahhhhhhh.bananapuncher714.mesh.test.MeshingTest7</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
66
application/visualizer/Test7/pom.xml
Normal file
66
application/visualizer/Test7/pom.xml
Normal file
@@ -0,0 +1,66 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.aaaaahhhhhhh.bananapuncher714</groupId>
|
||||
<artifactId>mc-mesh-application-visualizer</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</parent>
|
||||
<artifactId>mc-mesh-application-visualizer-test-7</artifactId>
|
||||
<version>0.0.1</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.aaaaahhhhhhh.bananapuncher714</groupId>
|
||||
<artifactId>mc-mesh-core</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aaaaahhhhhhh.bananapuncher714</groupId>
|
||||
<artifactId>mc-mesh-base</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.14.1</version>
|
||||
<configuration>
|
||||
<release>8</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.5.0</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<mainClass>com.aaaaahhhhhhh.bananapuncher714.mesh.test.MeshingTest7</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.aaaaahhhhhhh.bananapuncher714.mesh.test;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import com.aaaaahhhhhhh.bananapuncher714.mesh.Mesh;
|
||||
import com.aaaaahhhhhhh.bananapuncher714.mesh.Point;
|
||||
import com.aaaaahhhhhhh.bananapuncher714.mesh.Polygon;
|
||||
import com.aaaaahhhhhhh.bananapuncher714.mesh.region.simple.RegionRuleWinding;
|
||||
import com.aaaaahhhhhhh.bananapuncher714.mesh.region.simple.RegionSimple;
|
||||
import com.aaaaahhhhhhh.bananapuncher714.mesh.region.simple.RegionSimple.GluWindingRule;
|
||||
|
||||
/**
|
||||
* Mesh speed test for polygons
|
||||
*/
|
||||
public class MeshingTest7 {
|
||||
private static final File BASE = new File( System.getProperty( "user.dir" ) );
|
||||
private static final File POLYGON_DIR = new File( BASE, "polygons" );
|
||||
|
||||
public static void main( String[] args ) {
|
||||
if ( POLYGON_DIR.exists() && POLYGON_DIR.isDirectory() ) {
|
||||
System.out.println( "Found " + POLYGON_DIR.list().length + " files" );
|
||||
|
||||
final long allStart = System.currentTimeMillis();
|
||||
final AtomicInteger index = new AtomicInteger( 0 );
|
||||
final Collection< File > files = Arrays.asList( POLYGON_DIR.listFiles() );
|
||||
files.parallelStream().forEach( f -> {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
|
||||
builder.append( "Meshing file: " + f + "\n" );
|
||||
|
||||
final long start = System.currentTimeMillis();
|
||||
final List< Polygon > polygons = mesh( f, builder );
|
||||
|
||||
Mesh< RegionSimple > mesh = new Mesh< RegionSimple >( () -> { return new RegionSimple( GluWindingRule.ODD ); } );
|
||||
for ( Polygon poly : polygons ) {
|
||||
mesh.addPolygon( poly, RegionRuleWinding.CLOCKWISE );
|
||||
}
|
||||
|
||||
mesh.meshify();
|
||||
|
||||
long time = System.currentTimeMillis() - start;
|
||||
|
||||
builder.append( "\tTook " + time + "ms\n" );
|
||||
builder.append( "\tCompleted " + index.incrementAndGet() + "/" + files.size() );
|
||||
|
||||
System.out.println( builder.toString() );
|
||||
} );
|
||||
System.out.println( "Took a total of " + ( System.currentTimeMillis() - allStart ) + "ms" );
|
||||
} else {
|
||||
System.err.println( "No such directory exists: " + POLYGON_DIR );
|
||||
}
|
||||
}
|
||||
|
||||
private static List< Polygon > mesh( File file, final StringBuilder stringBuilder ) {
|
||||
// First parse the file to get a list of all polygons
|
||||
final List< Polygon > polys = new ArrayList< Polygon >();
|
||||
try ( BufferedReader reader = new BufferedReader( new FileReader( file ) ) ) {
|
||||
String line;
|
||||
while ( ( line = reader.readLine() ) != null ) {
|
||||
if ( !line.isEmpty() ) {
|
||||
final int pointCount = Integer.parseInt( line );
|
||||
|
||||
List< Point > points = new ArrayList< Point >( pointCount );
|
||||
|
||||
int point = 0;
|
||||
while ( point < pointCount && ( line = reader.readLine() ) != null ) {
|
||||
if ( !line.isEmpty() ) {
|
||||
String[] values2 = line.split( " " );
|
||||
final double px = Double.parseDouble( values2[ 0 ] );
|
||||
final double py = Double.parseDouble( values2[ 1 ] );
|
||||
points.add( new Point( px, py ) );
|
||||
++point;
|
||||
}
|
||||
}
|
||||
|
||||
polys.add( new Polygon( points ) ) ;
|
||||
}
|
||||
}
|
||||
} catch ( FileNotFoundException e ) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} catch ( IOException e ) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
return polys;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user