简体   繁体   中英

Autodesk forge add geometry to model in browser

I am trying to create an online Revit viewer using Autodesk Forge APIs. The task I am trying to achieve is to be able to edit colors of existing geometry and also add new geometry to the model from the browser. Does anyone know how to do this, where I can get started, or if this is even possible?

Yes, you absolutely can edit colour and material of existing model geometry and aggregate models. I believe Philippe's gallery sample provides extensions that do both:

https://github.com/Developer-Autodesk/ng-gallery

If not, another of the GitHub samples does.

You should also check out the cloud and mobile DevBlog.

Here is a sample that edits materials within the Forge Viewer scene:

http://adndevblog.typepad.com/cloud_and_mobile/2016/08/ace-editor-for-threejs-shadermaterials-in-the-forge-viewer.html

Here is an article on adding Forge-translated OBJ models to a scene:

http://adndevblog.typepad.com/cloud_and_mobile/2016/08/loading-obj-files-translated-with-model-derivative-api-into-a-threejs-scene.html

Full model aggregation is discussed here:

http://adndevblog.typepad.com/cloud_and_mobile/2016/02/model-aggregation-with-view-data-api-exposed.html

Keep in mind the viewer is based on three.js, so to do things like adding custom meshes to the scene, it's pretty similar to what you would do in three.js. However your meshes will not be detected by the viewer selection logic, some extra work would be needed if you want that.

You can take a look at those two extensions for examples of adding meshes and changing material colors:

Autodesk.ADN.Viewing.Extension.MeshImporter

Autodesk.ADN.Viewing.Extension.Material

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM