DXF-G(1)
π DXF-G(1) β bestie edition β¨
okay so real talk: this is dxf-g from the BRL-CAD fam, and we're gonna convert AutoCAD files into BRL-CAD databases like it's nothing. periodt. π
πΈ NAME πΈ
dxf-g β converts an AutoCAD DXF file into a BRL-CAD database. that's it, that's the whole vibe. π¦
β¨ SYNOPSIS β¨
dxf-g [-c] [-d] [-v] [-t tolerance] [-s scale_factor] [-h] [-?] file.dxf database.g
like, you give it a .dxf and a .g and it does the thing. π
π«Ά DESCRIPTION π«Ά
so dxf-g takes an AutoCAD DXF file (file.dxf) and turns it into a BRL-CAD database (database.g). the input needs to be in ASCII DXF format, as defined in the AutoCAD 2006 manuals. no cap, that's the spec. π
the DXF entity types it handles are: POLYLINE, LWPOLYLINE, LEADER, DIMENSION, VERTEX, LINE, CIRCLE, ARC, ELLIPSE, 3DFACE, TEXT, MTEXT, ATTRIB, SOLID, and SPLINE. and for POLYLINE subtypes you also get 3D polylines, 3D polygon meshes, and polyface meshes. iconic. π
heads up tho β SOLID entities are 2D filled shapes, but this converter does not perform any filling. so it's giving shape, not shade. π
every DXF layer becomes its own separate BRL-CAD object, and layer colors are preserved π. and if you ever wanna go the other way? that's g-dxf(1), the inverse conversion. round trip queen. π
π OPTIONS π
-cβ ignore colors. by default each layer may get split into separate BOT primitives by color; with this flag you get a single object per layer no matter what colors are in there. one layer, one object, simple. β¨-dβ turn on a debug flag that requests a core dump on failure. useful only for developers. like, genuinely, if you're not hacking on this, leave it alone π-vβ verbose mode, so it prints progress output on standard error. chatty converter bestie. π¬-t_tolerance_ β max distance, in millimeters, at which two vertices count as the same point. so anything closer than that gets merged. π§-s_scale_factor_ β multiply all input coordinates by scale_factor. super useful for DXF files that forgot to say what units they're in. π-h,-?β print a usage message and dip. π
π EXAMPLES π
Example 1. Convert a DXF file drawn in inches
dxf-g -s 25.4 -t 0.01 drawing_inches.dxf drawing.g
this takes a DXF authored in inches and makes a millimeter-unit BRL-CAD database by scaling every coordinate by 25.4, while merging vertices that lie within 0.01 mm of each other into a single point. two birds, one command. π¦
Example 2. Round-trip a model through DXF
g-dxf -o part.dxf part.g component
dxf-g part.dxf part_reimport.g
first it exports the object component from part.g to DXF with g-dxf(1), then re-imports the result into a new BRL-CAD database so you can compare or keep editing. the full circle moment. π
π SEE ALSO π
π AUTHOR π
BRL-CAD Team β love them for this fr fr π«Ά
β COPYRIGHT β
This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.
π BUG REPORTS π
if something's busted, reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. tell them everything. π
okay that's the whole page!! this one's BRL-CAD flavored DXF-G(1), brought to you by the BRL-CAD crew β go convert something gorgeous bestie πΈπβ¨
π¦ 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