Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <html lang="en">

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>ShapeDiver API - First Example</title>
    <!-- ShapeDiver Viewer -->
    <script src=""></script>

    <!-- ShapeDiver Viewer Main Container -->
    <div id='sdv-container' style="width:100%;height:300px;">
      <label for="length">Length</label>
      <input id="length" type="range" min="120" max="216" step="1" value="162" onchange="changeLength(this.value)" oninput="this.nextElementSibling.value = this.value">
       <label for="depth">Depth</label>
       <input id="depth" type="range" min="109" max="133" step="1" value="133" onchange="changeDepth(this.value)" oninput="this.nextElementSibling.value = this.value">
      <button onclick=";">
    Recenter Camera
      <button onclick="exportFile();">
    Download 3D model
      <button onclick="getData();">
    Get Data
      <span id="dataresult"></span>





                // This example is compatible with the following ShapeDiver model:

// ShapeDiver Viewer Initialisation
var initSdvApp = function(/*event*/) {
  // Settings can be defined here, or as attributes of the viewport container. Settings defined here take precedence.
  let _container = document.getElementById('sdv-container'); 
  let settings = {
    container: _container,
    ticket: "85d9977f5426033e058a60c8b81c2c91d331d5eec7bdfed66d354132539d4efb0d01bd6e5d7bc61bc8894b820fff1922d2a2e7e6b7f5883d244f93f0c9ce73daa540ccd7b6d1a1d9ccc40307c3549ff3bbce1a7e902ac438abb53b472d73f2fd2578881f8846e73c4af238f34b9725c41232a2e3129d-d34ace0dbe577c6152ee63654b9e807c",
    modelViewUrl: "eu-central-1",
    brandedMode: true
  // See for all settings available via the constructor.
  window.api = new SDVApp.ParametricViewer(settings);

// there is a slight chance that loading has been completed already
if (document.readyState === "loading") {
  document.addEventListener("DOMContentLoaded", initSdvApp, false);
} else {

function changeLength(val) {
  api.parameters.updateAsync({name: "Couch Length (cm)", value: val});
function changeDepth(val) {
  api.parameters.updateAsync({name: "Depth (cm)", value: val});

function getData() {
  var res = api.scene.getData();
  document.getElementById('dataresult')[0].name + ": " +[0].data;

function exportFile() {
  api.exports.requestAsync({name: "Download 3D Model"}).then(
      let link =[0].href;
      console.log("Use this link to download the file: " + link);