Describe a Shape using SDL
Top  Previous  Next

After D2nc starts, you are presented with a clear black Shape Display Area and empty Shape Description Area below. The first task in D2nc is to describe a shape using Shape Description Language. This is accomplished by entering commands into the Shape Description Area. These commands are interpreted and the resulting shape is displayed in the Shape Display Area.

D2nc supports multiple shape sources. Currently there are two shape sources, SDL and DXF. Think of a shape source as a provider of geometry to D2nc's CAM engine. Once you have sourced a shape, steps 2 and 3, setting constraints and defining a tool path are the same.

clip0004

As an alternative to this tutorial for SDL shape entry, you can follow the tutorial Importing a shape from DXF.

We begin this first shape by introducing two commands. They are Draw and Heading. With these two commands we will describe the profile of a one inch or millimeter cube depending on your native units. The native units are displayed top right above the shape display area.

clip0002

All the following examples are sized appropriate for inches. If you're using metric you can switch to inch for this tutorial or substitute a "d25" wherever there is a "d1" used below.

Enter the following into the Shape Description Area:

d 1
h 90
d 1
h 90
d 1
h 90
d 1
h 90

which will produce the following display in the Shape Display Area.

clip0103

Let's examine what happened here. The first "d1" drew a line in the direction of the heading indicator. The "h90" caused the heading indicator to turn 90 degrees clockwise. The next "d1" drew a line in the direction of the heading indicator. This second line is at a right angle to the first line due to the change in heading. The second line started from where the first line ended.

Congratulations! You have completed your first shape. For more insight to SDL, consider the following:

The shape description you just entered can be optimized by using features of the language. The following shape descriptions describe the same shape you've just completed, a one unit square.

The setting of the heading can be specified using the optional heading parameter of the Draw command instead of a separate heading command.

d1,90
d1,90
d1,90
d1,90

The Repeat command has an inline block definition further simplifying the shape definition. Take the block enclosed by braces { } and repeat it four times

r{d1,90}4

There are many way to achieve the same thing in SDL as it is a language.

The next steps will be to define the constraints and a tool path to generate g-code. You may now proceed to the setting constraints or take a look at Importing a shape from DXF.