The ShapeHealing package contains a couple ShapeAnalysis- and ShapeFix-classes, meant to analyze shapes and fix them.

# ShapeAnalysis_Edge

## CheckVerticesWithPCurve

Checks, whether the distance of a specific vertex on the edge to its assigned point on its pcurve is smaller than the given "precision" value. If precision <0, the vertex's tolerance value is used. If **FALSE** is returned, the distance is **smaller** than the used precision value or no pcurve is present. If the distance is **bigger** than the used precision value, **TRUE** is returned.

By default, the first vertex is checked and precision is set to -1.0

## CheckVertexTolerance

Returns the minimal required vertex tolerances for both vertices.

## CheckSameParameter

Returns the minimal required edge tolerance based on the sameparameter assumption.

# ShapeFix_Edge

## FixRemovePCurve

Removes the PCurve if the vertex tolerance of the first vertex of the edge is inconsistent with its pcurve representation (It simply calls ShapeAnalysis_Edge::CheckVerticesWithPCurve using default arguments for vertex and precision). I don't know why it is only checking the first vertex?

## FixAddPCurve

A precision argument is passed which is used as accuracy argument for the projection of the curve3d onto the surface.

## FixVertexTolerance

Minimizes the vertex tolerances. If first calls ShapeAnalysis_Edge::CheckVertexTolerances and then sets the vertex tolerances accordingly.

## FixSameParameter

Checks the SameParameter requirement for the edge (using Brep_Builder::SameParameter) and increases the edge tolerance, if necessary.

***Important***:The edge tolerance is never decreased

What's odd is, that obviously ShapeFix_Edge does not provide any method to enforce the SameRange property of edges, although not fulfilling this can lead to catastrophic behaviour (Spline approximations created from edges not fulfilling the SameRange property can be born with 0 nodes…leading to problems in other algorithmus working with those curves…).

Use BRepLib::SameRange to enforce the SameRange property for an edge, use BRepLib::CheckSameRange to check it!

# ShapeFix_Wire

## FixLacking

# ShapeAnalysis_Wire

## CheckLacking

Test if two edges are disconnected in 2d according to the Adaptor_Surface::Resolution

# ShapeFix

## FixVertexPosition

Seems to try to translate vertices in order to minimize their vertex tolerance. You pass a tolerance argument. I assume the displacement is only considered for vertices whose tolerance is exceeding this tolerance argument.

I had problems to triangulate a shape which was processed using this routine. I suspect something broken during…