UNPKG

@bitbybit-dev/jscad-worker

Version:

Bit By Bit Developers JSCAD Based CAD Library to Program Geometry Via WebWorker

47 lines (46 loc) 1.99 kB
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; /** * Contains various functions for Solid hulls from JSCAD library https://github.com/jscad/OpenJSCAD.org * Thanks JSCAD community for developing this kernel */ export class JSCADHulls { constructor(jscadWorkerManager) { this.jscadWorkerManager = jscadWorkerManager; } /** * Hull chain connects solids or 2d geometries by filling an empty space in between objects in order. * Geometries need to be of the same type. * @param inputs Geometries * @returns Chain hulled geometry * @group hulls * @shortname hull chain * @drawable true */ hullChain(inputs) { return __awaiter(this, void 0, void 0, function* () { return this.jscadWorkerManager.genericCallToWorkerPromise("hulls.hullChain", inputs); }); } /** * Convex hull connects solids or 2d geometries by filling an empty space in between without following order. * Geometries need to be of the same type. * @param inputs Geometries * @returns Hulled geometry * @group hulls * @shortname hull * @drawable true */ hull(inputs) { return __awaiter(this, void 0, void 0, function* () { return this.jscadWorkerManager.genericCallToWorkerPromise("hulls.hullChain", inputs); }); } }