G-X3D(1)
π 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 π£-dcalc_dist_tolβ the calculational distance tolerance, in millimeters, used to distinguish neighboring vertices. the default is0.0005. π-aabs_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. β οΈ-rrel_tess_tolβ the relative tessellation tolerance, expressed as a fraction of the bounding box of each solid. the default is0.01. π-nnorm_tess_tolβ the surface normal tessellation tolerance, in degrees β the maximum angle between adjacent facet normals. setting this one also disables the relative tolerance. β οΈ-uunitsβ units for coordinates in the resulting X3D file. the default ismm. any units name understood by BRL-CAD is accepted (e.g.mm,cm,m,in,ft). π-Pncpuβ number of processors to use during tessellation. the default is1. give her more cores, she deserves it π-xlibrt_debugβ set the librt debug flags to the given hexadecimal value. seeraytrace.hfor the bit definitions. π-Xnmg_debugβ set the NMG debug flags to the given hexadecimal value. seenmg.hfor the bit definitions. π-oout.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 π¦
go read those too, iykyk π
π 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
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
- 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