Skizzierer Helfer Beschränkung

From FreeCAD Documentation
Revision as of 10:05, 17 August 2020 by Maker (talk | contribs) (Created page with "Die Hilfsbeschränkung ist eine reguläre Skizzenbeschränkung, die als Teil einer komplexeren Beschränkung benötigt wird, aber in der Benutzeroberfläche offengelegt wird,...")

Überblick

Beispiel einer Hilfsbeschränkung (Beschränkung5 - Punkt auf Kreis) für eine Tangentialbeschränkung (Beschränkung6; im Tangens über Punkt Modus). In diesem Fall wird nur eine Hilfsbeschränkung verwendet, da der Tangentenpunkt der Endpunkt des Ellipsenhauptdurchmessers ist, der von Natur aus auf der Ellipse liegt.

Die Hilfsbeschränkung ist eine reguläre Skizzenbeschränkung, die als Teil einer komplexeren Beschränkung benötigt wird, aber in der Benutzeroberfläche offengelegt wird, um den Umgang mit Redundanz zu erleichtern. Für die Beschränkung Snellius Gesetz müssen beispielsweise die beiden Linien, die Lichtstrahlen darstellen, verbunden werden (Deckungsgleiche Beschränkung), und die Verbindung muss auf der Benutzeroberfläche liegen (Punjkt Auf Objekt Beschränkung).

Helper constraints are added automatically when they are needed. The decision for if they are needed is currently made by evaluating the helper constraint error for current state of geometry (this may change in future versions). If the error is small enough, the constraint is considered to be unnecessary, and is not added. In some cases, this logic can lead to errors (the constraint can be satisfied by accident, which can easily happen when Sketcher Grid Snapping is on).

If this happens (a helper constraint is missing, and the required conditions is not satisfied otherwise), the complex constraint will be broken. It will do something, but the actual behavior is undefined. Such a broken constraint can be repaired by adding the missing helper constraint manually.

Helper constraints are currently required for:

Scripting

When constraints requiring helpers are added from Python, no helper constraints are automatically added. One can replicate the automatic decision-making of the UI commands in a script by testing the following functions, specifically added for the purpose and used in the UI routines:

Sketch.isPointOnCurve(icurve,x,y)

isPointOnCurve tests if a virtual point, given by sketch coordinates x,y (float values), happens to satisfy a virtual point-on-object constraint - i.e. lies on curve specified by curve index icurve. Returns True if the point is on curve, and False if it doesn't.

Sketch.calculateConstraintError(iconstr)

calculateConstraintError evaluates an error function of a constraint specified by its index iconstr in the sketch. If there is only one error function in the constraint, the return value is the signed return value of the error function. If there is more than one error function associated with the constraint (i.e. the constraint removes more than one degree of freedom), the return value is the RMS of all the error functions (always positive).

Version

Helper constraints were introduced in v0.15.4387