G-SHELL-RECT(1)
π G-SHELL-RECT(1) β the BRL-CAD girlie's guide
okay so bestie, you're holding the g-shell-rect(1) page from the BRL-CAD manual set, and honestly? it's giving "turn my solid model into a cute little mesh" and I am obsessed. let's get into it β¨
β¨ NAME β¨
g-shell-rect β build a triangulated shell from a BRL-CAD model by raytracing π¦
πΈ SYNOPSIS πΈ
g-shell-rect [-b] [-n] [-i _initial_ray_dir_] [-g _cell_size_] [-R _edge_tol_]
[-a "_tol min_x min_y min_z max_x max_y max_z_"] [-p _plotfile_]
[-d _debug_level_] [-X _nmg_debug_] -o _output.g_ _database.g_ _object_ ...
like, yes, that's a lot of brackets, but we'll walk through every single one together, no cap π
π DESCRIPTION π
g-shell-rect takes the object arguments you name from a BRL-CAD database.g and converts them into a single closed shell, which it writes out to a shiny new output.g geometry file. the output lands as either an NMG solid or a BOT β that's what the -b option is for, iykyk π
so how does it catch the shape? raytracing, obviously. rays get fired in a uniform grid, and the spacing of that grid is set by -g. the initial firing direction defaults to the principal axis with the largest projected bounding-box area, but you can force it yourself with -i if you have opinions (and you should π
).
the initial shell is built from only the first and last hit along each ray. and here's the tea: that tends to leave large faces whose normals are perpendicular to the firing direction π. so unless you pass -n, those faces get subdivided and refined by firing additional rays from the other two axis directions. slay.
the resulting mesh is an approximation of the original geometry, and it's genuinely useful for generating lightweight or watertight surface models from solid BRL-CAD objects. then you can keep cooking β output can be further processed with tools such as g-stl(1) or g-obj(1). periodt π
β¨ OPTIONS β¨
-ooutput.g β the name of the BRL-CAD geometry file to create. this one is required, bestie, no skipping it π«Ά-bβ output a BOT (Bag of Triangles) primitive instead of the default NMG (Non-Manifold Geometry) solid.-nβ skip the refinement stage entirely. you only get the initial coarse shell built from the first and last ray intersections; no rays are fired from the secondary and tertiary axis directions. fast and loose, we love her π-iinitial_ray_dir β force the initial ray direction. valid values areX,Y, orZ(case insensitive, she's chill like that). by default, the direction presenting the largest bounding-box area is chosen for you.-gcell_size β grid cell spacing in millimeters, and it controls resolution. the default is50.-Redge_tol β enable edge breaking (refinement) and set the edge tolerance used when subdividing faces. the default is0.-a"tol min_x min_y min_z max_x max_y max_z" β add a refinement bounding box (RPP). that single quoted argument supplies seven whitespace- or comma-separated numbers: an edge tolerance to use inside the box, followed by the minimum and maximum XYZ corners. may be repeated to add several boxes π-pplotfile β write a vdraw-style plot file recording the edge-breaking refinement steps. super useful for debugging the refinement, ngl.-ddebug_level β set the application debugging level. higher integers produce more diagnostic output, so crank it if you're nosy π₯-Xnmg_debug β set the NMG library debug flags. the value is read as hexadecimal, so don't come at her with decimal, she will not be fooled.-h,-?β print a usage message and exit. the classic escape hatch π
π¦ EXAMPLES π¦
Example 1. Generate a BOT shell and export it to STL
g-shell-rect -b -g 10 -o shell.g model.g hull
g-stl -o hull.stl shell.g shell
raytrace the hull region of model.g on a 10 mm grid, writing a Bag of Triangles named shell into the new database shell.g, then convert that shell to an STL file for use in external meshing or 3D-printing workflows. honestly? iconic π€©
Example 2. Force an initial direction and skip refinement for a quick approximation
g-shell-rect -n -i Z -g 25 -o quick.g engine.g block
build a coarse NMG shell of the block object using only first/last hits along Z-fired rays at 25 mm spacing, skipping the slower refinement pass. quick and cute, main character energy β
π SEE ALSO π
brlcad(1), g-stl(1), g-obj(1), rt(1), mged(1) β go read the whole friend group, they're all slay π§
π AUTHOR π
BRL-CAD Team
πΈ COPYRIGHT πΈ
This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.
π BUG REPORTS π
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β yes, real email, go tell them what's broken, they wanna know π
okay that's the whole page, you ate that π
and for the record, this is the BRL-CAD G-SHELL-RECT(1) page β BRL-CAD, dated 1989-2026 in the copyright, 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