polygon-art/README.md
2021-09-28 23:31:12 +02:00

1.7 KiB

Convenience library to create art using geo.

  • Creates CLI interface (including random seed management)
  • renders SVGs and PNG
  • comes with helper functions and extensions, to make live more convenient.
    • load SVGs
    • scaling

Binaries

I deliver some binaries to give you an impression and ideas for your own images.

All binaries created by polygon art have the same command line interface.

Asteroids

asteroids is an example binary which renders an image inspired by the asteroids game from the 1979.

image

Rings

image

How to run /examples

cargo run --example clipping -- --help # run the examples/clipping

How to Build (with flakes)

nix build

How to us it (with flakes)

{
  description = "example usage";
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-21.05";
  inputs.polygon-art.url = "git+https://git.ingolf-wagner.de/palo/polygon-art.git";
  inputs.polygon-art.inputs.nixpkgs.follows = "nixpkgs";
  outputs = { self, nixpkgs, polygon-art, ... }: {
    nixosConfigurations.example = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        ({ pkgs, ... }: {
          nixpkgs.overlays = [
            (_self: _super: {
              polygon-art = polygon-art.packages.${pkgs.system};
            })
          ];
          environment.systemPackages = [ pkgs.polygon-art.polygon-art ];
        })
      ];
    };
  };
}

How to update

cargo update # to update Cargo.lock
# or
cargo update --offline # to update Cargo.lock

and

nix flake update # to update flake.lock
nix build        # to verify if everything is ok