Calculating the Constraint System
The main task of C3D Solver is to satisfy the sketch constraint system, it is implemented using the
GCE_result GCE_Evaluate(GCE_system gSys)
The function returns the gSys constraint system calculation. The function does not execute any calculation operations if all constraints are satisfied at the time when it is called.
Returned values:
GCE_RESULT_Ok means that the constraint system is successfully resolved, and the solver assigned a new state meeting all given system constraints to all geometric objects.
GCE_RESULT_Overconstrained means that the function has discovered contradictory constraints during calculation, i.e. the constraint system has a subset, in which the constraints cant be satisfied at the same time. Geometry state remains unchanged.
GCE_RESULT_Not_Satisfied means that the function was not able to find a solution that meets all specified constraints. Geometry state remains unchanged. This diagnostic code is returned in the following situations:
a dimension is out of boundaries of the solution existence domain;
positions of fixed or frozen points are out of boundaries of solution existence domain;
in rare cases it is caused by poor initial approximation. Meeting the constraints requires considerable changes in parametric coordinates;
high mutual interference. For example, for such conditions if an angle is changed by one degree, then the object would offset to a considerable distance;
in rare cases, this results from lack of numeric robustness caused by dramatic difference between the dimensions of objects in one drawing, for example, when the smallest and the largest sketch objects differ by more than 7 orders of magnitude (as when one ellipse is 1 mm long and the other one is 10 km long);
in general case, it can be caused by other situations when the solution doesn’t exist or can’t be calculated.
GCE_RESULT_InvalidGeometry. The found solution leads to degradation of geometry objects (for example, a segment/arc has zero length, a circle/ellipse has zero radius). Geometry state remains unchanged. Occurs if a geometric object (circle/line segment/bounded curve) is prohibited from degeneration by means of the GCE_allow_zero_radius/GCE_allow_zero_length callback functions. And also, in general, without using a structure with callback functions GCE_callback_table or with this structure set by default.
GCE_RESULT_InvalidGeometry. The found solution leads to degeneration of geometric objects, for example, a segment or arc becomes zero length, and a circle or ellipse becomes zero radius. The geometry state remains unchanged. This situation occurs if the callback functions GCE_allow_zero_radius or GCE_allow_zero_length prohibit a geometric object (circle, segment, or bounded curve) from taking a zero radius or length. It can also occur generally if the callback function structure
GCE_callback_tableis used with default settings (without override via the GCE_Register call).