{"_id":"@aectooling/slopifc-wasm","name":"@aectooling/slopifc-wasm","dist-tags":{"next":"0.1.0-rc.0","latest":"0.1.0-rc.0"},"versions":{"0.1.0-rc.0":{"name":"@aectooling/slopifc-wasm","version":"0.1.0-rc.0","private":false,"description":"WebAssembly bindings for slopifc: IFC parsing, metadata and render data for browsers and Node","license":"MIT","packageManager":"bun@1.3.14","engines":{"bun":">=1.3.0"},"type":"module","sideEffects":false,"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./three":{"types":"./dist/three/index.d.ts","default":"./dist/three/index.js"},"./parser.worker":{"types":"./dist/parser.worker.d.ts","default":"./dist/parser.worker.js"},"./slopifc.wasm":"./dist/slopifc.wasm","./package.json":"./package.json"},"scripts":{"wasm":"bun scripts/copy-wasm.mjs","build":"bun run wasm && tsc -p tsconfig.build.json","typecheck":"tsc -p tsconfig.json","test":"bun run wasm && vitest run","check:pack":"bun scripts/check-pack-contents.mjs","check":"bun run typecheck && bun run test && bun run build && bun run check:pack"},"peerDependencies":{"three":">=0.160.0"},"peerDependenciesMeta":{"three":{"optional":true}},"devDependencies":{"@types/node":"^24.0.10","@types/three":"^0.178.1","three":"^0.178.0","typescript":"~5.8.3","vitest":"^4.1.10"},"gitHead":"c0ab4f61a18ae04c951b0410eefc5aaeb40ad216","_id":"@aectooling/slopifc-wasm@0.1.0-rc.0","_nodeVersion":"24.14.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-S8r1o6mpPwyiILoGlsK9gNRm2FA9Jrdb9HnYTUTZTe2u4/NJHcV6e9gE8bOdXSRjT2tcWp32M/ZCm/jvSljbmQ==","shasum":"021b5b42924a99729ce7ef4babcb0e4730528568","tarball":"https://registry.npmjs.org/@aectooling/slopifc-wasm/-/slopifc-wasm-0.1.0-rc.0.tgz","fileCount":264,"unpackedSize":9816928,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEFDnj9EHfuGJE7wWUPRCdM5sln9peQCq40DQPWMqr8WAiEAx1vavTqLX8rzK0rEuunkFsqZpQHFoFOZ+OGlnnIbrjs="}]},"_npmUser":{"name":"aectooling","email":"calorie-sails1u@icloud.com"},"directories":{},"maintainers":[{"name":"aectooling","email":"calorie-sails1u@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/slopifc-wasm_0.1.0-rc.0_1786804296250_0.5885606716341318"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-15T14:31:36.024Z","0.1.0-rc.0":"2026-08-15T14:31:36.504Z","modified":"2026-08-15T14:31:36.729Z"},"maintainers":[{"name":"aectooling","email":"calorie-sails1u@icloud.com"}],"description":"WebAssembly bindings for slopifc: IFC parsing, metadata and render data for browsers and Node","license":"MIT","readme":"# `@slopifc/wasm`\n\nWebAssembly bindings for [slopifc](../../README.md): IFC parsing, typed\nmetadata and Three.js-shaped render data, for browsers and Node.\n\nThe package is the only supported browser-facing interface to slopifc.\nApplications never instantiate the module, manage linear memory, free strings\nor call raw exports.\n\n> **Status: runtime, conversion, metadata, render data and Three.js adapter.**\n> `createSlopIfc()`, isolated model instances, typed lazy entities, projected\n> metadata, file conversion, retained zero-copy render tables, Three.js wrappers and\n> deterministic disposal are implemented. Nothing is published to npm yet.\n\nThe current generated runtime accepts IFC2X3 (`IFC2X3`, `IFC2X3TC1`) and IFC4\n(`IFC4`, `IFC4ADD2`, `IFC4ADD2TC1`). Other schema releases, including IFC4X3,\nare rejected at open time until their generated metadata tables are added.\n\n## Contract\n\nThe normative contract — integer widths, ownership, `prepare()` defaults, the\nmodel state machine, the close/detachment sequence, status codes and every\nbyte-exact descriptor layout — is\n[`docs/spec-wasm-package-abi.md`](../../docs/spec-wasm-package-abi.md). The\nroadmap it belongs to is [`pack-wasm-plan.md`](../../pack-wasm-plan.md).\n\n## Current usage\n\nConvert an IFC source into JavaScript-owned Blobs suitable for download. OBJ\nreturns its referenced MTL file explicitly as `sidecar`.\n\n```ts\nconst converted = await runtime.convert(file, {\n  format: 'obj',\n  geometry: { scopes: ['building'], subtractOpenings: true },\n})\n\nfunction save(output: { name: string; blob: Blob }) {\n  const url = URL.createObjectURL(output.blob)\n  const link = document.createElement('a')\n  link.href = url\n  link.download = output.name\n  link.click()\n  setTimeout(() => URL.revokeObjectURL(url), 0)\n}\n\nsave(converted.output)\nif (converted.sidecar) save(converted.sidecar)\n```\n\nAn open model can be converted repeatedly before preparation:\n\n```ts\nimport { createSlopIfc } from '@slopifc/wasm'\nconst runtime = await createSlopIfc()\nconst model = await runtime.open(file)\n\nconst json = await model.convert({ format: 'json' })\n\nconst prepared = await model.prepare({\n  render: { coordinateToOrigin: true, subtractOpenings: true },\n  metadata: {\n    entityTypes: ['IFCPRODUCT'],\n    includeSubtypes: true,\n    attributes: ['GlobalId', 'Name', 'OwnerHistory'],\n  },\n})\n\nconst names = prepared.getMetadata()?.column('Name')\nconst render = prepared.renderData\nconst wall = model.getEntities().byGuid('2Ab$4Ad$L9QuMOSyGoOAgE')\nconsole.log(names?.kind === 'utf8' ? names.get(0) : undefined)\nconsole.log(render?.geometries.count, render?.instances.count)\nconsole.log(wall?.getExpressID(), wall?.getTypeName())\n\nprepared.dispose()\n```\n\nCompile-checked versions of both flows live in [`examples/`](examples/).\n\n## Layout\n\n| Path | Contents |\n| --- | --- |\n| `src/index.ts` | public API barrel |\n| `src/index-internal.ts` | internal barrel for tests; not in `exports` |\n| `src/raw-api.ts` | private ABI adapter: descriptor layouts, status codes |\n| `src/memory-views.ts` | bounds/alignment-checked views over sealed memory |\n| `src/prepare-options.ts` | `prepare()` option types and defaults |\n| `src/conversion.ts` | conversion option validation, output names and public result types |\n| `src/decode-value.ts` | WASM lazy-value → typed `IfcValue` |\n| `src/entities.ts`, `src/model.ts`, `src/runtime.ts` | public runtime surface |\n| `src/render-data.ts`, `src/metadata-table.ts` | descriptor → public tables |\n| `src/three/` | optional adapter, published as `@slopifc/wasm/three` |\n| `tests/fixtures/` | hand-built descriptor fixtures (no WASM required) |\n\nThe core never imports `three`; it is an optional peer dependency of the\n`/three` subpath only.\n\n## Development\n\n```bash\nbun install\nbun run typecheck\nbun run test\nbun run build       # zig build wasm, then tsc + dist/slopifc.wasm\nbun run check:pack  # pack a throwaway tarball and verify its contents\nbun run check       # all of the above\n```\n\n`zig build wasm` stays a Zig-only step writing to `zig-out/wasm/slopifc.wasm`;\ncopying it into `dist/` is the package build's job. Set\n`SLOPIFC_SKIP_ZIG_BUILD=1` to reuse an artifact a previous step already built.\n","readmeFilename":"README.md","_rev":"1-c81b0433c60cb368d048c8be6980c378"}