Skip to content

A very simple Go library for creating shapes on a 2D plane out of points, using only the Go stdlib. Can be used for generating simple images for instance. Made for educational purposes.

License

Notifications You must be signed in to change notification settings

0x1a8510f2/gopoints

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoPoints

A very simple Go library for creating shapes on a 2D plane out of points, using only the Go stdlib. Supports some basic functions like:

  • storing points in a Plane structure
  • joining arbitrary points with lines (including diagonal)
  • filling shapes with points
  • flipping the whole plane or some points along the X or Y axis
  • fetching all points from a plane
  • fetching points from a plane based on the return value (boolean) of a given function (like a mathematical equation)
  • TODO: Applying an arbitrary transformation based on a function to the points on the plane

Use cases

Can be used for any number of things, but my primary use-case is generating images made of 2D shapes, such as the example image generated with examples/CreatePngImage.go:

example image

Usage examples

Some example code can be found in the examples directory in the root of this repository

About

A very simple Go library for creating shapes on a 2D plane out of points, using only the Go stdlib. Can be used for generating simple images for instance. Made for educational purposes.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages