autodesk-forgeautodesk-viewerautodesk

Autodesk APS viewer Pan and zoom with SVG layer


I am writing an extension on Autodesk APS Viewer (forge), which adds an svg element on top of the model.

I succeeded on creating the svg, getting the bounds and viewbox from the viewer to feed my svg and append my geometry on it.

Unfortunately, when displayed the pan and zoom function of the viewer no longer works. If I hide my svg element I can pan and zoom again.

I cannot use the autodesk markup extension as I need to custom user interactions with the geometry.

Thanks for your help.

Louis-Marie Borione


Solution

  • You can try the approach described at https://aps.autodesk.com/blog/merge-pdfs-svg-lines

    That leverages BufferGeometry (refer to https://threejs.org/docs/#api/en/core/BufferGeometry) to draw geometries on top of the scene. Later, you can mimic those geometries as SVG and even print those in case of PDF files.

    For text, you can leverage TextGeometry, as done in https://aps.autodesk.com/blog/how-do-you-add-labels-forge-viewer