STL-G(1)
β¨ 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 is0.0005mm β same defaultmged(1)and the raytracer use, so you're in good company π-N forced_nameβ useforced_nameas 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 is1000. conflicts with-Iβ οΈ-I constant_identβ assignconstant_identto 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 is1.-c unitsβ specify the units used in the STL file so coordinates can be converted to millimeters.unitscan 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; seeraytrace.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.
πΈ COPYRIGHT πΈ
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
- 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