ShapeDiver 3D Viewer

You are reading the documentation of the public API of the ShapeDiver 3D viewer v2. This is the result of a complete software redesign of ShapeDiver's 3D viewer v1. It offers the following advantages over v1:

  • new API v2 making use of promises
  • support for multiple simultaneous sessions with one or several ShapeDiver models
  • drag & drop, selection, highlighting
  • advanced rendering and materials
  • advanced control of the 3D scene (geometry and lighting)
  • support for multiple viewports
  • file/blob parameter types
  • AR support soon to be there

Read more about ShapeDiver and 3D product configurators.


API v2

The new API v2 offers numerous advantages over API v1:

  • supports promises and provides direct feedback of the result of asynchronous operations
  • consistent naming convention
  • support for changing of materials, and updating/adding of geometry
  • support for drag & drop, selection, and highlighting
  • support for configuration of the 3D scene lighting
  • support for multiple viewports
  • file/blob parameter types

API v1

The API v1 has been phased out and will not be available anymore from version 2.15.0.

Questions, feedback, bugs

Don't hesitate to ask questions and provide feedback, please use our forum for this purpose. Should you find a bug, please report it in our forum or email us.

Notice for developers

The JavaScript API objects might contain additional members or functionality which are not documented here. Do not use such undocumented functionality. Such additional functionality will likely be changed or removed by us between releases or patches without further notice.

Browser support

The ShapeDiver 3D viewer v2 supports the following browsers:

  • Chrome
  • Firefox
  • Edge
  • Safari
  • Internet Explorer 11
  • Modern Smartphones and tablets, Android and iOS

External dependencies

  1. THREE.js

WebGL based library used to create and display animated 3D computer graphics on a Web browser

  1. axios

    Alternative promise based standalone HTTP-client to replace jQuery

  2. verb-nurbs - optional

    verb is a library for creating and manipulating NURBS surfaces and curves in many languages including JavaScript

Release Notes

