Skip to content

Vonvikken/Closed-Bezier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub top language GitHub code size in bytes LICENSE

Closed Bézier curves

A simple JavaFX application that shows the implementation of a closed (and animated) Bézier curve.

Intro

I wrote this application because I needed to create a closed path with smoothly changing gradients. The Bézier curves change smoothly but are open, so I had to make some adjustments to make their ends link seamlessly.

The trick of perfectly linking two Bézier curves is to make sure that:

  • the end point of the first curve is the same of the start point of the second one (shown in yellow in the figure below);
  • the line connecting the last control point of the first line and the first control point of the second one passes through the common point of the two curves (the control points and the lines are shown in grey in the figure below).

Bézier curves at Wikipedia.org

Requirements

  • Java 13 (but can be run since Java 11)
  • Maven

Compile

mvn compile

Run

mvn javafx:run

TODOs

  • Configurable parameters
  • Some comments in the code...

Releases

No releases published

Packages

No packages published