Algorithm Search⌘K

Definitionintro

Geometric constraint

Also called dimensional constraint.

A relation between geometric elements, such as a distance, an angle, incidence, parallelism or tangency, that a sketch or an assembly must satisfy.

A geometric constraint is a relation between geometric entities, such as points, lines, circles, planes or rigid bodies, that a placement of these entities must satisfy. Typical constraints are a distance between two points, an angle between two lines, a point on a line, two parallel lines and a line tangent to a circle. In a CAD sketch the user draws an approximate shape and adds constraints, and a solver moves the entities until all constraints hold. Each constraint is a small set of equations in the coordinates, and these equations do not change when the whole sketch is rotated or translated. So a constraint fixes the shape, not the position of the sketch in the plane.

Definition

Fix the space Rd\mathbb{R}^d, with d=2d = 2 for a sketch and d=3d = 3 for an assembly. Let G\mathcal{G} be the group of proper rigid motions of Rd\mathbb{R}^d, the rotations followed by translations (special Euclidean group). Its dimension is D=d(d+1)/2D = d(d + 1)/2: 3 in the plane, 6 in space.

Entities. Each geometric entity has a type and a vector of real parameters. The number of free parameters is its degrees of freedom (DOF). A rigid motion acts on the parameters.

entity parameters DOF
point in the plane p=(x,y)p = (x, y) 2
line in the plane unit normal n=(cos⁡φ,sin⁡φ)n = (\cos\varphi, \sin\varphi) and offset hh, the line n⋅z=hn \cdot z = h 2
circle in the plane center cc and radius rr 3
point in space (x,y,z)(x, y, z) 3
plane in space unit normal and offset 3
line in space a direction and a point, up to the choice of the point 4
rigid body in space a rotation and a translation 6

A configuration is a choice of parameters for all entities, a vector x∈RNx \in \mathbb{R}^N, where NN is the sum of the DOF of the entities.

Constraint. A geometric constraint on entities e1,…,eke_1, \ldots, e_k is a system of equations

fj(xe1,…,xek)=cj,j=1,…,w,f_j(x_{e_1}, \ldots, x_{e_k}) = c_j, \qquad j = 1, \ldots, w,

in the parameters of these entities only, such that each fjf_j is invariant under G\mathcal{G}: fj(g⋅x)=fj(x)f_j(g \cdot x) = f_j(x) for all g∈Gg \in \mathcal{G}. The constants cjc_j are the values of the constraint, such as a length or the cosine of an angle; for a relation without a value, such as incidence, they are 0. The number ww of independent equations is the number of DOF that the constraint removes, its weight. Most constraints are binary (k=2k = 2). A constraint with k=1k = 1, such as a fixed radius, restricts the shape of one entity.

The planar constraints of most sketchers, with the equations used here, are these.

constraint entities equation weight
distance δ\delta two points p,qp, q ∣p−q∣2=δ2\lvert p - q \rvert^2 = \delta^2 1
incidence point pp, line (n,h)(n, h) n⋅p−h=0n \cdot p - h = 0 1
distance δ\delta to a line point pp, line (n,h)(n, h) n⋅p−h=±δn \cdot p - h = \pm\delta 1
angle θ\theta two lines n1⋅n2=cos⁡θn_1 \cdot n_2 = \cos\theta and a choice of sign 1
parallel two lines n1×n2=0n_1 \times n_2 = 0 1
perpendicular two lines n1⋅n2=0n_1 \cdot n_2 = 0 1
tangency line (n,h)(n, h), circle (c,r)(c, r) n⋅c−h=±rn \cdot c - h = \pm r 1
tangency two circles ∣c1−c2∣=r1±r2\lvert c_1 - c_2 \rvert = r_1 \pm r_2 1
coincidence two points p=qp = q 2

In space, the weights are: coincidence of two points 3, a point on a plane 1, a point on a line 2, two coincident planes 3, two coaxial lines 4, two parallel planes 2, and one each for an angle, a perpendicularity and a distance. Kinematic pairs, the joints of a mechanism, are constraints between rigid bodies of the same kind.

Signs and branches. Many constraints have more than one branch: a tangent line can touch the circle on either side, and an angle constraint does not say whether the second line turns to the left or to the right. The equation defines the union of the branches. A solver chooses a branch by a sign in the user's draft, for example the sign of the orientation test of three points, computed exactly. This choice is the root identification problem.

Degenerate values. The weight is the number of equations, and it is the rank of their Jacobian only at regular points. A distance of 0 is the main trap: over the reals, ∣p−q∣2=0\lvert p - q \rvert^2 = 0 forces p=qp = q, which removes 2 DOF, and the Jacobian of the equation is zero at every solution. CAD systems therefore treat a distance of 0 as a coincidence, with weight 2, and treat two parallel lines at angle 0 with the parallel constraint, not with the angle equation.

Examples and non-examples

  • A distance. The points p=(0,0)p = (0, 0) and q=(3,4)q = (3, 4) satisfy the distance constraint with δ=5\delta = 5, since 32+42=253^2 + 4^2 = 25. Rotate both points by 90 degrees about the origin to (0,0)(0, 0) and (−4,3)(-4, 3): the constraint still holds, because the squared distance is invariant.
  • A tangency. The line y=2y = 2 has n=(0,1)n = (0, 1) and h=2h = 2. The circle with center (5,0)(5, 0) and radius 2 satisfies n⋅c−h=−2=−rn \cdot c - h = -2 = -r, so the line touches this circle above its center. The circle with center (5,4)(5, 4) and radius 2 also satisfies the equation, with the other sign, and the line touches it below its center. The two choices are two branches of one constraint.
  • A bar. A set of points with distance constraints only is a bar-and-joint framework. Its theory of rigidity applies directly to such sketches.
  • Not a geometric constraint: a fixed coordinate. The condition "the xx-coordinate of pp is 3" is not invariant under translations. It ties pp to the frame of the sheet. A sketcher models it as a constraint between pp and a fixed entity, such as the origin or a grounded axis, which removes the rigid motions.
  • Not a geometric constraint: a side condition. The condition "pp is to the left of the line ll" is an inequality, not an equation. It does not remove a degree of freedom. Solvers use such conditions only to choose among the solutions of the equations.
  • Not invariant under reflections. An oriented angle of +30+30 degrees from l1l_1 to l2l_2 is invariant under proper motions but not under reflections. Distances are invariant under reflections too, so a system of distances only has the mirror image of each solution as a solution. For this reason the group here is the group of proper motions.

References

  1. Meera Sitharam, Audrey St. John and Jessica Sidman (editors), Handbook of Geometric Constraint Systems Principles, Chapman and Hall/CRC, 2018, the introductory chapters on geometric constraint systems, their entities and constraint types (general locator)
  2. Ioannis Fudos and Christoph M. Hoffmann, A graph-constructive approach to solving systems of geometric constraints, ACM Transactions on Graphics 16(2), 179 to 216, 1997, the planar entities (points and lines) and the distance, angle and incidence constraints of the solver (general locator)
  3. Glenn A. Kramer, Solving Geometric Constraint Systems, A Case Study in Kinematics, MIT Press, 1992, the geometric entities with their translational and rotational degrees of freedom, and the constraints between markers on rigid bodies (general locator)
  4. Christophe Jermann, Gilles Trombettoni, Bertrand Neveu and Pascal Mathis, Decomposition of geometric constraint systems, a survey, International Journal of Computational Geometry and Applications 16(5-6), 379 to 414, 2006, the definition of a geometric constraint system and the degrees of freedom of its objects and constraints (general locator)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/A0MCRT/text.yaml