Skip to content

occt-import-js 0.0.25

Choose a tag to compare

@SunboX SunboX released this 09 Jun 20:15
· 18 commits to main since this release

Highlights

  • Adds faster binary import by copying input bytes through a typed-array memory view instead of per-element embind conversion.
  • Emits typed geometry arrays for imported meshes: Float32Array for positions and normals, and Uint32Array for indices.
  • Adds mesh metadata (vertex_count, triangle_count, and bounds) so consumers can avoid recalculating common statistics in JavaScript.
  • Adds compact BREP face color runs through brep_face_runs, plus brep_face_count and colored_brep_face_count metadata.
  • Adds an includeBrepFaces import option. Set it to false to skip full per-face export while retaining compact face-run data.
  • Improves XCAF/STEP face color handling by collecting presentation style settings, including surface, material, and curve colors.

ESP_12 Viewer

  • Updates the ESP_12 example viewer to consume the module build directly.
  • Uses compact face runs and shared materials for colored face rendering.
  • Disables edge rendering by default and switches to on-demand rendering to reduce work after model load.
  • Uses importer-provided bounds and count metadata to avoid expensive scene traversal and statistics recalculation.
  • Keeps the local example server covered with tests for the viewer route, wasm MIME type, bundled STEP model, and optimized rendering setup.

Release And Packaging

  • Bumps the package version to 0.0.25.
  • Removes generated dist/ files from git tracking and ignores dist/ in the repository.
  • Adds .npmignore so npm packages still include rebuilt dist/ files even though the repository ignores them.
  • Adds npm run rebuild:dist plus cross-platform wrapper scripts for rebuilding distribution files.
  • Adds a GitHub Actions workflow to rebuild and upload dist artifacts from main.
  • Updates the tag-triggered npm publish workflow to check out submodules, install with npm ci, rebuild dist, and publish the rebuilt package.

Tests

  • Adds coverage for typed geometry arrays, mesh bounds/count metadata, compact BREP face runs, optional full BREP face export, ESP_12 face presentation colors, viewer optimizations, and the dist rebuild wrapper.
  • Verified locally with:
    • npm run rebuild:dist (31 passing tests plus rebuilt distribution)
    • npm run test:esp12-server (5 passing tests)
    • npm pack --dry-run --json (confirmed JS, wasm, worker, and license files are included in the 0.0.25 package)