G-X3D(1)

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

πŸ’… G-X3D(1) β€” the BRL-CAD manual, bestie edition πŸŽ€

okay so you've got a .g file and you want it to be a whole vibe on the internet. this is the page for that. it's g-x3d from the BRL-CAD manual set, and honestly? she's iconic. ✨


✨ NAME ✨

g-x3d β€” convert BRL-CAD geometry to an X3D faceted model πŸ¦‹


🌸 SYNOPSIS 🌸

g-x3d [-v] [-d _calc_dist_tol_] [-a _abs_tess_tol_] [-r _rel_tess_tol_] [-n _norm_tess_tol_] [-u _units_] [-P _ncpu_] [-x _librt_debug_] [-X _nmg_debug_] [-o _out.x3d_] _model.g_ _object(s)_

πŸ’– DESCRIPTION πŸ’–

so here's the whole thing, no cap: g-x3d evaluates the Boolean operations defined by the named regions in a BRL-CAD database (.g) file, tessellates the resulting geometry into NMG faceted form, and writes it as an X3D (Extensible 3D) scene. that's the main character energy right there. πŸ‘‘

every non-light-source region gets emitted as its own separate X3D Shape with an IndexedFaceSet, and region colors (or the default per-thousand region-id colors) get written out as X3D Material nodes. so your geometry shows up looking correct and dressed cute. πŸŽ€

the output goes to the file you name with -o, or to standard output otherwise. yes, stdout. she streams. 🫢

also worth knowing: g-x3d is a modified version of g-vrml(1) and shares its shader and material handling β€” so reach for this one when you want an XML-based X3D scene instead of classic VRML. same soul, newer aesthetic. ✨


πŸ”₯ OPTIONS πŸ”₯

  • -v β€” turn on verbose output, which reports region conversion progress on standard error. she'll narrate her journey ngl πŸ“£
  • -d calc_dist_tol β€” the calculational distance tolerance, in millimeters, used to distinguish neighboring vertices. the default is 0.0005. πŸ’…
  • -a abs_tess_tol β€” the absolute tessellation tolerance, in millimeters β€” that's the maximum chord error permitted between an approximating facet and the true surface. heads up: setting this disables the relative tolerance. ⚠️
  • -r rel_tess_tol β€” the relative tessellation tolerance, expressed as a fraction of the bounding box of each solid. the default is 0.01. πŸ“
  • -n norm_tess_tol β€” the surface normal tessellation tolerance, in degrees β€” the maximum angle between adjacent facet normals. setting this one also disables the relative tolerance. ⚠️
  • -u units β€” units for coordinates in the resulting X3D file. the default is mm. any units name understood by BRL-CAD is accepted (e.g. mm, cm, m, in, ft). 🌈
  • -P ncpu β€” number of processors to use during tessellation. the default is 1. give her more cores, she deserves it πŸ’€
  • -x librt_debug β€” set the librt debug flags to the given hexadecimal value. see raytrace.h for the bit definitions. πŸ”
  • -X nmg_debug β€” set the NMG debug flags to the given hexadecimal value. see nmg.h for the bit definitions. πŸ”
  • -o out.x3d β€” write the X3D output to the named file instead of standard output. πŸ“
  • -h, -? β€” print a usage message and exit. the classic escape hatch πŸ™ˆ

🧚 EXAMPLES 🧚

⭐ Example 1. Convert selected regions to an X3D file

g-x3d -o havoc.x3d -u m -r 0.005 havoc.g havoc

this tessellates the region tree rooted at object havoc in havoc.g using a relative tolerance of 0.005, scales the output to meters, and writes the resulting X3D scene to havoc.x3d for viewing in a web browser or X3D viewer. she ate. πŸ’…πŸ”₯

⭐ Example 2. Stream output through a pipeline

g-x3d -P 4 sample.g comp1 comp2 > parts.x3d

this converts two named objects using four processors and redirects the X3D scene to parts.x3d. and because output defaults to standard output, g-x3d can be chained with other tools in a pipeline. pipeline girlie behavior, we love to see it 🫢✨


πŸ¦‹ SEE ALSO πŸ¦‹

brlcad(1), g-vrml(1), mged(1)

go read those too, iykyk πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team πŸ’–


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

don't be shy, they're genuinely nice about it fr fr πŸ™ˆ


ok that's the whole page bestie, every flag intact, nothing skipped, mwah πŸ’‹

later~ this was the G-X3D(1) page from the BRL-CAD set πŸŽ€ β€” go be iconic with your faceted models βœ¨πŸ¦‹

πŸ“¦ where this page comes from