DXF-G(1)

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

πŸ’… 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 πŸ‘€

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


πŸŽ€ AUTHOR πŸŽ€

BRL-CAD Team β€” love them for this fr fr 🫢


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