Version Release date Notes
------ -------------- ------------------
2.0.6 2018-07-01 API v2 available
------ -------------- ------------------
2.0.7 2018-08-22 Browser testing
------ -------------- ------------------
2.0.8 2018-08-30 Parameter history API
------ -------------- ------------------
2.1.0 2018-10-12 Multiple viewports, browser tested
------ -------------- ------------------
2.2.0 2018-11-23 oauth2 support
fixed iOS texture problems
fixed rendering of transparent objects
drag/selection/hovering handler now supports touch events
------ -------------- ------------------
2.3.0 2018-12-20 improved rendering for transparent objects
gems rendering
fixes to responsive layout of viewer and controls/settings containers
iframe API reflector supports addEventListener
diverse bugfixes
------ -------------- ------------------
2.4.0 2019-01-21 export dialog bugfix
CommPlugin error message improvements
viewport resizing fix
rendering bugfixes
------ -------------- ------------------
2.5.0 2019-02-01 anchor object documentation improvements and bugfix
------ -------------- ------------------
2.6.0 2019-03-01 THREE.LineSegments and THREE.LineLoop are supported now in addition to THREE.Line
IE11 support restored
Live transformations API
Fixed crash when loading empty scene
Pass on scroll events in case zooming is disabled
Added further properties to AnchorEventData
Support for settings for multiple viewports
new setting ignoreSuperseded for CommPlugin
fix in constructor SDVApp.ParametricViewer to allow an empty container array to be passed
new camera settings for auto adjusting and revert at mouse up
glb loader now uses browser cache
Settings widget light intensity sliders max value increased to 5
CommPlugin sent export requests instead of export-cache requests
Export modal dialog did not show message to user in case of download export not resulting in a downloadable file
Material defined for SceneAsset takes precedence over materials defined in SceneAssetItems.
------ -------------- ------------------
2.7.0 2019-03-15 bugfix in implementation of scene.updatePersistentAsync: all assets were being updated unnecessarily and faded out/in
bugfix in implementation of File parameter: default value was ignored
new setting scene.material.environmentMapResolution allows to configure image resolution used for environment map
performance improvement: environment map 'default' was always being loaded, even if another one was configured for a model
performance improvement: environment map and material preset images have been optimized for lower size
API documentation updates regarding supported image types
bugfix to drag & drop of transparent objects
bugfix to draggable objects restricted to a plane: the plane origin was being updated while dragging
bugfix: shadows were always being activated on change of light intensity
------ -------------- ------------------
2.8.0 2019-04-01 - bugfix in SDVReflector: return values containing an Error object did not pass through the iframe barrier,
this has been solved by passing the error message only and recreating an error object using that message
(information about the source location of the error gets lost, but the error message is preserved)
- API documentation: added clarifications about the exact firing criterion for some events
- Performance improvement: lowered resulting build size of the viewer bundle
- new API function scene.toggleGeometry for showing or hiding geometry based on scene paths
- prevent rendering of a single frame with opacity 1 when fading in geometry
------ -------------- ------------------
2.9.0 2019-04-12 - switched to using a forked version of THREE.js
- diverse significant performance optimizations regarding THREE.js
- material presets are loaded from central library on first usage
------ -------------- ------------------
2.10.0 2019-05-02 - new and improved implementation of the controls used for parameters and settings
please note that the following dependencies are not required anymore to be separately loaded for using the controls:
-- Font Awesome ( (not used anymore)
-- JQuery ( (will be loaded on demand)
-- Spectrum color picker ( (will be loaded on demand)
-- Sortable.js ( (internalized)
- support for rendering of gems, see api.scene.GemMaterialV1
- SVG images passed as data URI are now expected to be base64 encoded using the method as described on the following line,
which adds support for Unicode characters
- methods for base64 encoding and decoding of DOMStrings are available as api.utils.btoaUTF8 and api.utils.atobUTF8
- controls and settings panel now available in fullscreen mode, add property sdv-fullscreen='true' as shown in section usage
- bugfix: changed default text anchor positioning from 'top'/'left' to 'center'/'center'
- bugfix related to anchor elements and api.scene.convertTo2D for IE11
------ -------------- ------------------
2.10.1 2019-05-06 - garbage collection improvements
- bugfix: avoid unnecessary computation of intersections, dramatically improving framerate in case of anchors
- bugfix: color for lines working again
- iOS problem fix: usage of multiple spotlights was causing shader problems
------ -------------- ------------------
2.11.0 2019-05-25 - Tag3d data type API documentation improvement
- adjustable cube map resolution for gem rendering
- support for multiple viewer instances embedded directly
- API reflector supports multiple viewers embedded using iframe
- support for using viewer headless
- update to latest version of UIkit
- prevent beauty rendering kicking in between several updates in direct succession
- fix to iframe and demo pages: opening head tag was missing
- bugfix: bumpAmplitude and pointSize settings were not working correctly
- bugfix: further performance improvement regarding adding and removing anchors
- bugfix: fullscreen mode did not work in case of iframe embedding
- bugfix: corrected depth sorting for transparent objects
- bugfixes and improvements regarding the newly implemented controls used for parameters and settings
- bugfix: pass through touch events in case rotation is disabled
------ -------------- ------------------
2.12.0 2019-05-29 - A new setting Parameter Validation allows to operate the parameter widget in a mode which asks the user to commit or cancel
changes to parameter values before sending a computation request.
- This can be activated using the settings widget, or by setting the viewer constructor parameter commitParameters, see SDVApp.ParametricViewer.
- bugfix: camera setting Top View did not get restored properly in case it was stored as default for a model
- bugfix: the camera default position and target did not get stored in case of the orthographic camera (Top View)
------ -------------- ------------------
2.13.0 2019-06-07 - Release of the ShapeDiver Viewer AR API
- The functionality for applying transformations to viewports and plugins has been extended to support an array of transformations instead of just a single one.
Refer to setTransformation, applyTransformation, getTransformation, and resetTransformation in api.scene
- bugfix: avoid additional render calls while operating in continuous rendering mode
- bugfix in api.scene.resume: activate orbit controls only if they should be according to the settings
- fixed documentation of api.getRuntimeId()
------ -------------- ------------------
2.14.0 2019-07-19 - new light API allows to define light scenes, and adds new light types
- CAUTION: changes to the light API are breaking
- controls for lights allow to configure lights from the settings panel
- added support for loading glTF 2.0 files, see SceneAssetItemFormat GLTF
- new property format for scene assets, making it easier to filter scene assets by the format of their content
- extension of the material format MaterialV2 and MaterialV3 by a line material, allowing to configure dashed lines
- CAUTION: the dashed line material is currently not supported for indexed line or line segment geometry
- CAUTION: dashed lines do not work in all browsers, e.g. IE11
- removal of unnecessary property runtimeId from ANCHOR_ADD and ANCHOR_REMOVE events
(property scenePath can be used instead to uniquely identify anchors)
- bugfix: shadows were not updated properly during live transformations
- bugfix: live transformations were stopped on hover off
- bugfix: live transformations were failing in case of assets with empty content
- bugfix: the database of preset materials contained a wrongly configured materials
- bugfix: long parameter names were causing the parameter widget to become too wide
- bugfix: setTransformation and applyTransformation did not adjust the scene (shadow camera, lights, etc)
- improved documentation of properties of anchor events (coordinate properties containerX, containerY, clientX, clientY, pageX, pageY)
------ -------------- ------------------
2.15.0 2019-09-09 - performance improvement: caching of cube textures
- api.scene.getBoundingBox now supports computation of the bounding box of the complete scene
- now supports zooming to a given bounding box
- settings panel: included link to specific help pages for each section
- light settings: various usability improvements (zoom to light handles, improve visibility of light handles, default naming of new lights and scenes)
- control panel: custom components can be registered, allowing to create simple custom user interfaces
the following component types are supported for now (see codepen example for details):
button, checkbox, checklist, color picker, dropdown, file, group, modal, slider, static html, string, vector3
- settings panel: we added tooltips providing a short explanation of individual settings
- bugfix: control and settings panels: parameter components did not scale correctly on mobile
- bugfix: light settings: Boolean property Cast shadow of directional lights did not get initialized properly
- bugfix: light settings: coordinates of direction vectors and positions could not be entered
- bugfix: light settings: the hemisphere sky color did not work as expected
- bugfix: control and settings panels: sometimes the color picker was not working properly
- bugfix: control panel: long filenames made file parameter component become wider
- bugfix: control panel: commit parameter mode did not work as expected for sliders
- bugfix: settings and control panel layout fixes in landscape mode
- CAUTION: The API v1 has been phased out and will not be maintained from version 2.15.0 onward.
------ -------------- ------------------
2.16.0 2019-09-16 - support for React: see for an example
- extended by getPlacementAnchor, resetPlacementAnchor, setPlacementAnchor
- new AR event type OBJECT_PLACEMENT
- new properties runtimeId and anchorId for AREvent
------ -------------- ------------------
2.17.0 2019-10-15 - revised camera controls for perspective and orthographic camera, including:
-- consistent behavior across different devices and model sizes
-- additional settings for camera controls (see documentation of api.updateSettingAsync)
-- new type of perspective camera controls: fps (see setting
-- automated camera movements can now be disrupted, e.g. in case user wants to move the camera while it is reverting to its default position
-- fixes to several problems which had caused the previous controls to behave strangely
-- orthographic camera controls now support resizing of the container
- CAUTION: the revised camera controls cause the following breaking changes:
-- setting became
-- previously stored values for speed of zooming, panning, and rotating are being ignored
- new option for api.scene.updateAsync, allowing to enable blur during updates
- improved documentation of gemstone material
- TypeScript interface definition of the ShapeDiver Viewer API: npm install shapediver-types (will become an @types package soon)
- interactionMode of SceneAssets may now be set at arbitrary depths of the scene tree
- added support for starting external drag operations, see api.scene.startExternalDragEvent (example)
- new event type FRAMERATE (api.scene) for measuring the framerate
- speedup of loading process (prevent unnecessary render calls)
CAUTION: breaking change: fixed return type of to return an APIResponse
- iframe embedding example using deferred loading of geometry, see section usage
- fixes and improvements to API documentation
- bugfix to api.state.setBusy
- bugfix: justification of 3D text tags was ignoring spaces at the end of strings


  • Version: 2.17.0
  • Build date: 2019-12-11T15:34:00.999Z
  • Branch: 2.17.0
  • Commit: 4a8c56e4a9c4d7a887cee0f0f63988a6b35dcff4

ShapeDiver 3D Viewer, Copyright © 2015-2019 ShapeDiver GmbH. Documentation generated by JSDoc 3.6.3 on Wed Dec 11th 2019 using the DocStrap template.