You can create a representation used in the following task: Using the Gradient Based Algorithm to Optimize Problems With Non Satisfied Constraints.
Volume.1=smartVolume(PartBody)
X= intersect (GS\Line.2, yz plane).coord(1)
fxy=(x-10)*(x-10) + (y-20)*(y-20) + 100