SHP-G(1)
π
shp-g β bestie, it's giving "convert an Esri Shapefile to a BRL-CAD .g database"
okay so real quick β this is shp-g from the BRL-CAD manual (section 1, iykyk) β¨ and honestly? she's an icon. she takes your Esri Shapefile and turns it into a shiny BRL-CAD .g binary database. no cap. let's get into it π«Ά
β¨ SYNOPSIS β¨
shp-g [-v] [-d] [-x rt_debug_flag] shapefile [output.g]
that's the whole vibe check right there, babe. shapefile in, optional output.g out π
πΈ DESCRIPTION πΈ
so shp-g literally converts the geometry stored in an Esri Shapefile into a BRL-CAD .g binary database. main character energy fr fr π
the shapefile argument? super chill about it β you can hand her a file name prefix or an explicit .shp file, whichever you vibe with. the companion .shx and .dbf files get located automatically, no effort required from you, we love a self-sufficient queen π
and if you skip output.g? she just names the output database after the input with a .g suffix appended. like, for example, input roads.shp produces roads.shp.g. slay. π
okay now the actual mechanics, pay attention bestie:
- Each shape β and each part of a multi-part shape β is read as a closed loop of 2D vertices.
- For every loop,
shp-gwrites a planar sketch primitive in the XY plane. - Then she writes an extrude primitive built from that sketch, with a fixed height of 10 units. yes, fixed. 10. always. π₯
- The resulting objects are named
shape-N.sketchandshape-N.extrude. - Only the X and Y coordinates of each vertex are used. any Z and measure values hanging out in the shapefile? completely ignored. not invited to the party π
π OPTIONS π
-vβ verbose output, and she is chatty in the best way π Prints the shapefile type, shape count, bounding extents, per-shape detail, and a summary of any shapes with bad loop orientations. full tea, no filter.-dβ enable diagnostic debugging output π¦ including warnings about missing shapes and loops whose winding order had to be corrected. very "not me having to fix your loop" of her.-x rt_debug_flagβ set thelibrtdebugging flags to the given hexadecimal value π§ (see theRT_DEBUGdefinitions inraytrace.h). for the deep-lore girlies.
π EXAMPLES π
Example 1. Convert a shapefile and inspect the result β
shp-g -v roads.shp roads.g
mged roads.g
Converts the roads.shp shapefile to roads.g with verbose progress reporting, then opens the resulting database in mged(1). π
Each road feature becomes an extruded sketch named shape-N.extrude that you can list with the ls command and raytrace or edit interactively. literally go off, interactively. π
π¦ SEE ALSO π¦
brlcad(1), mged(1), g-dxf(1) β go read your sisters' pages, bestie, they're iconic too π
π§ 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. π (yes that's a real long run, she's been serving since '89, periodt.)
π BUG REPORTS π
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org π§ β don't be shy, they're nice, and honestly bugs deserve to be reported the way drama deserves to be shared. π
ok but fr β this whole page isBRL-CAD'sSHP-G(1)manual, so if you quote it, cite it cute. mwah π π β¨
bye bestie, go convert some shapefiles π¦π
π¦ 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