Optimesh requires prescribed nodal displacements along the boundary of the domain being remeshed. Ansys Polydata does this automatically by relocating nodes along 1D boundaries using a proportionality rule, just as it does for the Thompson transformation.
In 2D, you will need to introduce boundary conditions for the field, as discussed in Thompson Transformation and User Inputs for Remeshing. Ansys Polydata will
then relocate nodes along 1D boundary segments in such a way that the curvilinear
abscissa of the node is maintained. This constraint serves as a boundary condition
for the Optimesh remeshing rule. In the normal direction, nodes are located in such
as way that the kinematic condition is satisfied. In 3D, a different strategy is
used. Along boundaries of the remeshing domain, the normal displacement is
prescribed by the kinematic condition (for a free surface) or imposed to zero (for
all other cases). In the tangential direction, nodes are relocated by the Optimesh
technique to satisfy the equilibrium of forces.