Szymon Kaliski

  1. Main
  2. Projects
  3. Notes
  4. Music
  5. Bio

hiccup-sdf

hiccup-sdf ↗ is set of open source tools made for creating, displaying and exporting 3d models made with SDFs.

It's another iteration of my exploration of SDFs started with SDF-UI.

This project consists of three libraries:

Modeling is done with language inspired by hiccup ↗, adapted to use in javascript:

const { displayRaw } = require("display-sdf");
const { compileShader, glslHelpers } = require("hiccup-sdf");

const translatedSphere = (t, r) => ["translate", { t }, [["sphere", { r }]]];

const shape = [
  "repeatPolar",
  { r: 10 },
  [
    [
      "translate",
      { t: [0.5, 0, 0] },
      [
        [
          "intersection",
          {},
          [
            ["box", { s: [0.1, 0.1, 0.1] }],
            translatedSphere([0.15, 0, 0], 0.2),
          ],
        ],
      ],
    ],
  ],
];

const { inject, model } = compileShader(shape);
const shader = glslHelpers.createShaderFull(model, inject);

displayRaw(shader);

SDFs can be meshed using surface nets ↗ and hiccup-sdf-to-obj provides set of tools to help with that, and export 3d-printer ready models:

For more information and examples go to github: szymonkaliski/hiccup-sdf ↗.

This project was developed in part at Laboratory, an artist residency for interactive arts: laboratoryspokane.com ↗. You can read more about my time in Spokane in this blog post: Laboratory Residency.

Backlinks

  1. 2023-10-02Building a DIY Pen Plotter1
  2. 2023-05-20SDFSheetsA Spreadsheet of Signed Distance Functions1
  3. 2021-01-17DAG and Tree Representations of Code1
  4. 2020-11-12FabFungusArt Installation Inspired by Questions of Digital Life and Cellular Growth1
  5. 2018-11-27Laboratory ResidencyBuilding Creative Coding Tools1

304 words published on 2018-11-25let me know what you think