func (d *binaryDecoder) decode(ctx context.Context, m *go3mf.Mesh) error {
	mb := go3mf.NewMeshBuilder(m)
	var header binaryHeader
	err := binary.Read(d.r, binary.LittleEndian, &header)
	if err != nil {
		return err
	}
	mb.Mesh.Triangles.Triangle = make([]go3mf.Triangle, 0, header.FaceCount)
	nextFaceCheck := checkEveryFaces
	var facet binaryFace
	for nFace := 0; nFace < int(header.FaceCount); nFace++ {
		err = binary.Read(d.r, binary.LittleEndian, &facet)
		if err != nil {
			break
		}
		d.decodeFace(&facet, mb)
		if len(m.Triangles.Triangle) > nextFaceCheck {
			select {
			case <-ctx.Done():
				err = ctx.Err()
				break
			default:  
			}
			nextFaceCheck += checkEveryFaces
		}
	}
	return err
}
decode loads a binary stl from a io.Reader.
package stl
import (
	"context"
	"encoding/binary"
	"io"
	"github.com/hpinc/go3mf"
)
type binaryHeader struct {
	_         [80]byte
	FaceCount uint32
}
type binaryFace struct {
	_        [3]float32
	Vertices [3][3]float32
	_        uint16
}
type binaryDecoder struct {
	r io.Reader
}