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.


<!-- ShapeDiver Viewer Main Container -->
<div id='sdv-container' class='shapediver-container-flex shapediver-container-fullsize'
  <!-- ShapeDiver Viewer Settings Controls Container -->
  <div id='sdv-container-settings' class='shapediver-settings-flex' style='display: none;'></div>
  <!-- ShapeDiver Viewer Viewport Container -->
  <div class='shapediver-viewport-flex'>
    <div id='sdv-container-viewport' class='shapediver-container-fullsize' style='opacity: 0;' 
         logginglevel=0 messagelogginglevel=2>
    <!-- The loading icon will be created here -->
  <!-- ShapeDiver Viewer Parameter Controls Container -->
  <div id='sdv-container-controls' class='shapediver-controls-flex' style='display: none;'></div>





                //defining effects for hoverable and draggable control points
var hoverDragEffect = {
    active: {
        name: 'colorHighlight',
        options: {
            color: [255, 0, 0]

//hoverable and draggable group
var controlPntsGroup = {
    id: "controlPnts_group",
    draggable: true,
    dragEffect: hoverDragEffect,
    hoverable: true,
    hoverEffect: hoverDragEffect,

var dragEndFunction = function (res) {
  var draggedControlPnt = res.scenePath.split(".")[2].split("_")[1];
  var currentJSON = JSON.parse(api.parameters.get({name:"tableCrvJSON"}).data[0].value);
  currentJSON.points[draggedControlPnt] = res.dragPosAbs;

// 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 settings = {
    modelViewUrl: "eu-central-1",
    showControlsInitial: true,
    showSettingsInitial: false,
  // See for all settings available via the constructor.
  window.api = new SDVApp.ParametricViewer(settings);
  let viewerInit=false;
  //wait for api to load
  api.scene.addEventListener(api.scene.EVENTTYPE.VISIBILITY_ON, function() {
    if (!viewerInit) {
      //add interaction group for control points

      //apply interaction group to control points
            id: api.scene.get({name:"ControlPnts",format:"glb"},'CommPlugin_1').data[0].id,
            interactionMode: "sub",
            dragPlaneNormal: { x: 0, y: 1, z: 0 }
      //add event listener for dragging control points
      api.scene.addEventListener(api.scene.EVENTTYPE.DRAG_END, dragEndFunction);

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