'\" t
.\"     Title: BREP
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL-NS Stylesheets v1.76.1 <http://docbook.sf.net/>
.\"      Date: 08/28/2023
.\"    Manual: BRL-CAD MGED User Commands
.\"    Source: BRL-CAD
.\"  Language: English
.\"
.TH "BREP" "nged" "08/28/2023" "BRL\-CAD" "BRL\-CAD MGED User Commands"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
brep \- The \fBbrep\fR 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 purpose, the \fBbrep\fR command defines subcommands to organize these capabilities\&.
.SH "SYNOPSIS"
.HP \w'\fBbrep\fR\ 'u
\fBbrep\fR {\fIobj\fR} [\fIbool\fR | \fIbot\fR | \fIbots\fR | \fIbrep\fR | \fIcsg\fR | \fIflip\fR | \fIinfo\fR | \fIintersect\fR | \fIpick\fR | \fIplate_mode\fR | \fIplot\fR | \fIselection\fR | \fIsolid\fR | \fIsplit\fR | \fIshrink_surfaces\fR | \fItikz\fR | \fIvalid\fR] [\fIarguments\fR]
.SH "DESCRIPTION"
.PP
The
\fBbrep\fR
exposes a combination of BRep manipulation functionality both defined in the OpenNURBS libraries and implemented in BRL\-CAD\*(Aqs own libraries\&. Also handled by this command are a number of type conversions \- in particular,
\fBbot\fR
subcommands will generate meshes from BRep data and the
\fBcsg\fR
subcommand will attempt to find a CSG implicit representation of the shape of a specified NURBS BRep\&. Also, the
\fBbrep\fR
subcommand will attempt to generate a BRep representation of the specified CSG object\&.
.PP
A number of the problems these commands attempt to address are known to be extremely difficult problems \-
\fBbool\fR
is a particular case in point, but the
\fBbot\fR
and
\fBcsg\fR
commands also attempt to implement very challenging algorithms\&. Users using these commands should expect to encounter problems and are advised to first back up the \&.g file they will be operating on before applying them\&.
.PP
The available subcommands are:
.HP \w'\fBbool\fR\ 'u
\fBbool\fR {\fIop\fR} {\fIobj2\fR} {\fIoutput_objname\fR}
.PP
.RS 4
Attempt to peform a BRep boolean evaluation and produce a new BRep object\&. Supported ops are
\fIu\fR
(union),
\fI\-\fR
(subtract),
\fIi\fR
(intersect), and
\fIx\fR
(exclusive or)\&.
.RE
.HP \w'\fBbot\fR\ 'u
\fBbot\fR
.PP
.RS 4
Attempt 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 called
\fIobj\&.bot\fR
where
\fIobj\fR
is the original BRep object name\&.
.RE
.HP \w'\fBbots\fR\ 'u
\fBbots\fR {\fIop\fR} {\fIobj1\fR} [\fIobjN\fR...]
.PP
.RS 4
Attempt to produce triangle meshes for multiple objects that don\*(Aqt overlap\&. Experimental\&.
.RE
.HP \w'\fBbrep\fR\ 'u
\fBbrep\fR
.PP
.RS 4
Attempt to produce a brep object to represent the specified CSG object\&. Generally only useful for solid objects\&. Outputs the result in an object called
\fIobj\&.brep\fR
where
\fIobj\fR
is the original CSG object name\&.
.RE
.HP \w'\fBcsg\fR\ 'u
\fBcsg\fR
.PP
.RS 4
Attempt 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\*(Aqt be fully represented as CSG, it will be broken down into a combination of simplified BReps and CSG solids\&.
.RE
.HP \w'\fBflip\fR\ 'u
\fBflip\fR
.PP
.RS 4
Flip all face normals on the specified BRep\&. Can be useful if a conversion results in importing faces with the normals reversed\&.
.RE
.HP \w'\fBinfo\fR\ 'u
\fBinfo\fR
.PP
.RS 4
Report textual information about a BRep\&. See the brep_info man page for more detail\&.
.RE
.HP \w'\fBintersect\fR\ 'u
\fBintersect\fR
.PP
.RS 4
Calculate intersections between BRep object components\&. Primarly an option for low level testing of
\fBbool\fR
routines\&. See the brep_intersect man page for more detail\&.
.RE
.HP \w'\fBpick\fR\ 'u
\fBpick\fR {\fIE|F|V\fR} [\fIpx\ py\ pz\ dx\ dy\ dz\fR...]
.PP
.RS 4
Select 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 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\*(Aqs needed to do this right \- current method implemented as of 2022 probably won\*(Aqt reliably give us the actual closest face\&.)
.RE
.HP \w'\fBplate_mode\fR\ 'u
\fBplate_mode\fR [\fI#|cos|nocos\fR...]
.PP
.RS 4
Report and set plate mode properties of BRep objects\&. Will not work on a solid BRep \- to generate a plate mode BRep, see
\fBsplit\fR\&. If a number is supplied the plate thickness is set\&. Passing cos or nocos will toggle how an interseting ray should interpret the thickness as a function of ray hit angle \- nocos reports the same thickness for all angles, while cos attempts to adjust for shallow ray hits\&. If no options are supplied, just report the current thickness and cos/nocos setting\&.
.RE
.HP \w'\fBplot\fR\ 'u
\fBplot\fR
.PP
.RS 4
Visualize components and data associated with a BRep\&. See the brep_plot man page for more detail\&.
.RE
.HP \w'\fBselection\fR\ 'u
\fBselection\fR
.PP
.RS 4
Manipulate elements of a BRep\&. See the brep_selection man page for more detail\&.
.RE
.HP \w'\fBsolid\fR\ 'u
\fBsolid\fR
.PP
.RS 4
Report 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\&.
.RE
.HP \w'\fBshrink_surfaces\fR\ 'u
\fBshrink_surfaces\fR
.PP
.RS 4
Uses an opennurbs routine to tightening the definition of face surfaces to more closely match the uv paramater space of the trimming loops\&. typically this isn\*(Aqt something users will need to worry about too much, but it can occasionally improve the visualization behavior of an oddly defined brep\&.
.RE
.HP \w'\fBtikz\fR\ 'u
\fBtikz\fR {\fIoutput_file\fR}
.PP
.RS 4
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\&.
.RE
.HP \w'\fBvalid\fR\ 'u
\fBvalid\fR
.PP
.RS 4
Report if the BRep object is topologically valid\&.
.RE
.SH "AUTHOR"
.PP
BRLCAD\-TEAM
.SH "BUG REPORTS"
.PP
Reports of bugs or problems should be submitted via electronic mail to
devs@brlcad\&.org
