var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var primitives_exports = {};
__export(primitives_exports, {
  collectGroupVertexIndices: () => collectGroupVertexIndices,
  createBoxGeometry: () => createBoxGeometry
});
module.exports = __toCommonJS(primitives_exports);
function createBoxGeometry(THREE, size) {
  return new THREE.BoxGeometry(size[0], size[1], size[2]);
}
function collectGroupVertexIndices(geometry) {
  const indexAttr = geometry.index;
  const groups = geometry.groups;
  if (!indexAttr || !groups || groups.length === 0) {
    return [];
  }
  const indices = indexAttr.array;
  const result = [];
  groups.forEach((group) => {
    const set = /* @__PURE__ */ new Set();
    for (let i = 0; i < group.count; i += 1) {
      set.add(indices[group.start + i]);
    }
    result.push(set);
  });
  return result;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  collectGroupVertexIndices,
  createBoxGeometry
});
