DynaMaker Docs

DynaMaker Docs

  • dynamaker.com
  • Account

›Other

Getting Started

  • Introduction
  • Dashboard
  • Before You Code

Training

  • Introduction
  • Tutorials

    • My First App
    • My First Drawing
    • My First Assembly
    • Presets, Test & Debug
    • User Interface
    • Factories

    How To

    • Download Files
    • Save & Load
    • Add Textures

Snippets

  • Introduction
  • Circular Pattern
  • Rectangular Pattern

Integration

  • Embedding
  • REST APIs
  • Quotations
  • Webhooks

Library

  • Introduction
  • SKYMATH
  • SKYSKETCH
  • SKYCAD
  • SKYPARAM
  • SKYUI
  • SKYDRAWING
  • PRESET
  • SKYEXPORT_POLY
  • STUDIO

Other

  • Changes 2021-02-17
  • Changes 2020-10-20
  • Did You Know...
  • FAQ

Changes 2020-10-20

This update to DynaMaker, which should not break any existing projects, focuses on making it easier to create and use geometry.

Deprecations

You will notice that some classes and functions that you've used previously have been deprecated. Deprecated classes and functions still work, but should be avoided in new code that you write.

Deprecation Example Deprecated classes and functions will appear as strikethrough in the editor

Action Events

The way that actions related to the product are called from the UI code has changed for new projects. The new way brings a better developer experience through code completion and type checking.

// old way
Studio.actionEvent('generate-configurator')

// new way
ACTIONS.generateConfigurator()

The Geometry API

The way that we create and group geometry (models and sketches) has changed with this update.

  • The new class SKYCAD.GeometryGroup should be used for grouping geometry (parent-child structure)
  • SKYCAD.ModelInstance should no longer be used as a parent of other models via addChildInstance()
  • ComponentInstance.getModelInstance() is replaced by ComponentInstance.generateGeometry() and now returns a SKYCAD.GeometryGroup
  • SKYCAD.GeometryOnPlane has been deprecated in favor of the similar SKYCAD.LayoutOnPlane
  • SKYCAD.Model has been renamed to SKYCAD.ParametricModel to differentiate it from SKYCAD.MeshModel
  • SKYCAD.ModelMaterial has been renamed to SKYCAD.Material

Geometry And The Component Handler

The component handler has been updated with some new functionality that makes it simple to gather all the geometry from your components!

componentHandler.generateAllGeometry(): SKYCAD.GeometryGroup
componentHandler.generateGeometry(componentType: string): SKYCAD.GeometryGroup
componentHandler.generateAllLightweightGeometry(): SKYCAD.GeometryGroup
componentHandler.generateLightweightGeometry(componentType: string): SKYCAD.GeometryGroup

These functions positions the geometry with respect to each component instance. They require that your components implement the generateGeometry() and generateLightweightGeometry() functions respectively.

Updating The Scene

For new projects, getModels() and getSketches() in the COMPONENTS tab of the application-maker have been replaced by updateGeometry() and updateLightweightGeometry(). This gives you more fine grained control over what geometry should update and when.

// the old way

export function getModels(manager: STUDIO.Manager) {
  // ...
}

export function getSketches(manager: STUDIO.Manager) {
  // ...
}
// the new way

/**
 * Add new Geometry to world depending on app state
 */
export function updateGeometry(data: STUDIO.DataForUpdateGeometry, worldControls: STUDIO.WorldControls) {
  const geometryGroup = new SKYCAD.GeometryGroup()

  switch (data.designStep) {
    case CONSTANTS.DESIGN_STEP.PRODUCT:
      geometryGroup.addGeometry(data.componentHandler.generateGeometry(CONSTANTS.COMPONENT_TYPE.MAIN))
      break
    case CONSTANTS.DESIGN_STEP.EXPORT:
      geometryGroup.addGeometry(data.componentHandler.generateGeometry(CONSTANTS.COMPONENT_TYPE.MAIN))
      break
  }

  worldControls.updateGeometry(geometryGroup, { groupId: 'primary' })
}

/**
 * Optional lightweight geometry
 */
export function updateLightweightGeometry(data: STUDIO.DataForUpdateGeometry, worldControls: STUDIO.WorldControls) {
  const geometry = data.componentHandler.generateAllLightweightGeometry()
  worldControls.updateGeometry(geometry, { groupId: 'lightweight' })
}

Instead of calling Studio.update() you should use Studio.requestGeometryUpdate() and Studio.requestLightweightGeometryUpdate() together with this new update geometry pattern.

Components And The Configurator

New components created from this point forward have a new pattern for generating their configurator(s). Instead of implementing the configure() function on the component, you should export one or more functions from the PARAMETERS tab in the component-maker.

Generate Configurator Functions You can switch between different configurators with the dropdown in the upper left corner

In the application, use the generator-functions to generate the configurator instead of calling configure().

// old way
export function actionEvent(type: string, args: any, manager: STUDIO.Manager) {
  // ...

  switch (type) {
    case 'configure-component': return component.configure()
  }
}

// new way
export function configureMainComponent() {
  const component = getMainComponent()
  return COMPONENT1.generateConfigurator(component)
}
← Changes 2021-02-17Did You Know... →
  • Deprecations
  • Action Events
  • The Geometry API
  • Geometry And The Component Handler
  • Updating The Scene
  • Components And The Configurator
DynaMaker Docs
Docs
Getting StartedTrainingLibrary
Community
LoginExamplesLinkedIn
More
HomepageBlogNews
Copyright © 2021 Skymaker AB