Java-based geometry and processing engine for parametric 2D shape manufacturing workflows.
It validates incoming shape definitions, resolves parametric data, and generates Java outputs used by downstream preview and execution systems.
GSAP Geometry Core acts as the processing backend between editor-created shape JSON and manufacturing-ready generated artifacts.
Primary responsibilities:
- Parse and normalize shape JSON (legacy and parametric formats)
- Validate geometric correctness with tolerance-aware rules
- Execute shape-processing pipeline logic
- Generate dual Java output classes per shape (
ShapeTransformer+ShapePreview) - Run as a Redis + MySQL worker in integrated environments
Shape JSON (from editor / DB)
|
v
ShapeLoader
|
v
Domain Model (Point, Edge, Shape, ...)
|
v
GeometryValidator
|
v
Shape Pipeline + Generators
|
v
Generated Java output artifacts
For deeper architecture details, see ARCHITECTURE.md.
- Immutable primitives and edge types (
LineEdge,ArcEdge) - Epsilon-aware comparisons for numerical stability
- Utility methods for perimeter and geometry calculations
- Supports legacy
v1.0shape definitions - Supports
v2.0parametric definitions with expression-based points - DTO-based parsing boundary to keep domain model safe and strict
- Enforces minimum topology requirements
- Checks closure and edge connectivity
- Flags invalid or degenerate geometry
- Returns aggregated validation errors instead of failing fast on first issue
- Produces two Java outputs for each processed shape:
ShapeTransformerfor execution logicShapePreviewfor visualization metadata
See PARAMETRIC_FORMAT.md and DUAL_OUTPUT.md for full contracts.
GSAP Geometry Core/
|- src/main/java/com/company/gsap/
| |- model/ # Domain types
| |- loader/ # JSON parsing + DTOs
| |- validation/ # Geometry validation rules
| |- pipeline/ # Shape processing orchestration
| |- generator/ # Java output generation
| `- worker/ # Redis/MySQL worker runtime
|- src/test/ # Unit and integration-style tests
|- shapes/ # Input/output working directories
|- pom.xml # Maven build configuration
`- README.md
- Java 17+
- Maven 3.6+
- MySQL (for worker/database integration mode)
- Redis (for queue consumption mode)
mvn clean testUseful commands:
mvn compile- compile source onlymvn test- run testsmvn -q exec:java- run worker entrypoint (WorkerApplication)mvn -q -DskipTests package- build fat jar via shade plugin
Generated jar:
target/gsap-geometry-worker.jar
Run jar directly:
java -jar target/gsap-geometry-worker.jarMain class: com.company.gsap.worker.WorkerApplication
The worker:
- Reads jobs from Redis list key
- Fetches and updates shape state in MySQL
- Runs pipeline/generation
- Writes output to configured output directory
The worker reads these env vars:
JDBC_URL(optional ifMYSQL_*provided)MYSQL_HOST(defaultlocalhost)MYSQL_PORT(default3306)MYSQL_DATABASE(defaultgsap_editor)MYSQL_USER(defaultroot)MYSQL_PASSWORDREDIS_HOST(default127.0.0.1)REDIS_PORT(default6379)REDIS_PASSWORD(optional)SHAPE_JOB_LIST_KEY(defaultgsap:shape-processing:jobs)OUTPUT_DIR(defaultshapes/output)
Example (PowerShell):
$env:MYSQL_HOST="localhost"
$env:MYSQL_PORT="3306"
$env:MYSQL_DATABASE="gsap_editor"
$env:MYSQL_USER="root"
$env:MYSQL_PASSWORD="your_password"
$env:REDIS_HOST="127.0.0.1"
$env:REDIS_PORT="6379"
$env:SHAPE_JOB_LIST_KEY="gsap:shape-processing:jobs"
$env:OUTPUT_DIR="shapes/output"
mvn -q exec:javaTypical local flow:
- Place shape payloads in
shapes/input/(if running file-based pipeline tooling) - Generated Java outputs are written to
shapes/output/ - Processed/failed input routing depends on pipeline mode and configuration
ShapeLoader loader = new ShapeLoader();
Shape shape = loader.load("path/to/shape.json");
GeometryValidator validator = new GeometryValidator();
ValidationResult result = validator.validate(shape);
if (result.isValid()) {
System.out.println("Shape valid: " + shape.getName());
} else {
result.getErrors().forEach(System.err::println);
}This is a personal/Research project. Not currently accepting contributions, but feel free to fork and experiment.
MIT License - See LICENSE file for details
Fix: Open the project by selecting pom.xml directly (not the folder):
- File β Open
- Select
pom.xml - Click "Open as Project"
- Wait for Maven indexing to complete
Fix: Already fixed in code. Using Paths.get(resource.toURI()) instead of URL.getPath() for Windows compatibility.
Fix: Already fixed. pom.xml includes <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- Import the project as a Maven project (File β Open β select the project root).
- Open the right-side Maven panel (View β Tool Windows β Maven).
- To build and test:
- Expand
Lifecycleand double-clickclean, theninstall.
- Expand
- To run the app (single pass):
- Expand
Pluginsβexecβ double-clickexec:java.
- Expand
- To run in watch mode:
- At the top of the Maven panel, type
watchin theProfilesfield, then double-clickexec:javaunderPlugins.
- At the top of the Maven panel, type
- Build and test:
mvn clean install
- Run (single pass):
mvn exec:java
- Run in watch mode:
mvn exec:java -Pwatch
- Drop exported JSON files into
shapes/input/. - Generated
.javafiles will appear inshapes/output/. - Processed JSONs move to
shapes/input/processed/. - Failed JSONs move to
shapes/input/failed/.
DOCUMENTATION_INDEX.md- entry point for all docsARCHITECTURE.md- architecture and processing flowPARAMETRIC_FORMAT.md- v2.0 JSON schema and conventionsDUAL_OUTPUT.md- generated output structure and intentQUICK_REFERENCE.md- frequently used commands and quick ops
- IDE import issues: open the project as a Maven project via
pom.xml - MySQL connection errors: verify
MYSQL_*/JDBC_URLvalues and DB availability - Redis connection errors: verify
REDIS_HOST/REDIS_PORTand server state - No generated files: verify
OUTPUT_DIRexists or can be created, then check worker logs - Test path issues on Windows: ensure paths are URI-safe and do not rely on raw URL path parsing
Project: GSAP Geometry Core
Started: February 2026
Author: Damitha Samarakoon
MIT