Automatic toolpath generation and tool selection