add the triangle/xxx family of functions, and unify all the triangle-creating functions in the kernel