{"version":3,"sources":["jsdelivr-header.js","/npm/quickhull3d@3.1.2/dist/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNO,mBAAoB,0BAClB,UAAW,qBAAwB,qBACnC,iBAAkB,0BACZ,SAAS,OAAO,EAAQ,EAAU,CAAC,GAC9C,MAAM,EAAW,IAAI,UAAU,GAE/B,OADA,EAAS,QACF,EAAS,aAAa,EAAQ,kBACzC,QASO,SAAS,kBAAkB,EAAO,EAAQ,GAC7C,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,OAAQ,IAAK,CACnC,MAAM,EAAO,EAAM,GACb,EAAI,EAAO,EAAK,IAChB,EAAI,EAAO,EAAK,IAChB,EAAI,EAAO,EAAK,IAMhB,EAAc,eAAe,IAAI,aAAa,GAAI,EAAG,EAAG,GAExD,EAAY,CAAC,EAAM,GAAK,EAAE,GAAI,EAAM,GAAK,EAAE,GAAI,EAAM,GAAK,EAAE,IAElE,GADmB,EAAY,GAAK,EAAU,GAAK,EAAY,GAAK,EAAU,GAAK,EAAY,GAAK,EAAU,GAC7F,EACb,OAAO,CAEf,CACA,OAAO,CACX","file":"/npm/quickhull3d@3.1.2/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/quickhull3d@3.1.2/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import getPlaneNormal from 'get-plane-normal';\nimport { QuickHull, QuickHullOptions } from './QuickHull';\nexport { QuickHullOptions, QuickHull };\nexport default function runner(points, options = {}) {\n    const instance = new QuickHull(points);\n    instance.build();\n    return instance.collectFaces(options.skipTriangulation);\n}\n/**\n * Checks if a point is inside the convex hull.\n *\n * @param {Point} point - The point to check.\n * @param {Array<Point>} points - The points used in the space where the\n * convex hull is defined.\n * @param {Array<Face>} faces - The faces of the convex hull.\n */\nexport function isPointInsideHull(point, points, faces) {\n    for (let i = 0; i < faces.length; i++) {\n        const face = faces[i];\n        const a = points[face[0]];\n        const b = points[face[1]];\n        const c = points[face[2]];\n        // Algorithm:\n        // 1. Get the normal of the face.\n        // 2. Get the vector from the point to the first vertex of the face.\n        // 3. Calculate the dot product of the normal and the vector.\n        // 4. If the dot product is positive, the point is outside the face.\n        const planeNormal = getPlaneNormal(new Float32Array(3), a, b, c);\n        // Get the point with respect to the first vertex of the face.\n        const pointAbsA = [point[0] - a[0], point[1] - a[1], point[2] - a[2]];\n        const dotProduct = planeNormal[0] * pointAbsA[0] + planeNormal[1] * pointAbsA[1] + planeNormal[2] * pointAbsA[2];\n        if (dotProduct > 0) {\n            return false;\n        }\n    }\n    return true;\n}\n"]}