A preoperative CAD based planning environment for cranial surgery