0.0.7 • Published 6 years ago

ng-mesh-viewer v0.0.7

Weekly downloads
3
License
GPL-2.0+
Repository
github
Last release
6 years ago

Ng-Mesh-Viewer

This module will draw a 3D model from OBJ mesh geometry.

demo (Doesn't work in IE)

Install to Angular project

Install package npm i ng-mesh-viewer --save

Add to app.module.ts

import { MeshViewerModule } from 'ng-mesh-viewer';

@NgModule({
  imports: [
    ...,
    MeshViewerModule
  ]
})

Now Ng-mesh-viewer can be used anywhere using the tag.

<ng-mesh-viewer [data]="data">
</ng-mesh-viewer>

where data is an array of objects formatted in the following way:

{
    name: "item name", 
    uri: "item URI",
    geometry: "obj string",
    type: "Element or Zone",
    opacity: "optional opacity [0-1]",
    color: "optional color [defaults to random]"
}
TypeAttributeDescriptionRequired
InputdataArray of objects in the above formatx
InputtoolbarDisplay toolbar? Defaults to false
InputcentroidsDisplay centroids? Defaults to false
InputcolorsArray of key/val with {uri: "", color: ""}. By default random colors and 50 % opacity is used for zones and default material is applied to elements
OutputclickedRoomFired on room click. Returns the URI of the clicked room and the absolute coordinates based on the original geoJSON.
OutputclickedCanvasFired on canvas click. Use to clear selection or whatever.