constraint set constraint_name key [expression_parts ...]
constraint get constraint_name1 [constraint_name2 ...]
constraint show constraint_name1 [constraint_name2 ...]
constraint eval constraint_name1 [constraint_name2 ...]
constraint help [command]
CONSTRAINT(nged)
NAME
constraint - manage parametric geometric constraints stored on database objects
On this page
SYNOPSIS
DESCRIPTION
The constraint command manages parametric constraint data stored as attributes on database objects. Constraints represent dimensional and geometric relationships between geometry objects, such as coincidence, collinearity, tangency, or parametric formulas.
Constraints are stored as named attributes on database objects. The constraint command requires a database version 5 or later; older databases must be upgraded with dbupgrade first.
Subcommands
- set constraint_name key [expression_parts …]
-
Add or update the constraint attribute named
keyon the existing database objectconstraint_name. The expression value is assembled from all remaining argumentsexpression_parts. Theconstraint_nameobject must already exist in the database. - get constraint_name1 [constraint_name2 …]
-
Print the raw constraint attributes for one or more named objects. Output format per attribute:
object_name attribute_name value. - show constraint_name1 [constraint_name2 …]
-
Print the constraint attributes for one or more objects in a labeled, human-readable format. Each object name is printed as a header, followed by indented
attribute = valuepairs. - eval constraint_name1 [constraint_name2 …]
-
Evaluate (attempt to solve) the constraint attributes stored on the named objects. Requires a writable database.
- help [command]
-
Print extended help, including the full list of supported constraint expression types and entity functions.
Constraint Expressions
The following geometric constraint types are supported in expressions:
| Type | Description |
|---|---|
|
Specified entities stay connected. |
|
Straight edges are aligned along the same line. |
|
Circle/arc curves maintain the same center point. |
|
Specified entity is immutable with respect to the global coordinate system. |
|
Specified entities are parallel to each other. |
|
Specified entities are perpendicular (90° to each other). |
|
Specified entities have X/Y values set to match each other. |
|
Specified entities have Z values set to match each other. |
|
Specified entities maintain contact (point sets overlap without intersecting). |
|
Specified symmetry about an axis. |
|
Specified values are set equal in magnitude, length, or area. |
|
General parametric relationship using functions, variables, and values. |
Entity and Value Functions
| Function | Returns |
|---|---|
|
point |
|
point |
|
point |
|
value |
|
value |
|
value |
|
value |
|
value |
|
value |
|
value |
|
value |
|
value |
EXAMPLES
mged> constraint set c1 coincident_expr "coincident ell.V arb8.P[4]"
Stores a coincident_expr attribute on the existing database object c1.
mged> constraint set p0 formula_expr "formula ell.R[0]=10.0"
Stores a parametric formula on object p0.
mged> constraint get c1
Prints the raw constraint attributes of c1 in the form:
c1 attribute_name value
mged> constraint show c1 c2 c3
Prints the constraint attributes for c1, c2, and c3 with labeled headers and attribute = value format.
mged> constraint eval c3
Evaluates the constraint expression stored on c3.
mged> constraint help
Prints the full help text including all expression types, entity functions, and value functions.
SEE ALSO
cc(nged), attr(nged)
AUTHOR
BRL-CAD Team
BUG REPORTS
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org