Overview
/
KCL Standard Library
/
Functions
/
solver::horizontalDistance

solver::horizontalDistanceFunction in std::solver

Constrain the horizontal distance between two points.

The distance is signed, so the order of the points matters: the value set with == equals the second point's X coordinate minus the first point's X coordinate. A positive value places the second point at a greater X than the first, and swapping the points negates the sign. For example, horizontalDistance([ORIGIN, point]) == 5mm places point at X = 5mm, while horizontalDistance([point, ORIGIN]) == 5mm places it at X = -5mm.

Arguments

NameTypeDescriptionRequired
points[Segment or Point2d; 2]Two sketch points, or one sketch point and ORIGIN. The value set with == equals the second point's X coordinate minus the first point's X coordinate, so the order of the points determines the sign.Yes
labelPositionPoint2dOptional position for the displayed constraint label in the sketch's local 2D coordinate system.No

Examples