This is a public 'mirror' version of forge viewer markup and measure extensions. Use webpack to build these extensions locally, then modify as desired.
Motivation: Forge customers can customize markup and measure tool
Here's a blog post on how to use the built-in features: https://forge.autodesk.com/blog/using-autodeskviewingmarkupscore-extension
Source: https://forge.autodesk.com/blog/viewing-large-ocrterrain-images-forge-viewer
But these APIs are limited. Sometimes you have to hack the viewer3d.js file, in order to achieve the behavior you want. For example, creating an SVG stamp tool (see examples below). It's not really possible without overriding large amounts of code with prototypes.
Instead, what if you could modify the existing markup and measure extensions, without touching viewer3d.js ? Well, here's how...
Use this mirror code, to build these extensions seperately. Then modify the extensions code as you need, seperate from the viewer3d.js file.
npm install webpack
npm install css-loader --save-dev
npm install style-loader --save-dev
npm install svg-url-loader --save-dev
webpack --config=webpack.js --env.BUILD_TASK=lmv-extensions --env.BUILD_PROD=true
this will create minified files under build/extensions/
:
Measure/Measure.min.js
Markup/Markup.min.js
which you can include in your index.html file, like this:
<script src="https://github.com/wallabyway/forge-markup-measure-extensions/raw/master/Measure.min.js"></script>
<script src="https://github.com/wallabyway/forge-markup-measure-extensions/raw/master/Markup.min.js"></script>
Edit2D extension: https://forge.autodesk.com/en/docs/viewer/v7/developers_guide/advanced_options/edit2d-use/