ng-mesh-viewer
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

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]"
}
Type Attribute Description Required
Input data Array of objects in the above format x
Input toolbar Display toolbar? Defaults to false
Input centroids Display centroids? Defaults to false
Input colors Array of key/val with {uri: "", color: ""}. By default random colors and 50 % opacity is used for zones and default material is applied to elements
Output clickedRoom Fired on room click. Returns the URI of the clicked room and the absolute coordinates based on the original geoJSON.
Output clickedCanvas Fired on canvas click. Use to clear selection or whatever.

Readme

Keywords

none

Package Sidebar

Install

npm i ng-mesh-viewer

Weekly Downloads

0

Version

0.0.7

License

GPL-2.0+

Unpacked Size

547 kB

Total Files

26

Last publish

Collaborators

  • madsholten