/replicad-shrink-wrap

A replicad library to create a hull out of drawings

Primary LanguageJavaScriptMIT LicenseMIT

replicad shrink wrap

This is a library based on replicad.

This library contains a set of helpers to shrink wrap a drawing. This corresponds to the hull operation in some CAD software.

As a library

This module can be used either as a library:

pnpm install replicad-shrink-wrap

Within the replicad studio

You can also import it within the replicad studio:

import shrinkWrap from "https://cdn.jsdelivr.net/npm/replicad-shrink-wrap/dist/studio/replicad-shrink-wrap.js";
/** @typedef { typeof import("replicad") } replicadLib */
/** @type {replicadLib} */
const { drawRoundedRectangle, drawCircle, draw } = replicad;

export default function main() {
  const circle = drawCircle(7).translate(8, 18);
  const rect = drawRoundedRectangle(20, 14, 5);

  return [
    { shape: rect, color: "silver" },
    { shape: circle, color: "silver" },
    shrinkWrap(rect.fuse(circle), 50),
  ];
}

Go an play with it there