Functional representation and manipulation of shapes with applications in surface and solid modeling