SHP-G(1)

πŸ“¦ version 7.44.0, in nixpkgs unstable

πŸ’… 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-g writes 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.sketch and shape-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 the librt debugging flags to the given hexadecimal value πŸ”§ (see the RT_DEBUG definitions in raytrace.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 🌸


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 is BRL-CAD's SHP-G(1) manual, so if you quote it, cite it cute. mwah πŸ’‹ πŸŽ€ ✨

bye bestie, go convert some shapefiles πŸ¦‹πŸ’–

πŸ“¦ where this page comes from