Introduction
SLC, introduced by 3D Systems around 1994 for rapid prototyping such as stereolithography, stores a model as cross-sections at ascending heights. Each layer is a list of boundaries drawn as polylines. The data may come from slicing a CAD model or from a source that is layered already, such as a CT scanner. The version described here is 2.0.
A file has an ASCII header, 256 reserved bytes, a binary sampling table and the binary contour layers.
Data types
| Type | Size | Encoding |
|---|---|---|
| byte, character | 1 byte | |
| unsigned integer | 4 bytes | Little-endian. |
| float | 4 bytes | IEEE single precision, little-endian. |
Header
The header is ASCII text made of keywords, each followed by its parameter. It ends with the three
bytes 0D 0A 1A (carriage return, line feed, Control-Z) and is at most 2048 bytes long,
including them.
| Keyword | Parameter |
|---|---|
-SLCVER | Format version, X.X; 2.0 for this layout. |
-UNIT | INCH or MM: the unit of the data. |
-TYPE | PART, SUPPORT or WEB. Part and support contours must be closed; web data may be open polylines or single segments. |
-PACKAGE | The program and version that wrote the file, chosen by the vendor; at most 32 bytes. |
-EXTENTS | minx,maxx miny,maxy minz,maxz of the model. |
-CHORDDEV | Chordal deviation used to make the data, if any. |
-ARCRES | Arc resolution used, in degrees, if any. |
-SURFTOL | Surface tolerance used, if any. |
-GAPTOL | Gap tolerance used, if any. |
-MAXGAPFOUND | Largest gap met while making the data. |
-EXTLWC | States any line width compensation the CAD program has already applied. |
Reserved section
The 256 bytes after the header’s terminator are reserved for future use.
Sampling table
The table gives the layer thickness for each range of heights. It starts with its number of entries in one byte (the specification speaks of up to 256 entries, although a byte counts only to 255). Each entry is 16 bytes:
| Offset | Type | Field |
|---|---|---|
| 0 | float | Minimum z: height at which this entry starts. In the first entry it is the height of the first contour layer. |
| 4 | float | Layer thickness. |
| 8 | float | Line width compensation wanted over this range. |
| 12 | float | Reserved. |
For example, a part starting at z = 0.4 and sliced at 0.005 up to z = 2.0 and at 0.010 from there on
has two entries: 0.4 0.005 0.004 0.0 and 2.0 0.010 0.005 0.0. The
thicknesses should be even multiples of one another.
Contour layers
Layers follow in ascending z. Each is:
| Type | Field |
|---|---|
| float | Minimum z of the layer. |
| unsigned integer | Number of boundaries. |
| per boundary: unsigned integer | Number of vertices. |
| per boundary: unsigned integer | Number of gaps. |
| per boundary: float × 2 × vertices | The vertices as x, y pairs. |
Boundaries
A boundary is a polyline closed by repeating its first vertex as its last. An exterior boundary runs counter-clockwise, with solid material inside it. An interior boundary runs clockwise, with solid material outside it. Where a boundary has gaps, each one is located at a vertex that is repeated.
Extent of a layer
A layer’s z is called a minimum because its contours stay in force, at the thickness given by the sampling table, until the next layer’s z or the top of the part. Identical layers need to be written only once.
Top of the part
The file ends with a float holding the maximum z and then the unsigned integer
FFFFFFFF where a layer would have its number of boundaries.
Example
-SLCVER 2.0 -UNIT INCH -TYPE PART … 0D 0A 1A header
00 × 256 reserved
01 one table entry
00 00 00 00 0A D7 23 3C 00 00 00 00 00 00 00 00 from 0.0, thickness 0.01
00 00 00 00 01 00 00 00 layer z 0.0, 1 boundary
05 00 00 00 00 00 00 00 5 vertices, 0 gaps
00 00 00 00 00 00 00 00 00 00 80 3F 00 00 00 00 (0,0) (1,0)
00 00 80 3F 00 00 80 3F 00 00 00 00 00 00 80 3F (1,1) (0,1)
00 00 00 00 00 00 00 00 (0,0)
00 00 80 3F FF FF FF FF top of part at z 1.0
Recognising a file
Look in the first 2048 bytes for the 0D 0A 1A terminator, with -SLCVER in
the text before it. The extension alone is not enough: Stratasys QuickSlice also used
.slc for a different, textual format, whose files begin Slice V9.
In the explorer
The viewer follows the 3D Systems description of SLC 2.0. It lists the header keywords, the sampling table, every layer, boundary and vertex, and the top of the part. The boundaries are drawn in 3D, in parts of two million lines, and each layer opens as a picture with exterior and interior boundaries in different colours. A vertex that repeats the one before it is marked as a gap.
Files up to 256 MB are read. The textual QuickSlice files that share the extension are a different format and are not read.
Links
Software
- Autodesk Netfabb – exports SLC in inches or millimetres, as part, support or web (Windows)
- Rhino – exports slices of a model as SLC (Windows, macOS)
Reference
- SLC – SLiCe format – Paul Bourke’s copy of the 3D Systems description, with a sample of the QuickSlice kind