Library for generating 3D models via a Haskell EDSL OpenSCAD.
[[https://img.shields.io/badge/built%20with-Haskell-8f4e8b.svg]]
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;
};
};
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>;
};
};
}
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.
This library provides an algebraic data type for describing OpenSCAD models, and a function that converts that data type into a string.