PATCH-G(1)

πŸ“¦
version 7.44.0 Β· 2 versions
, in nixpkgs unstable

πŸ’… PATCH-G(1) β€” the BRL-CAD glow-up manual πŸ’…

okay bestie, welcome to the patch-g(1) page, like literally the BRL-CAD corner of the man pages ✨


✨ NAME ✨

patch-g β€” the girlies' favorite way to convert a preprocessed FASTGEN target description into a BRL-CAD database πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

patch-g [options] model.g

🌸 DESCRIPTION 🌸

okay so patch-g converts FASTGEN target geometry into a BRL-CAD .g database, and it's giving main character energy fr fr πŸ’… FASTGEN is a modeling system used to create military target descriptions, and its primitives β€” triangles in volume and plate mode, plus wedges, spheres, boxes, cylinders, and rods β€” get reproduced by patch-g as NMG solids, BoTs (polysolids), or ARB6 solids. no cap, it ate πŸ”₯

the way that this works: your FASTGEN file must first be passed through the rpatch(1) preprocessor, which produces the intermediate .rp file that patch-g consumes. so like, patch-g only eats the preprocessed version, not the raw one, iykyk 🫢

the preprocessed input is read from standard input unless the -f option names a file, and the resulting geometry is written to the model.g database named as the sole positional argument. yes, sole, so don't go adding extras πŸ™ˆ

by default solids are written as NMG primitives; -p selects BoT (polysolid) output, and -6 converts plate-mode triangles to ARB6 solids. components are grouped into regions with a fixed number of unions each (peep -T and -A for the tolerances controlling vertex fusing and face merging, bestie). diagnostic messages are emitted when geometry cannot be converted; the -d option raises the verbosity, with higher levels producing more output. verbose queen πŸ‘‘


πŸ’– OPTIONS πŸ’–

  • -f fastgen.rp β€” read the pre-processed (through rpatch(1)) FASTGEN file instead of standard input. your "no stdin, thanks" option ✨
  • -n β€” process volume mode components as plate mode. switching it up, we love versatility πŸ’…
  • -u number β€” number of union operations per region (default 5). grouping math, iconic πŸŽ€
  • -c "x y z" β€” center of the object, in inches, used for some plate-mode surface normal calculations. the quotation marks are required to group the three values, so keep them, bestie, do not come for the quotes 😭
  • -t title β€” title for the output database (default "patch-g conversion"). name your baby 🍼
  • -o object_name β€” name of the top-level object, containing no spaces (default "all"). no spaces, fr fr, the spaces are not invited to this party πŸ™ˆ
  • -p β€” write volume- and plate-mode components as BoT (polysolid) primitives rather than NMG solids. the polysolid era 🌈
  • -6 β€” process plate-mode triangles as ARB6 solids (overrides -p for triangles). so it beats -p for triangles specifically, noted πŸ‘‘
  • -i group.file β€” read group label (region naming) information from the named file. labels! naming! slay 🏷️
  • -m mat.file β€” read material property information from the named file. materials, we stan a texture queen 🧚
  • -r β€” reverse the surface normals for plate-mode triangles. flip it, reverse it, make it go the other way πŸ’«
  • -d level β€” set the debug (diagnostic verbosity) level. higher numbers produce more diagnostic output (levels above 3 also write intermediate NMG solids to the database). and yes, that's a real side effect, not just chatty logging β€” levels above 3 actually write those intermediate NMG solids into the database 😭
  • -x flag β€” set the librt debugging flags (hexadecimal). hex digits only, we're fancy πŸ’œ
  • -X flag β€” set the NMG (librt) debugging flags (hexadecimal). same vibe, different flag, capital X energy ⭐
  • -T distance β€” vertex tolerance distance, in inches. two vertices closer together than this are treated as the same vertex. fusion time 🫢
  • -A tolerance β€” perpendicularity tolerance, given as the cosine of an angle (0.0 through 1.0). two unit vectors whose dot product is less than this value are considered perpendicular. trig girlies rise 🌸

πŸ”₯ EXAMPLES πŸ”₯

Example 1. Convert a FASTGEN target to a polysolid BRL-CAD database

rpatch < tank.fastgen > tank.rp
patch-g -p -f tank.rp -t "M1 Tank" -o tank tank.g

first rpatch(1) preprocesses the raw FASTGEN file into the intermediate tank.rp. patch-g then converts it, writing BoT (polysolid) geometry under a top-level group named tank, with a database title of "M1 Tank", into the new tank.g database that can be opened in mged(1). literally the whole pipeline, ate and left no crumbs πŸ”₯πŸ‘‘


πŸŽ€ SEE ALSO πŸŽ€

brlcad(1), rpatch(1), fast4-g(1), mged(1)

(the whole friend group 🫢)


πŸ’œ AUTHOR πŸ’œ

BRL-CAD Team β€” the icons behind the icon ✨


this software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory. like, legally iconic πŸ’…


πŸ“ BUG REPORTS πŸ“

reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. pls be nice about it, they're doing their best πŸ’–


and that's the tea, bestie β˜• this was the PATCH-G(1) page from the BRL-CAD manual set β€” check the source/version tag for the exact build you're running, mwah πŸ˜˜πŸ’‹

πŸ“¦ where this page comes from