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.
This module can be used either as a library:
pnpm install replicad-shrink-wrap
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),
];
}