Do you want to impose that cost on the control points in the convex regions? You can use the AddCost API.