COIL(1)

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

πŸ’« coil β€” generate a coil as a BRL-CAD pipe primitive πŸ’«

okay so this is the coil page from the BRL-CAD manual, section 1 (that's COIL(1) bestie, we're in the big leagues of command-line lore) 🫢


✨ NAME ✨

coil β€” generate a coil as a BRL-CAD pipe primitive. that's it, that's the whole vibe 🌸


πŸŽ€ SYNOPSIS πŸŽ€

     coil [-d mean_outer_diameter] [-w wire_diameter] [-H helix_angle] [-p pitch]
          [-n number_of_turns] [-s start_cap_type] [-e end_cap_type]
          [-S number_of_turns,mean_outer_diameter,wire_diameter,helix_angle,pitch,winding_direction]
          [-l overall_length] [-L] [name]

πŸ¦‹ DESCRIPTION πŸ¦‹

so coil generates a coil, and it models it as a BRL-CAD pipe primitive built out of a lil set of dimensional parameters. no parameters? no problem β€” you get a default coil, main character energy, ready to go ✨

heads up on units bestie: all lengths are in millimeters and the helix angle is in degrees. memorize that, it's giving essential.

when you run it as a standalone program, the coil gets written to a brand-new database named coil.g β€” and lowkey coil refuses to overwrite an existing file with that name, so don't even try it πŸ’€. when you run it as a command inside a modeling environment like mged(1) or archer(1), the coil is created in the database that's currently open. same tool, different context, iykyk.

the created object is named coil by default πŸŽ€ but you can slide an alternate name in as a trailing argument. the result is a combination unioning the coil core pipe β€” and for ground caps, it subtracts the capping solids. so it's doing union math and subtraction math and looking gorgeous while doing it πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • -d mean_outer_diameter β€” mean outer diameter of the coil, in millimeters. the big round energy πŸ“
  • -w wire_diameter β€” diameter of the wire that gets wound into the coil, in millimeters. yes bestie the wire has a thickness, it's not a theoretical line 🧡
  • -H helix_angle β€” helix angle of the coil, in degrees. that's your twist factor πŸŒͺ️
  • -p pitch β€” distance, in millimeters, between the center of the wire at the beginning and the end of a single turn. the minimum value and the default value is the wire diameter; if you give it something smaller, it gets clamped up to the wire diameter. no tiny-pitch nonsense here, the clamp said what it said 🚫
  • -n number_of_turns β€” number of turns in the coil. must be a positive integer, and ngl fractional turns are not supported β€” half a turn is not a thing, pick a side 😭
  • -s start_cap_type β€” capping style for the start of the coil. here's the menu: 0 (default) applies no special styling πŸƒ, 1 is a squared-off cap ⬛, 2 grinds the cap flat in the plane normal to the coiling direction πŸ“, and 3 does both β€” squares off and grinds the cap πŸ’…. and warning bestie: any non-default cap adds extra turns beyond those you requested with -n, so your turn count is gonna come out bigger than you asked, no cap.
  • -e end_cap_type β€” capping style for the end of the coil. values are exactly the same as for -s, so scroll up and reread the cap menu 🫢
  • -S number_of_turns,mean_outer_diameter,wire_diameter,helix_angle,pitch,winding_direction β€” define one coil section as a comma-delimited list of all six values. winding_direction is 1 for right-handed, and literally anything else means left-handed. repeat -S to build a multi-section coil; sections get stacked from the origin in the order you give them. ⚠️ and this is the big one: specifying any -S section causes all other dimensional options to be ignored (capping with -s/-e still applies though, those survive). so don't be out here passing -d and -S together and expecting both to count, that's not the vibe πŸ™ˆ
  • -l overall_length β€” clamp the overall length of the coil to the given value, in millimeters. only effective for uncapped coils with a zero helix angle (read that twice, it's strict). to fit the length, it goes in this exact order: pitch is adjusted first, then turns are removed, and finally wire diameter is reduced πŸͺ„. and length clamping does not apply to -S sections β€” those live outside the clamp's jurisdiction.
  • -L β€” create a left-handed coil. the default is right-handed (winding proceeds in +x from the start); -L winds in -x. pick your direction, it's giving choices 🌈
  • -h, -? β€” print usage information and exit. the classic escape hatch, iconic, works every time πŸšͺ

🌟 EXAMPLES 🌟

Example 1. Create a named spring with specific dimensions

       coil -d 20 -w 2 -p 5 -n 10 my_spring

writes coil.g containing a 10-turn coil named my_spring with a 20 mm mean outer diameter, 2 mm wire, and 5 mm pitch. cute, functional, does exactly what it says on the tin ✨

Example 2. Create a coil with ground ends and inspect its volume

       coil -d 50 -w 5 -n 12 -s 3 -e 3 valve_spring
       mged -c coil.g 'analyze valve_spring'

builds a compression-spring-style coil whose ends are squared off and ground flat (that's the -s 3 -e 3 combo working its magic πŸ’…), then opens the database in mged(1) to report the part's bounding box and volume. show-off behavior, we love to see it πŸ“Š

Example 3. Build a two-section coil

       coil -S 10,1000,50,60,800,1 -S 10,1000,50,0,100,1 stacked_coil

stacks a 10-turn section with a 60-degree helix angle and 800 mm pitch on top of a tighter 10-turn section, both right-handed, all in a single stacked_coil object. multi-section queen energy, the -S flag ate that πŸ“


πŸ”— SEE ALSO πŸ”—

brlcad(1), mged(1), archer(1) β€” go read those too, they're the supporting cast and they carry 🫢


πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team β€” legends, honestly.


This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.

(yeah that's a real long copyright span, they've been at this a minute πŸ’œ)


πŸ› BUG REPORTS πŸ›

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β€” find a bug, send the email, be the hero 🌸


cute lil sign-off: this page is footer-stamped BRL-CAD and COIL(1), both appearing at the bottom, and yeah that's the whole manual-page flex. now go build a spring bestie πŸŽ€βœ¨
πŸ“¦ where this page comes from