Autodesk Creative Platform Core Version 1.19.0
A broad and deep collection of 2D and 3D capabilities.

Sketch2D Overview

Creates an object that represents a 2D sketch. It contains an array of Path2D objects.

Introduced in Version: 1.1.0

Class Member Summary

Class Member Details

• Sketch2D ([other]) | Constructor

The following parameters can be specified in the constructor:
  • other: Array [ Path2D ] or JSON or Sketch2D - An array of Path2D objects, JSON received from the toJSON method, or another Sketch2D object. This will not create a copy if a Sketch2D is supplied. Throws exception if JSON not valid. | Optional

Box2D bounds()

Calculates the bounds of the Sketch2D object

Sketch2D clone()

Clones the Sketch2D object

Sketch2D combine (sketches) | Chainable

Combines this sketch with supplied sketch(es) or paths.

Array [ Path2D ] paths

The array of the Path2D objects.

Sketch2D projectBoundary (boundary, projection) | Chainable

Projects a boundary onto the sketch as an additional Path2D object.
  • boundary: Mesh3DBoundary - A boundary to project onto the Sketch2D.
  • projection: Matrix3D - The projection matrix to use for the projection.


Returns the JSON representation of the object that can be serialized. The resulting JSON can be passed into the constructor later on to reconstruct the object.

Array [ Array [ Number ] ] toPolygons ([tolerance])

Gets an array of connected path outlines for all the paths in the sketch. If the first and last points are the same then the path is closed.
  • tolerance: Number - A chord height deviation to use for discretizing nonlinear curves. | Optional

Sketch2D transform (matrix) | Chainable

Transforms all the paths in the sketch by the transform.

WindingRule windingRule | Default: WindingRule.NonZero

The winding rule that determines the interior of the sketch.