CONSTRAINT(nged)
manage parametric geometric constraints stored on database objects
π CONSTRAINT(nged) β BRL-CAD User Commands π
β¨ NAME β¨
constraint β manage parametric geometric constraints stored on database objects. literally the command that keeps your geometryβs relationships in check, bestie π
πΈ SYNOPSIS πΈ
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]
π¦ DESCRIPTION π¦
okay so 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. periodt β¨
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.
π¨ vibe check warning, bestie: database version 5 or later is the requirement. If yours is older, dbupgrade first. no cap π
π Subcommands π
set constraint_name key [expression_parts ...]β Add or update the constraint attribute namedkeyon the existing database objectconstraint_name. The expression value is assembled from all remaining argumentsexpression_parts. Theconstraint_nameobject must already exist in the database. no object, no update, sorry π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. raw data, straight up π«Ά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 indentedattribute = valuepairs. this is the cute, readable version β¨eval constraint_name1 [constraint_name2 ...]β Evaluate (attempt to solve) the constraint attributes stored on the named objects. Requires a writable database. writable database is the move here π₯help [command]β Print extended help, including the full list of supported constraint expression types and entity functions. when you need the whole lore drop π
π Constraint Expressions π
The following geometric constraint types are supported in expressions. The original table had Type and Description columns, and the cells got a little chaotic, so here every row is paired up clearly. Where the source table has no separate description line, Iβm saying so instead of inventing one iykyk π
.
coincident {point pointT}:T{ point edgeT} T{ edge edge}β Specified entities stay connected.collinear {line line}β Straight edges are aligned along the same line.concentric {circle circle}β Circle/arc curves maintain the same center point.fixed {pointT}:T{ edgeT} T{ faceT}:T{ object}β Specified entity is immutable with respect to the global coordinate system.parallel {edge edgeT} T{ edge faceT}:T{ face faceT} T{ object object}β (the source table has no separate description line for this row)perpendicular {edge edgeT}:T{ edge faceT} T{ face faceT}:T{ object object}β Specified entities are perpendicular (90Β° to each other).horizontal {point pointT} T{ edgeT}:T{ vector}β Specified entities have X/Y values set to match each other.vertical {point pointT} T{ edgeT}:T{ vector}β Specified entities have Z values set to match each other.tangent entity entityβ Specified entities maintain contact (point sets overlap without intersecting).symmetric {point pointT} T{ curve curve} lineβ (the source table has no separate description line for this row)equal entity entityβ Specified values are set equal in magnitude, length, or area.formula relationshipβ General parametric relationship using functions, variables, and values.
π¦ Entity and Value Functions π¦
okay so these are the little function besties you can drop inside your constraint expressions, and each one hands you back either a point or a value. literally just pick your fave, iykyk:
bisect(curve)β returns a point (yes bestie, the midpoint vibe) β¨center(surface)β returns a point (the center of a surface, iconic)centroid(object)β returns a point (the centroid of an object, no cap)angle(curve1, curve2)β returns a value (the angle between two curves π)area(surface)β returns a value (surface area, periodt)diameter(arccurve)β returns a value (diameter of an arc curve, slay)distance(entity, entity)β returns a value (distance between two entities)hdistance(entity, entity)β returns a value (horizontal distance, fr fr)length(curve)β returns a value (how long the curve is π )magnitude(vector)β returns a value (the magnitude of a vector, highkey useful)radius(arccurve)β returns a value (radius of an arc curve πΈ)vdistance(entity, entity)β returns a value (vertical distance, bestie)
β¨ EXAMPLES β¨
like, here's where it gets fun β real actual things you can type π«Ά
Example 1. Set a constraint attribute on an existing object
mged> constraint set c1 coincident_expr "coincident ell.V arb8.P[4]"
Stores a coincident_expr attribute on the existing database object c1. cute, done, no drama. π
Example 2. Set a formula constraint
mged> constraint set p0 formula_expr "formula ell.R[0]=10.0"
Stores a parametric formula on object p0. math is literally main character energy here π
Example 3. Get the constraints on an object
mged> constraint get c1
Prints the raw constraint attributes of c1 in the form: c1 attribute_name value β very raw, very honest, we respect it π
Example 4. Show constraints in readable form
mged> constraint show c1 c2 c3
Prints the constraint attributes for c1, c2, and c3 with labeled headers and attribute = value format. way easier on the eyes, ngl π
Example 5. Evaluate a constraint
mged> constraint eval c3
Evaluates the constraint expression stored on c3. go off, king π
Example 6. Get help
mged> constraint help
Prints the full help text including all expression types, entity functions, and value functions. the whole buffet, bestie π
πΈ SEE ALSO πΈ
cc(nged)attr(nged)
go read those too, they're giving supporting-character excellence β¨
π AUTHOR π
BRL-CAD Team
π BUG REPORTS π
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org
not me writing a whole sign-off but likeβ¦ this gorgeous page came from BRL-CAD and its name is CONSTRAINT(nged) π¦ if you made it this far you're literally a unix scholar, mwah π
βπ«Ά
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms