autodesk-viewer

Forge Viewer THREE.MeshLambertMaterial

老子叫甜甜 提交于 2019-12-02 13:38:13
One of the properties available on the var material = NEW THREE.MeshLambertMaterial is texture maps: {( map: new THREE.TextureLoader().load('wool.jpg') )} We're very curious whether it would be possible to load in a texture this way and apply it to a specific object in the model? Yes, but the way you modify materials in the Forge Viewer is a little bit different than what you would do in Three.js. I have an extensive sample that illustrates how to modify materials, including custom textures here: Viewing.Extension.Material The live demo is there . To use it, load a model first with "Model

Autodesk Forge Viewer How to get coordinates of line start/stop

故事扮演 提交于 2019-12-02 10:25:28
问题 I am trying to do room highlighting in forge viewer. In revit I have created lines that represent the borders of a room. After conversion to svf I know the dbids of those lines. Now I want to know the start and stop points (vertices) of those lines so that I can create a Three.Shape() of the room borders. [EDIT] I get the fragId from dbId function getFragIdFromDbId(viewer, dbid){ var returnValue; var it = viewer.model.getData().instanceTree; it.enumNodeFragments(dbid, function(fragId) {

How to declare reference to an existing namespace which is available from javacript bundle at runtime

倾然丶 夕夏残阳落幕 提交于 2019-12-02 08:36:32
问题 I am writing a plugin for existing Javascript app - Forge Autodesk.Viewing After version 6 they have included THREE.js inside of their app bundle. Right now I'm able to use it with my plugin like this: declare var THREE:any; But I'm loose all types. So, I am install three.js by npm install --save three I'm able to use THREE, and import it. But I don't need to Import it as I already have it in my main app. What I need to do is to reference types. So, I tried to do something like this: declare

Default Navigation speed in Forge Viewer

怎甘沉沦 提交于 2019-12-02 08:27:11
问题 How can the default navigation speed be changed in the Forge Viewer? The default setting is far to fast for my sample models. I should like to write code so that the speed may be changed during a session. 回答1: Copy an existing navigation tool from the viewer3D.js implementation, modify the speed parameters as you wish or expose methods to do so dynamically from your app, then set it active. You can check the implementation of OrbitDollyPanTool L#14545 in viewer3D.js Autodesk.Viewing

How Autodesk Forge viewer manages multiple scenes to select multiple elements

可紊 提交于 2019-12-02 07:59:00
问题 I want to understand how Autodesk Forge viewer stores node elements in multiple THREE.Scene objects. There are several scenes: viewer.impl.scene // The main scene viewer.impl.overlayScenes // Three overlay scenes: selection, pivot and roll Whenever an element is selected in Forge viewer, its THREE.Mesh object is added to viewer.impl.overlayScenes.selection.scene.children. However its boundary geometry is always zero, unlike primitive THREE.Mesh objects will have boundaries after executing

setThemingColor only working for leaf node dbIds

回眸只為那壹抹淺笑 提交于 2019-12-02 05:21:11
From the documentation it looks like you should be able to call setThemingColor with any dbId, but it seems to only work if the id that you pass is a leafnode? Is this correct? Also is there any way to bulk call this method, or is it only one single leaf node at a time? I would like to pass an array of dbId's into the method. Yes, it's only working with the leaf nodes in my experience. However, leaf nodes of a parent node can be retrieved in this way: getLeafNodes( model, dbIds ) { return new Promise( ( resolve, reject ) => { try { const instanceTree = model.getData().instanceTree dbIds =

How to Retrieve Forge Viewer objectTree?

丶灬走出姿态 提交于 2019-12-02 05:15:16
问题 My goal is to highlight a room by adding new geometry to the viewer based on lines I have created in revit like they do here Link but i can not figure out how to access those lines ids. I know what they are in revit (element_id) but not how they are mapped as dbid. Following this Blog Post I want to access the objectTree in my extension to find out, but it always comes back as undefined. var tree; //old way - viewer is your viewer object - undefined viewer.getObjectTree(function (objTree) {

Forge Viewer fails to dispaly PDF's

倾然丶 夕夏残阳落幕 提交于 2019-12-02 05:14:43
I am using the sample C# SDK for using the Forge Derivative service and viewer. I've been successful with using any document but not with PDF. All the PDF's I've tried, translated successfully but it gives the following error when attempting to view. Failed to load resource: the server responded with a status of 404 (Not Found) three.min.css Uncaught TypeError: Cannot read property 'paperUnits' of undefined I just bumped into this myself. Please try with ViewingApplication object for initialization instead of basic viewer. The way shown in Basic Viewer requires additional configuration values

How Autodesk Forge viewer manages multiple scenes to select multiple elements

给你一囗甜甜゛ 提交于 2019-12-02 03:09:23
I want to understand how Autodesk Forge viewer stores node elements in multiple THREE.Scene objects. There are several scenes: viewer.impl.scene // The main scene viewer.impl.overlayScenes // Three overlay scenes: selection, pivot and roll Whenever an element is selected in Forge viewer, its THREE.Mesh object is added to viewer.impl.overlayScenes.selection.scene.children. However its boundary geometry is always zero, unlike primitive THREE.Mesh objects will have boundaries after executing geometry.computeBoundaryBox() Because of the zero boundary of Forge elements, I cannot use THREE.Raycaster

Getting webGL error in autodesk viewer

筅森魡賤 提交于 2019-12-02 02:32:25
I am getting error like: Uncaught TypeError: Cannot read property '__webglFramebuffer' of null when i am going to another page linked with the page which has autodesk viewer attached . I dont know why it is coming . I am using angularjs for my web site and there is no code in controller of that page about viewer. You are getting this error because you do not destroy the viewer instance on the page you left, so when receiving event such as page resize the viewer will try to re-render and since the WebGL context has been destroyed it will fire this error. Simply place some cleanup handler called