npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ifc-lite/clash

v2.3.1

Published

Clash detection for IFC-Lite — representation-agnostic core engine + source adapters

Downloads

2,284

Readme

@ifc-lite/clash

Clash detection for IFC-Lite. A representation-agnostic core engine plus thin, version-specific source adapters.

  • The core (@ifc-lite/clash) operates on ClashElement[]{ key, ref, tag, bounds, positions, indices } — and never imports @ifc-lite/parser/@ifc-lite/query. STEP/IFC4 and IFC5/USD are just adapters that produce those elements.
  • Broad phase: BVH (@ifc-lite/spatial). Narrow phase: exact triangle–triangle intersection and exact triangle–triangle minimum distance — no decimation.
  • Results classify as hard (interpenetration), clearance (within a gap), or touch (within tolerance, suppressed by default).

Installation

npm install @ifc-lite/clash

Usage

import { createClashEngine, CLASH_RULE_PRESETS } from '@ifc-lite/clash';
import { elementsFromStep } from '@ifc-lite/clash/step';

const { elements, exclusions } = elementsFromStep({ store, meshes, modelId: 'm1' });
const engine = createClashEngine({ backend: 'auto' });
const result = await engine.run(elements, [
  { id: 'mep-str', name: 'MEP vs Structure', a: 'IfcPipe*|IfcDuct*', b: 'IfcBeam|IfcColumn|IfcSlab', mode: 'hard' },
], { exclusions });

console.log(result.summary.total, 'clashes');

If your host has already shifted mesh.expressId into a federated global id space (as the viewer's loader does for every model past the first) while the IfcDataStore keeps local ids, pass that shift as meshIdOffset so the adapter can address the store correctly:

import { elementsFromStep, type FederationLike } from '@ifc-lite/clash/step';

declare const federation: FederationLike; // e.g. the renderer's FederationRegistry
declare const model: { idOffset: number };

elementsFromStep({ store, meshes, modelId, federation, meshIdOffset: model.idOffset });

ClashElement.key is the element's IFC GlobalId. An element that has none — a malformed root, or every element of a GLB-sourced model, whose store carries no IFC entities — falls back to expressid:<encoded modelId>:<expressId>. Express ids are only unique within a model, so the model id is part of that key: clashReviewKey and the viewer's element-pair exclusions key on the element key alone, and an unqualified fallback would let a review or an exclusion set on one model apply to another model's element. That fallback is stable only for as long as the host's modelId is (in the viewer it is a per-load uuid).

Includes the TypeScript reference engine, a Rust→WASM kernel kept in lockstep by a differential test (opt-in via @ifc-lite/clash/wasm; backend: 'auto' currently resolves to the TS engine), STEP and IFC5/USD source adapters, spatial grouping, duplicate-element detection, clash review status (open / resolved / accepted) that round-trips through BCF, and a sensible BCF bridge (grouped topics, deterministic GUIDs, optional snapshots). Surfaced through the viewer's clash panel, the ifc-lite clash CLI, the MCP clash_check / clash_matrix tools, and the SDK clash namespace.

Docs

See the ifc-lite docs and the design rationale in Clash-detection architecture.

License

MPL-2.0