Skip to content

Library for generating 3D models via a Haskell EDSL and OpenSCAD

License

Notifications You must be signed in to change notification settings

dsunshi/polydraw-scad

Repository files navigation


Polydraw
Polydraw

Library for generating 3D models via a Haskell EDSL OpenSCAD.


Graphics.Polydraw

Built with Nix [[https://img.shields.io/badge/built%20with-Haskell-8f4e8b.svg]]

🚀  Installation

Using nix flake

There needs to be an input:

inputs = {
    ...
    polydraw.url = "github:dsunshi/polydraw";
    ...
};

Then we can add the package:

haskellProjects.default = {
    packages = {
        polydraw.source = inputs.polydraw;
    };
};

Example flake.nix

The following is the content of a flake.nix file, which can be used to build a project using polydraw.

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
    flake-parts.url = "github:hercules-ci/flake-parts";
    haskell-flake.url = "github:srid/haskell-flake";
    polydraw.url = "github:dsunshi/polydraw";
  };
  outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
    flake-parts.lib.mkFlake { inherit inputs; } {
      systems = nixpkgs.lib.systems.flakeExposed;
      imports = [ inputs.haskell-flake.flakeModule ];

      perSystem = { self', pkgs, ... }: {

        haskellProjects.default = {
            packages = {
                polydraw.source = inputs.polydraw;
            };
        };

        # haskell-flake doesn't set the default package, but you can do it here.
        packages.default = self'.packages.<your-package-name>;
      };
    };
}

❤️  Origin from Graphics.Polydraw

Polydraw is primarily a fork of the brilliant Graphics.OpenSCAD. It has been updated to more modern versions of Haskell (as well as my personal opinions). This project is in very early stages and is subject to change.

How?

This library provides an algebraic data type for describing OpenSCAD models, and a function that converts that data type into a string.

More info

📘  License

License

About

Library for generating 3D models via a Haskell EDSL and OpenSCAD

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published