func Custom(facetNormals, facetPoints [][]float64, normalize bool) PolyhedralDistanceFunction {
	if len(facetNormals) != len(facetPoints) {
		panic("facet normal and facet points should have same length")
	}
	if len(facetNormals[0]) != len(facetPoints[0]) {
		panic("must have same dimentions")
	}
	facetdescripts := make([][]float64, len(facetNormals))

	for i := 0; i < len(facetdescripts); i++ {
		N := facetNormals[i]
		if normalize {
			N = vectorutil.Normalise(N)
		}
		facetdescripts[i] = vectorutil.Scale(vectorutil.DotProduct(facetNormals[i], facetPoints[i]), facetNormals[i])
	}

	return NewPolyhedralDistanceFunction(facetdescripts)
}
func (p PolyhedralDistanceFunction) getFacetDistance(d []float64, facet int) float64 {
	return vectorutil.DotProduct(p.facets[facet], d) / p.facetSqrLength[facet]
}