G-VRML(1)

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

πŸ’… g-vrml β€” your girl's guide to yeeting BRL-CAD geometry into VRML 2.0

okay so first things first: this is page one of the BRL-CAD manual, section 1, and it's literally called g-vrml. she converts stuff. she slays. let's get into it πŸ’–


✨ NAME ✨

g-vrml β€” convert a BRL-CAD geometry database to a VRML 2.0 file πŸ¦‹


🌸 SYNOPSIS 🌸

g-vrml [-b | -e] [-v] [-d calc_dist_tol] [-a abs_tess_tol] [-r rel_tess_tol] [-n norm_tess_tol] [-u units] [-x librt_debug_flag] [-X NMG_debug_flag] [-o output.wrl] database.g object [object ...]

like, that's the whole mood. database.g in, object(s) named, VRML out. periodt πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so g-vrml takes the objects you name from a BRL-CAD geometry database (database.g) and turns them into a faceted Virtual Reality Modeling Language (VRML) version 2.0 file. iconic behavior honestly.

by default, each region gets tessellated and its Boolean operations get evaluated through the NMG routines, which produces a triangulated IndexedFaceSet per region. region colors and shaders β€” plastic, glass, texture β€” get translated into VRML material and texture nodes, and regions using the light shader get emitted as VRML light sources. the way that all just… works 🫢

the result goes to the file you name with -o, or to standard output if you don't give -o. output units default to millimeters; peep -u if you want a different unit. and ngl, this conversion is the inverse direction of what importers like vrml-g would be β€” it complements other geometry exporters like g-stl(1) and g-obj(1). bestie squad of converters fr fr πŸ’œ


πŸ”₯ OPTIONS πŸ”₯

  • -b β€” dump BOT (Bag of Triangles) primitives straight to the VRML file with zero Boolean evaluation happening; non-BOT (CSG) primitives just get skipped. heads up: this is mutually exclusive with -e 🚫
  • -e β€” evaluate all the geometry, tessellating and doing the Boolean evaluation of both CSG and BOT primitives. also mutually exclusive with -b, pick a lane bestie πŸ’€
  • -v β€” verbose mode; reports conversion progress on standard error. she's chatty, we love her πŸ™ˆ
  • -d calc_dist_tol β€” calculational distance tolerance in millimeters, used to tell neighboring vertices apart. the default is 0.005 πŸ“
  • -a abs_tess_tol β€” absolute tessellation tolerance in millimeters (that's the maximum chord error). setting this disables the relative tolerance ⚠️
  • -r rel_tess_tol β€” relative tessellation tolerance, expressed as a fraction of the bounding box of each primitive. the default is 0.01 ✨
  • -n norm_tess_tol β€” surface normal tessellation tolerance in degrees (the maximum allowed angle between approximated and true surface normals). setting this disables the relative tolerance too ⚠️
  • -u units β€” units for the resulting VRML file. default is mm. literally any unit name BRL-CAD accepts works (for example m, cm, in, ft) 🌈
  • -x librt_debug_flag β€” set the librt debug flag (hexadecimal). see raytrace.h for the bit values πŸ”
  • -X NMG_debug_flag β€” set the NMG debug flag (hexadecimal). see nmg.h for the bit values πŸ”
  • -o output.wrl β€” write output to the named file. if you omit it, output goes to standard output 🎯
  • -h, -? β€” print a usage message and exit. the classic escape hatch 😌

🧚 EXAMPLES 🧚

Example 1. Convert specific tops objects to a VRML file

g-vrml -o havoc.wrl -u m havoc.g havoc

tessellates and Boolean-evaluates the havoc object from havoc.g and writes a VRML 2.0 model in meters to havoc.wrl β€” ready to load in a web or desktop VRML viewer. chef's kiss, no notes πŸ‘‘

Example 2. Export only the triangle meshes from a model

g-vrml -b -o meshes.wrl model.g body wheels

dumps the BOT meshes contained under the body and wheels objects directly, skipping CSG primitives and the comparatively slow Boolean evaluation. this is the move when a model is already mostly faceted and you just want a fast export ⚑


πŸ¦‹ SEE ALSO πŸ¦‹

brlcad(1), mged(1), g-stl(1), g-obj(1), g-dxf(1)

(the whole friend group, go say hi πŸ’•)


πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team β€” icons, legends, the whole vibe 🫢


This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.


🌺 BUG REPORTS 🌺

found a bug? a problem? a little oopsie? reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org πŸ“¬ β€” they wanna hear it, fr fr.


and that's the whole page bestie!! this was page G-VRML(1) from the BRL-CAD manual set, dated at the bottom like a little signature β€” same version, same date, same energy. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from