1

I need to calculate volume and area of surfaces of 3D file. Since forge api can convert all kinds of 3D file to svf format, so If I can calculate area and volume from svf format file , then my program can handle all format 3D file that forge api support. But forge viewer doesn't have the api to calculate area and volume. Because forge viewer is based on THREE.js, so I guess if I can use THREE.js's api to calculate volume and area. I read the api of forge viewer, but there is no api to get geometry of THREE.js from forge view.

var viewables = Autodesk.Viewing.Document.getSubItemsWithProperties(doc.getRootItem(), {'type':'geometry'}, true);

I try this one, It's not geometry of THREE.js , but forge viewer's. It can't be used to calculate.

1
  • THREE.js doesn't have an API to calculate volume and area either (AFAIK), so I'm not quite sure what your approach is here. Any code for that purpose that is readily available from other SO answers should apply to any triangle-based geometry, so if you can figure out the Forge geometry format that should be doable. Commented Jul 11, 2017 at 14:08

1 Answer 1

1

Apologizing for the bad news, there is no API available for calculating area or volume in the Forge Viewer as I know, but you make some workaround by yourself.

For converting Forge fragment into THREE.Mesh, you can check here, here and here. For area calculation, you can refer some codes of the Forge Viewer in the Autodesk.Viewing.Extensions.Measure.Snapper.prototype.snapping3D and Autodesk.Viewing.Extensions.Measure.MeasureTool.prototype.getFaceArea.

Hope this help.

Sign up to request clarification or add additional context in comments.

1 Comment

Tks, and my problem is resolved with the help of your here, here and here. And other one ,<a href="stackoverflow.com/questions/23279521/…>, tks very much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.