## Generated by Codox

# Walkmap 0.1.0-SNAPSHOT

# walkmap.stl

Utility functions dealing with stereolithography (STL) files. Not a stable API yet!

### binary-stl

A codec for binary STL files

view source

### binary-stl-to-ascii

`(binary-stl-to-ascii in-filename)``(binary-stl-to-ascii in-filename out-filename)`

Convert the binary STL file indicated by `in-filename`, and write it to `out-filename`, if specified; otherwise, to a file with the same basename as `in-filename` but the extension `.ascii.stl`.

view source

### canonicalise

`(canonicalise o)``(canonicalise o map-kind)`

Objects read in from STL won’t have all the keys/values we need them to have. `o` may be a map (representing a facet or a vertex), or a sequence of such maps; if it isn’t recognised it is at present just returned unchanged. `map-kind`, if passed, must be a keyword indicating the value represented by the `z` axis (defaults to `:height`). It is an error, and an exception will be thrown, if `map-kind` is not a keyword.

view source

### centre

`(centre facet)`

Return a canonicalised `facet` (i.e. a triangular polygon) with an added key `:centre` whose value represents the centre of this facet in 3 dimensions. This only works for triangles, so is here not in `walkmap.polygon`. It is an error (although no exception is currently thrown) if the object past is not a triangular polygon.

view source

### decode-binary-stl

`(decode-binary-stl filename)``(decode-binary-stl filename map-kind)`

Parse a binary STL file from this `filename` and return an STL structure representing its contents. `map-kind`, if passed, must be a keyword indicating the value represented by the `z` axis (defaults to `:height`). It is an error, and an exception will be thrown, if `map-kind` is not a keyword.

NOTE that we’ve no way of verifying that the input file is binary STL data, if it is not this will run but will return garbage.

view source

### facet

A codec for a facet (triangle) within a binary STL file.

view source

### stl->ascii

`(stl->ascii stl)``(stl->ascii stl solidname)`

Return as a string an ASCII rendering of the `stl` structure.

view source

### stl?

`(stl? o)``(stl? o verify-count?)`

True if `o` is recogniseable as an STL structure. An STL structure must have a key `:facets`, whose value must be a sequence of polygons; and may have a key `:header` whose value should be a string, and/or a key `:count`, whose value should be a positive integer.

If `verify-count?` is passed and is not `false`, verify that the value of the `:count` header is equal to the number of facets.

view source

### vect

A codec for vectors within a binary STL file.

view source

### write-ascii-stl

`(write-ascii-stl filename stl)``(write-ascii-stl filename stl solidname)`

Write an `stl` structure as read by `decode-binary-stl` to this `filename` as ASCII encoded STL.

view source