package main

import (
	"github.com/deadsy/sdfx/render"
	"github.com/deadsy/sdfx/sdf"
	"testing"
)

//var doveTail = DoveTail{
//	Size: sdf.V3{X: 10, Y: 8, Z: 2},
//	Angle: sdf.Pi/10,
//}
var buttonStruct = Button{
Size: 18,
Curve: 1.2,
HoleSpacing: 8.5,
Thickness: 1.0,
}

func TestButtonHolder3D(t *testing.T) {
	stl, err := ButtonHolder3D(&buttonStruct)
	if err != nil {
		t.FailNow()
	}
	render.RenderSTL(stl,300, "buttonHolder.stl")
}

func TestButtonNegative(t *testing.T) {
	stl, err := buttonNegative(&buttonStruct)
	if err != nil {
		t.FailNow()
	}
	render.RenderSTL(stl,300, "buttonNegative.stl")
}

func TestWireNegative(t *testing.T) {
	stl, err := wireNegative(&buttonStruct)
	if err != nil {
		t.FailNow()
	}
	render.RenderSTL(stl,300, "wireNegative.stl")
}

func TestDoveTail(t *testing.T) {
	stl, err := dovetail(sdf.V3{X: 10, Y: 8, Z: 2}, sdf.Pi/8, 0)
	if err != nil {
		t.FailNow()
	}
	render.RenderSTL(stl,300, "doveTail.stl")
}