Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

dvronin/m3dv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

m3dv

3D model viewer

This package is UI agnostic which means that you need to build it yourself. Viewer provides various properties and events to build own reactive viewer interface

engine image displayed in viewer

Install

use npm i m3dv to install this package

Usage

Viewer creation

You can simply create Viewer object

const canvas = document.getElementById("canvas") as HTMLCanvasElement;
const viewer = new Viewer(canvas);

Model loading

To load model file use LoadModelFile() method of Viewer object

viewer.LoadModelFile("fileNameWithExtension.gltf", "UrlToFile");

CAD models

In order to load CAD models you can specify wasm path to occt-import-js

const occtImportJsWasmPath = new URL("pathToWasm/occt-import-js.wasm", import.meta.url).href;
const viewer = new Viewer(canvas, { occtImportJsWasmPath: occtImportJsWasmPath });

see example folder to see basic usage of viewer

Showcase

IBL usage Isolated view Sections Exploded view

About

3D model viewer library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published