STL-G(1)

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

✨ STL-G(1) ✨

okay bestie, welcome to the STL-G(1) page, straight outta the BRL-CAD manual set 🫢 this one's your lil conversion fairy and she's about to turn your 3D-printing dust into real BRL-CAD geometry. let's go πŸ’…


🌈 NAME 🌈

stl-g β€” the Stereolithography (STL) to BRL-CAD converter. yes she converts. she slays. periodt.


πŸŽ€ SYNOPSIS πŸŽ€

stl-g [-db] [-t tolerance] [-N forced_name] [-i initial_ident] [-I constant_ident] [-m material_code] [-c units] [-x rt_debug_flag] input.stl output.g

πŸ’– DESCRIPTION πŸ’–

so stl-g takes a Stereolithography file input.stl and turns it into a BRL-CAD database output.g β€” literally just that, no cap. every single STL solid becomes a bot(5) (bag-of-triangles) primitive, and each one gets wrapped in its own region, and then all those regions get unioned together into a top-level group named all. iconic behavior honestly πŸ‘‘

coincident vertices β€” meaning ones that are within the tolerance distance of each other β€” get merged, so the resulting BOT actually shares vertices between adjacent faces. teamwork!! 🀝

both ASCII and binary STL are supported, she's flexible like that. input is assumed to be ASCII unless you pass the -b option, so don't come crying if your binary file looks cursed without it 😭

here's the vibe: the STL format carries no useful object names, zero, nada. so region and solid names get derived from the embedded solid name (ASCII), or the input file name, or the -N option β€” and then made unique within the database. gotta keep 'em distinct fr fr.

and if you ever need the reverse trip (BRL-CAD β†’ STL), that's g-stl(1)'s whole job, she's got it 🌸


✨ OPTIONS ✨

  • -b β€” treat the input as a binary STL file. the default is ASCII.
  • -d β€” print extra debugging info, including each face and its normal as it's being read. very "let me see everything" of you πŸ‘€
  • -t tolerance β€” the minimum distance, in millimeters, between two distinct vertices. any two vertices closer than this get treated as the same vertex. the default is 0.0005 mm β€” same default mged(1) and the raytracer use, so you're in good company πŸ’œ
  • -N forced_name β€” use forced_name as the base name for the converted object instead of deriving one from the STL solid name or the input file name. you're the main character here, you pick the name.
  • -i initial_ident β€” set the ident (region) number assigned to the first region, and it gets incremented for each region after that. default is 1000. conflicts with -I ⚠️
  • -I constant_ident β€” assign constant_ident to every region created. must be zero or greater. conflicts with -i ⚠️
  • -m material_code β€” set the integer material code (GIFT material code) assigned to all regions. default is 1.
  • -c units β€” specify the units used in the STL file so coordinates can be converted to millimeters. units can be any string BRL-CAD accepts β€” like "mm", "cm", "m", "in", or "ft". default is "mm".
  • -x rt_debug_flag β€” set the librt debug flag (a hexadecimal value; see raytrace.h). deep cuts, iykyk πŸ”₯

πŸ¦‹ EXAMPLES πŸ¦‹

Example 1. Convert a binary STL exported from a 3D printing tool

stl-g -b -c in -N bracket part.stl part.g

this reads the binary STL file part.stl whose coordinates are in inches, converts them to millimeters, names the resulting object bracket, and writes the BRL-CAD database part.g. chef's kiss, ate and left no crumbs πŸ“

Example 2. Convert and immediately raytrace an ASCII STL model

stl-g model.stl model.g
rt -o model.png model.g all

converts the ASCII STL file model.stl, then renders the top-level group all with rt(1) to verify the geometry imported correctly. vibe check passed βœ…


πŸ’€ SEE ALSO πŸ’€

brlcad(1), g-stl(1), mged(1), rt(1), bot(5)


πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team β€” legends, honestly.


This software is Copyright (c) 1999-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 β€” tell 'em everything, they wanna know 🫢


made with love by the BRL-CAD crew, on the STL-G(1) page β€” mwah, go convert something cute πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from