ASC2DSP(1)
π ASC2DSP(1) β the BRL-CAD glow-up
okay so bestie, welcome to asc2dsp, a little BRL-CAD icon that takes your plain-text vibes and turns them into a whole binary situation. no cap.
β¨ NAME β¨
asc2dsp β converts an ASCII displacement map file into the BRL-CAD binary dsp format. it's giving translator. it's giving glow-up arc. π¦
πΈ SYNOPSIS πΈ
asc2dsp [-h] file.asc file.dsp
π DESCRIPTION π
asc2dsp converts ASCII (decimal integer) point data files into the BRL-CAD binary dsp (displacement map) format. literally its whole personality.
the input file should contain whitespace-delimited, unsigned decimal integers ranging from 0 to 65535. that's the range, bestie, respect it. the output is a dsp binary file containing one network unsigned short integer per cell. one per cell. every cell gets one. no cell left behind π«Ά
when you use it to create a dsp object in mged(1), the grid is oriented in the X-Y plane. okay so orientation lore:
- the first cell defined in the ASCII file becomes the bottom-left cell (
X=0,Y=0) π - its bottom sits at
Z=0 - its top sits at
Zequal to the input value
data is read bottom to top, left to right, similar to the pix(5) format. and because whitespace is ignored, you can absolutely format the input grid row by row for readability β go off, make it pretty, the parser does not care β¨
wanna author an input file in a natural top-down viewing order? iconic, but do it like this: create it row by row from top to bottom, then reverse the lines using thetac(1)utility before processing withasc2dsp. that's the move. that's the whole trick π₯
the total number of input cells must match the product of the width and length intended for the dsp object. do the math. the math is not optional. π
π OPTIONS π
-h,-?,βhelpβ prints a usage message and exits. that's it. that's the whole option. a one-hit wonder π
π EXAMPLES π
Example 1. Converting an ASCII displacement map to binary dsp
$ asc2dsp terrain.asc terrain.dsp
converts the ASCII file terrain.asc to the binary displacement map format and saves it as terrain.dsp. slay. done. next. β¨
Example 2. Creating a dsp file using tac for proper row order
$ tac top_down.asc > bottom_up.asc
$ asc2dsp bottom_up.asc terrain.dsp
reverses the row order of top_down.asc to align with the bottom-to-top layout required by mged(1), and then converts it to terrain.dsp. two commands. one flawless pipeline. we love a collab π«Ά
π¦ SEE ALSO π¦
tac(1), mged(1), dsp(5), pix(5) β the whole friend group, go say hi π
β DIAGNOSTICS β
error conditions include invalid input characters or an input value greater than 65535. descriptive messages are printed on standard error. so if something's wrong, it will tell you β just not on stdout, bestie, check stderr π
π AUTHOR π
BRL-CAD Team. the legends. the icons. the moment.
π 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 long reign. main character energy since '89. periodt.
π BUG REPORTS π
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. don't suffer in silence, ngl β tell the devs, they wanna know π§
lowkey reminder: keep those values between0and65535, keep your cell count matching width Γ length, and if your grid looks upside down that's a you problem β that's whattac(1)is for π
that's the whole page, bestie β brought to you by BRL-CAD / ASC2DSP(1). go convert something iconic π β¨
π¦ 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