@viewar/room-planner
v1.6.1
Published
The room planner included in ViewAR's base6 template and sample app. To use this package you need to have the ViewAR API installed (https://www.npmjs.com/package/viewar-api).
Downloads
31
Keywords
Readme
ViewAR Room Planner
The room planner included in ViewAR's base6 template and sample app. To use this package you need to have the ViewAR API installed (https://www.npmjs.com/package/viewar-api).
For more information visit our developer portal at http://portal.viewar.com or our website at http://www.viewar.com.
Usage
Initialise with:
import viewarApi from 'viewar-api';
import createRoomPlanner from '@viewar/room-planner';
await viewarApi.init({appId: 'com.viewar.sdk'});
export const roomPlanner = createRoomPlanner(window);
Attach to a canvas:
// editor: The editor's div element.
// canvas: The canvas element to draw on.
// 'touchable': The html class that is touchable (for inserting windows or doors).
roomPlanner.attach(window.document, editor, canvas, 'touchable');
Export state to use with ViewAR SDK:
// Get state.
const exportState = roomPlanner.exportStateToCore();
// Create 3d representation.
await viewarApi.roomManager.addRoomToScene(exportState);