autodesk-forge

Accurate bounding box of an object

风流意气都作罢 提交于 2019-12-11 09:48:07
问题 I'm trying to create an accurate bounding box of an object, but it appears that if the object isn't aligned with the axis (I think) the box is not aligned with the object. For example: The pink and closer orange vertices are the Box3.min, Box3.max of this wall, but you see the red and green and blue are not on that wall. You can ignore the aqua vertices. This is the code that creates the bounding box (returns Box3): static getWorldBoundingBox(model, dbId) { return new Promise(async(resolve,

3D drawing in lines, not displaying 3D in Viewer

北慕城南 提交于 2019-12-11 08:17:51
问题 I have a 3D DWG drawing of only points and lines. I uploaded and translated it, with output format: 'type':'svf', 'views':[ '2d', '3d' ] In front end, geometryItems = Autodesk.Viewing.Document.getSubItemsWithProperties(document.getRootItem(), { 'type' : 'geometry', 'role' : '2d' }, true); Viewer shows 2D drawing, as if been flattened. If I change 'role' from 2d to 3d, viewer doesn't show up, because geometryItems.length == 0. Any way I can show 3D drawing with line/point in 3D, please? Thank

Modify Properties of a Model Autodesk-Forge

余生长醉 提交于 2019-12-11 08:05:33
问题 I am working on an app to upload a model, then retrieve and allow user to modify its properties via Excel/CSV/JSON. I see here that models are read only and that PATCH is not intended to allow direct modification of model object properties, but is more focused on documents. Is this understanding correct? If so, can Forge host JSON? The current plan is to export the data, modify in excel, upload/convert into JSON, store it (somewhere) and then display in Forge the properties from the JSON data

How to get coordinates i.e vertices from an object

大城市里の小女人 提交于 2019-12-11 07:36:44
问题 I am trying to get geometry data one element at a time such as vertices. What I tried so far: fragproxy = viewer.gui.impl.getFragmentProxy(model,fragid) gives me some kind of geometry, but not any vertices, which I can access by dbId frags = viewer.gui.model.getFragmentList() gives me a fragId to dbId map but no no connection from dbId to geometry Does anyone know a method to get the geometry with the vertices ? 回答1: The positions value of the following code snippets is the vertices what you

Problems with getting the properties of an ID when looping over all Ids

北城以北 提交于 2019-12-11 07:13:19
问题 I'm interested to get the properties of all dbId elements. For this purpose I'm simply looping over my array of dbIds and use the getProperties function provided by the Forge Viewer. someFunction() { const instanceTree = this.viewer.model.getData().instanceTree; const allDbIds = Object.keys(instanceTree.nodeAccess.dbIdToIndex); console.log('all DbIds'); console.log(allDbIds); // This will give the correct Properties // this.viewer.getProperties(5, (result) => { // console.log(result) // })

Autodesk Forge - How to stop recoloring of object when selected

最后都变了- 提交于 2019-12-11 06:58:49
问题 Our elements are color coded so when a user selects one we just want to isolate it in the views (which works as expected) BUT we don't want it to change to the selection color - where can we control this? 回答1: Use selection event to find which object has been selected, cancel the selection and isolate the selected dbId, is this the behavior you are looking for? AutodeskNamespace("Autodesk.ADN.Viewing.Extension"); Autodesk.ADN.Viewing.Extension.Basic = function (viewer, options) { Autodesk

viewer.impl.disableRollover(true); not working

落爺英雄遲暮 提交于 2019-12-11 06:54:30
问题 Seems like something changed in Forge's library as suddenly viewer.impl.disableRollover(true); has stopped working. Would anyone kindly confirm or deny this? 回答1: Try that: viewer.disableHighlight(true) Keep in mind that every method under viewer.impl. is NOT part of the public API and is subject to change from one version to another. 来源: https://stackoverflow.com/questions/47060059/viewer-impl-disablerollovertrue-not-working

Picking under elements of an element in Autodesk Forge viewer

心不动则不痛 提交于 2019-12-11 06:39:59
问题 I would like to accomplish a feature that I can do in Three.js but cannot in Autodesk Forge viewer. Here is the link to test: http://app.netonapp.com/JavaScript/Three.js/select_inner_objects.html The requirement is to select objects inside an object. This job can be done with THREE.Raycaster in the above demo, to use a raycaster to detect all elements which are on the line the ray going through. Then I can get objects behind or inner another object. I tried this concept in Autodesk Forge

Deleting a file from bucket. Autodesk-forge

懵懂的女人 提交于 2019-12-11 06:37:10
问题 There are problem with deleting a file from wip.dm.prod bucket ("errorCode": "AUTH-012"). But I can download current file by using -x GET instead of -x DELETE. I use this tutorial -> https://developer.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectName-DELETE/ . Attach an example below. Request curl -v https://developer.api.autodesk.com/oss/v2/buckets/wip.dm.prod/objects/de34f4c9-457c-4653-a9e4-8bbad12bf5ec.rvt -X DELETE -H "Authorization:Bearer

How to add custom environment map for background in autodesk forge?

落花浮王杯 提交于 2019-12-11 06:35:53
问题 I want to add environment map for background,I have tried viewer.setLightPreset(value) ,but I don't like the default map.I need to add custom environment map for background.I learned about Add Custom Light for the View and Data API Viewer,and added this code in my viewer Autodesk.Viewing.Private.LightPresets.push({ name: "selfEvn", path:"selfEvn", type:"logluv", tonemap:1, E_bias: -2.0, directLightColor: [0, 0.84, 0.67], ambientColor: [0.8, 0.9, 1], lightMultiplier: 0.1, bgColorGradient: [230