OBJ-G(1)
π OBJ-G β the BRL-CAD manual, section 1 β¨
okay bestie, buckle up β this is obj-g, a BRL-CAD manual page (section 1, the "user commands" shelf, iykyk) and it's literally the glow-up machine that turns your Wavefront OBJ files into a BRL-CAD database. no cap. π¦
πΈ NAME πΈ
obj-g β convert a Wavefront OBJ file to a BRL-CAD database π
β¨ SYNOPSIS β¨
obj-g [-cdfipv] [-g _grouping_] [-m _mode_] [-o _open_bot_type_] [-r _orientation_] [-H _plate_thickness_] [-t _distance_tolerance_] [-u _units_] [-x _rt_flag_] [-X _nmg_flag_] _input.obj_ _output.g_
π DESCRIPTION π
okay so here's the tea β β obj-g takes the polygonal face elements of a Wavefront OBJ file and turns them into BRL-CAD bot(5) primitives, all stored in a .g database. that's the whole main character arc. π
some things that do not make it through the conversion, bestie, and i need you to hear me:
- materials β parsed, then ignored π
- textures β also parsed, also ignored π
- assembly hierarchy β not preserved, at all, zero, nada
only the geometry gets converted. periodt.
Each OBJ face grouping becomes a separate primitive β that's the rule. and because the hierarchy is gone, if a face belongs to more than one group, a copy of it gets created in each group. yeah. duplicates. it's giving "you get a copy, you get a copy." π
Primitive names derive from the OBJ grouping names, with characters that are invalid in BRL-CAD names (such as '/', '\' and '=') replaced with underscores. π©Ή
By default, conversion uses native-bot mode, grouping by OBJ group ('g') elements, with OBJ units assumed to be meters. default vibes only. π
π₯ OPTIONS π₯
-cβ Continue processing after an NMG bomb π. On a fatal error in nmg or bot-via-nmg mode, fall back to native-bot output for that grouping and proceed; otherwise the converter stops. so it's like "ok that one exploded, moving on" π«Ά-dβ Output debug information to standard error. heads up though: this produces a very large amount of output, so redirecting standard error to a file is recommended. like, seriously. redirect it. π-fβ Fuse vertices that fall within the distance tolerance of one another. Improves solidity detection but can significantly increase conversion time. highkey a tradeoff, ngl β³-g_grouping_ β Select which OBJ face grouping is used to create primitives:g= group (this is the default β¨)o= objectm= materialt= texturen= none
so if you select a grouping that's absent from the file, it behaves like n. and n greatly increases time and memory for large models β that's the cost of "none", bestie π
-H_plate_thickness_ β Plate thickness in mm for plate and plate-nocos bots created from open (non-closed) volumes. Ignored unless-o por-o nis in effect. so it does nothing unless you asked for a plate type, fr fr π-iβ Ignore the normals defined in the OBJ file when using native-bot mode. Has no effect in nmg or bot-via-nmg mode, where provided normals are always ignored. normals? not today. π ββοΈ-m_mode_ β Select the conversion mode:b= native bot (the default π)n= nmgv= bot via nmg
Native-bot is the fastest and is the only mode that uses OBJ normals; bot-via-nmg is best for producing solid (volume) bots. pick your fighter π₯
-o_open_bot_type_ β Type of bot created when a primitive is not a closed volume:s= surface (default)p= platen= plate-nocos
Use a plate type (with -H) when open surfaces need a defined thickness. π
-pβ Create a plot/overlay (.plot3) file of open edges for each bot that is not a closed volume. The file is named after the bot primitive, written to the current directory, and overwrites any existing file. β οΈ yes, overwrites. be careful, bestie.-r_orientation_ β Bot orientation:1= unoriented (default)2= counter-clockwise3= clockwise
know which way is up π«
-t_distance_tolerance_ β Maximum distance in mm at which two vertices are considered the same; default0.0005. Should match the raytracer distance tolerance, so do not change one without the other. they're a matched set, like us π«Ά-u_units_ β Units of the OBJ file: a BRL-CAD unit name such asm,cm,mm,ftorin, or a custom numeric conversion factor from file units to mm. Default ism. π§-vβ Output verbose information to standard error. Repeat to raise the verbosity level (two levels currently). Warning messages are only printed when-vis given β so if you're flying blind, that's on you π-x_rt_flag_ β Set librt debug flag bits (seeraytrace.h). π-X_nmg_flag_ β Set NMG debug flag bits (seenmg.h). π
π EXAMPLES π
Example 1. Quick native-bot conversion in millimeters β
obj-g -u mm -i model.obj model.g
Converts model.obj using native-bot mode with a unit scale of 1.0 (OBJ units are millimeters), ignoring any normals in the file. Closed surfaces become volume bots and open surfaces become surface bots, grouped by OBJ 'group' elements. slay, done. π
Example 2. Watertight solids via NMG, logging to a file π§
obj-g -m v -o p -H 5 -g o -v -v model.obj model.g 2> model.log
mged model.g 'tops'
Converts model.obj with bot-via-nmg mode for robust solid detection, emitting 5mm plate bots for open volumes and grouping by OBJ 'object' elements (file assumed to be in meters). Level-two verbose output is captured in model.log, then mged(1) lists the resulting top-level objects. chef's kiss π₯
π SEE ALSO π
brlcad(1), g-obj(1), mged(1), bot(5)
go read those too, they're icons π
π 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 π§ (be nice, they're doing their best)
k that's the whole page, bestie β this little gem lives in BRL-CAD, manual section 1, so go forth and convert some geometry πβ¨πΈ and remember: the manual page you just read is OBJ-G(1), brought to you by BRL-CAD. bye pookie π«Άπ
π¦ 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