@omnitexts/cad3d-modeler
v0.1.0
Published
Convert normalized CAD drawings into semantic solid GLB planning models and review reports.
Maintainers
Readme
cad3d-modeler
@omnitexts/cad3d-modeler converts a normalized cad3d.drawing document into a reviewable planning model. It is the deterministic modeling stage between @omnitexts/cad3d-cli and a GLB viewer.
DWG/DXF -> cad3d-cli -> drawing.json -> cad3d-modeler
-> semantic-model.json
-> modeling-report.json
-> model.glbThis package does not parse DWG or DXF files. It consumes the stable JSON contract produced by cad3d-cli.
What it models
- closed footprints on architecture-related layers;
- factory, warehouse, shed, canopy, office, and service-building semantics from nearby labels;
- explicit heights when present in labels;
- configurable default heights, eave heights, roof types, bay spacing, floors, and material slots;
- enclosed buildings with walls, roofs, procedural doors and windows;
- open sheds and canopies with columns, frames, and roof surfaces;
- spatially separated plan alternatives grouped into independent model regions.
The output is a planning and review model, not a construction BIM model.
CLI
cad3d-modeler drawing.json --pretty -o output/modelOutputs:
semantic-model.json: objects, parameters, source references, confidence, and assumptions;modeling-report.json: grouped issues and suggested corrective actions;model.glb: PBR-ready solid geometry with semantic metadata inuserData.
Use a custom profile when drawing conventions differ:
cad3d-modeler drawing.json --profile factory-profile.json -o output/modelJavaScript API
import { modelDrawing } from "@omnitexts/cad3d-modeler";
const { semanticModel, report, glb } = await modelDrawing(drawing, {
profile: {
nearbyTextDistanceM: 10,
statedAreaTolerance: 0.35,
},
});The same API works in Node.js and modern browsers. It returns the GLB as a Uint8Array.
Status contract
ready: source parameters were sufficient and no review issues remain;ready-with-assumptions: a model was generated, but defaults or warnings must be reviewed;needs-review: reliable entity generation was not possible, for example because units are unknown or no modelable footprint was found.
Unclassified or conflicting footprints are reported and omitted by default. Set includeUnclassifiedBuildings: true only when generic massing is acceptable.
License
GPL-2.0-only. See LICENSE and THIRD_PARTY_NOTICES.md.
