BREP(nged)
The brep command is the primary means in BRL-CAD for working with NURBS boundary representation objects (a.k.a brep objects). Because there is a large amount of functionality implemented for thisβ¦
π BREP(nged) β the BRL-CAD MGED brep command, explained π
okay so bestie, welcome to brep, the main character of BRL-CAD when it comes to NURBS boundary representation objects (we call them brep objects, iykyk). There's like so much functionality stuffed in here that the command literally had to spawn subcommands to keep it all organized. it's giving "folder structure but make it unix." β¨
πΈ SYNOPSIS πΈ
brep {obj} [bool | bot | bots | brep | csg | flip | info | intersect | pick | plate_mode | plot | selection | solid | split | shrink_surfaces | tikz | valid] [arguments]
π¦ DESCRIPTION π¦
So brep exposes a whole combo plate of BRep manipulation goodies: some of it comes straight from the OpenNURBS libraries, and some is hand-implemented in BRL-CAD's own libraries. It also handles a bunch of type conversions, namely:
- the
botsubcommands will generate meshes from BRep data π - the
csgsubcommand tries to find a CSG implicit representation of the shape of a specified NURBS BRep - the
brepsubcommand tries to generate a BRep representation of the specified CSG object
π real talk: a bunch of the problems these commands try to tackle are known to be extremely difficult.boolis the poster child, butbotandcsgare also out here attempting genuinely challenging algorithms. Users using these commands should expect to encounter problems, and are advised to back up the.gfile they'll be operating on before applying them. no cap, please do the backup. π«Ά
β¨ the available subcommands β¨
boolβ attempts to perform a BRep boolean evaluation and produce a new BRep object. Supported ops areu(union),-(subtract),i(intersect), andx(exclusive or). π₯botβ attempts to produce a triangle mesh from the object. Unlike the visualization triangulation, this algorithm spends more time attempting to produce a solid, clean mesh. Outputs the result in an object calledobj.botwhere obj is the original BRep object name.botsβ attempts to produce triangle meshes for multiple objects that don't overlap. Experimental β you've been warned, bestie πbrepβ attempts to produce a brep object to represent the specified CSG object. Generally only useful for solid objects. Outputs the result in an object calledobj.brepwhere obj is the original CSG object name.csgβ attempts to produce a CSG hierarchy that reproduces the shape of the brep object. Objects will use the root of the original obj name to generate solid names. If a BRep can't be fully represented as CSG, it will be broken down into a combination of simplified BReps and CSG solids.flipβ flips all face normals on the specified BRep. Super useful if a conversion results in importing faces with the normals reversed. πinfoβ reports textual information about a BRep. See thebrep_infoman page for more detail.intersectβ calculates intersections between BRep object components. Primarily an option for low level testing ofboolroutines. See thebrep_intersectman page for more detail.pickβ selects the closest edge, face or vertex to either the specified ray, or to the currently defined GED view center and direction. (NOTE: for faces this is actually a rather difficult problem, requiring a solution to the closest NURBS surface point to a line problem. Not sure that even the LIBRT ray intersection code has what's needed to do this right β the current method implemented as of 2022 probably won't reliably give us the actual closest face. π)plate_modeβ reports and sets plate mode properties of BRep objects. Will not work on a solid BRep β to generate a plate mode BRep, seesplit. If a number is supplied the plate thickness is set. Passingcosornocoswill toggle how an intersecting ray should interpret the thickness as a function of ray hit angle:nocosreports the same thickness for all angles, whilecosattempts to adjust for shallow ray hits. If no options are supplied, it just reports the current thickness andcos/nocossetting. πplotβ visualizes components and data associated with a BRep. See thebrep_plotman page for more detail.selectionβ manipulates elements of a BRep. See thebrep_selectionman page for more detail.solidβ reports if the BRep object is solid (i.e. defines a closed volume in space, within tolerance). In the general case this is a hard problem β this report is helpful but may not catch all potential problems. π€shrink_surfacesβ uses an opennurbs routine to tighten the definition of face surfaces to more closely match the uv parameter space of the trimming loops. Typically this isn't something users will need to worry about too much, but it can occasionally improve the visualization behavior of an oddly defined brep. β¨tikzβ generates plotting output for the object using the TikZ plotting language. The output is intended for incorporation into documents being typeset with LaTeX and the PGF plotting package. πvalidβ reports if the BRep object is topologically valid. vibe check for topology, fr fr π
π OPTIONS π
-h,--helpβ print help for the selected brep subcommand. when in doubt, ask for help, bestie π«Ά-v,--verboseβ increase reporting verbosity for subcommands that support additional diagnostic output. more words! more lore! π£οΈ-C,--colorr/g/b β set the color used by subcommands that create plotted or highlighted output. aesthetic matters π--plotres# β set plotting resolution for subcommands that sample curves or surfaces for display output. crank it up for the pretty pixels β¨
β EXAMPLES β
Example 1. Inspect a few specific faces of a BRep object.
mged>brep hull.brep info F 0-3
Prints textual information for faces 0 through 3 of hull.brep, which is useful when checking face orientation, trims, or surface indexing before a repair step. literally the pre-repair glow-up inspection π§
Example 2. Split selected faces into plate-mode BReps with an explicit thickness.
mged>brep hull.brep split -t 1.5 -o hull_plate 4 5 6
Creates plate-mode output from faces 4, 5, and 6 of hull.brep with a default thickness of 1.5 model units, writing the result under the hull_plate naming root. ate and left no crumbs π
π AUTHOR π
BRLCAD-TEAM
π BUG REPORTS π
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. don't be shy, they wanna hear it π«Ά
okay that's the whole page, you're totally caught up bestie π this came to you straight from the BRL-CAD MGED User Commands set β the BREP(nged) page β so go forth and brep responsibly, and remember: back up that .g file first. 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