Skip to main content

Create Sketches

Sketches can be used for your 2D visualizations or as a base for your 3D CAD features like extrusions and cuts.

In DynaMaker there are 4 basic ways to create your sketches:

tip

Read all about sketches and their CAD features in the library SKYCAD > Sketch

Templates

At the top of the editor, you can start from the templates via 2D Geometry > Template. Square, Circle, Triangle and Ring are available.

note

See that these templates are created within a function ready to be visualized.

Predefined Shapes

There are 4 shapes that can be drawn via the SKYCAD library. These are:

const rectangleSketch = SKYCAD.generateRectangleSketch(posX, posY, width, height)
const circleSketch = SKYCAD.generateCircleSketch(posX, posY, diameter)
const ellipseSketch = SKYCAD.generateEllipseSketch(a, b)
const hexagonSketch = SKYCAD.generateHexagonSketch(posX, posY, width)

DXF Files

Reuse your DXF files by upload them to your block via 2D Geometry > Sketch > Upload (.dxf), choose your DXF file, then Create.

note

Check the guide how-to-upload-files to upload multiple files to your app.

Custom

Usually a custom sketch starts as empty, then as if you are drawing it with a pen, you move to a point (i.e. pen not touching the paper) and then you draw a line or curve to a point (i.e. pen touching the paper):

tip

All curves are counter-clockwise defined by default (i.e. clockwise: false).

warning

If this sketch will be used for 3D CAD operations, make sure to close it with lineToId(0) or curveToId(0) at the end to ensure a closed path by going to the first node (i.e. with id 0) with a line or curve respectively.

  • Example of a triangle (closed):
const triangleSketch = new SKYCAD.Sketch()
triangleSketch.moveTo(0, 0)
triangleSketch.lineTo(100, 0)
triangleSketch.curveTo(100, 50, { clockwise: true })
triangleSketch.lineToId(0)
  • Example of a cross (open):
const crossSketch = new SKYCAD.Sketch()
crossSketch.moveTo(-50, 50)
crossSketch.lineTo(50, -50)
crossSketch.moveTo(-50, -50)
crossSketch.lineTo(50, 50)
  • Example of ring (closed with two sketches put together with sketchA.mergeSketch(sketchB))
const ringSketch = new SKYCAD.Sketch()
const outerCircle = SKYCAD.generateCircleSketch(0, 0, diameter)
ringSketch.mergeSketch(outerCircle)
const innerCircle = SKYCAD.generateCircleSketch(0, 0, diameter - thickness)
ringSketch.mergeSketch(innerCircle)
tip

Read more about boolean operations in 2D sketches.