NIRT_FORMATTING(5)
πΈ NAME πΈ
okay so bestie, welcome to the DRAFT!!! NIRT ...SPECIFICATIONS(5) page from BRL-CAD π
this is the nirt_formatting doc, and itβs all about the supported output formatting specifications for Natalie's Interactive RayTracer (NIRT). yes, Natalieβs. iconic name, iconic tracer. π
β¨ OVERVIEW β¨
One of the most powerful features of Natalie's Interactive RayTracer (NIRT) is that it supports user-defined output formatting for its outputs. literally the glow-up your terminal output deserves. π
The fmt command lets you change β on the fly β what gets printed and how it gets printed for the various values generated by shotline intersections. It uses a subset of the C/C++ printf format specifier syntax (the docs live at http://www.cplusplus.com/reference/cstdio/printf/) for flexible template specification, plus a series of pre-defined keys that specify individual elements of the generated results. iykyk. β¨
The general form of a fmt command is:
fmt 'char' "format string" [keys]...
where the "char" argument is replaced by a single character identifying the category of output the format string applies to. The "format string" is the printf style formatting string, and the keys will line up with format specifiers in the string the same way variables in C/C++ line up with specifiers in a printf format string. no cap, itβs giving very structured. π«Ά
π OUTPUT CATEGORIES π
NIRT offers seven categories of output reporting. seven! a whole lucky number situation. hereβs the category cheat sheet:
- Ray β char
rβ Report of ray information. The formatting associated withrwill print once per ray, regardless of whether a region is encountered. main character energy: it shows up every time. π - Header β char
hβ First output after a ray hits anything, typically used to identify columns in subsequent output. Printed once per ray. itβs the little column-label era. π - Partition β char
pβ Output for each region encountered by the ray. Typically this will be where most of the information about a model is reported. the info dump we deserve. π - Footnote β char
fβ Last output statement after a ray hits anything; a "footnote" line after the ray has completed its evaluations. Printed once per ray. little closing credits vibe. β¨ - Gap β char
gβ Output written once for each gap the ray may encounter. gap rights! π¦ - Miss β char
mβ If triggered, prints a message that nothing was hit; maximum once per ray. the sad little βoop, nothingβ line. π - Overlap β char
oβ Output written once for each overlap along the ray. overlap girlies stay winning. π₯
π¦ FORMAT STRINGS π¦
NIRT's format specifications are a subset of those found in printf implementations. Specifically, the d, i, and f types are supported, as well as width and precision specifiers. thatβs the whole menu β cute, focused, not trying to be everything. π
π REPORTING KEYS - CONNECTING DATA TO FORMAT STRINGS π
Unlike the full C/C++ printf, NIRT accepts only pre-defined string keys that identify elements of specific information related to each category of output. no random variables, bestie β just the approved little key squad. π«Ά
Ray information is consistent over an entire shot event, and therefore Ray keys may be used in all categories:
Table 1. Ray Variables
x_origβ x coordinate of ray origination point.y_origβ y coordinate of ray origination point.z_origβ z coordinate of ray origination point.d_origβ d coordinate of ray origination point.hβ h coordinate for the entire ray.vβ v coordinate for the entire ray.x_dirβ x component of direction vector.y_dirβ y component of direction vector.z_dirβ z component of direction vector.aβ azimuth of view (i.e., of ray direction).eβ elevation of view (i.e., of ray direction).
Footnote and Miss categories have no particular keys unique to them, although they (like all categories) can use the Ray keys if desired. Partition, Overlap, and Gap, on the other hand, have keys that are unique to their contexts and valid only within those contexts:
Okay so here's the big one β Table 2. Partition Variables π this is literally the whole roster of variables you can drop into a format string when you're reporting on a partition. Every one of these is at your service, bestie:
attributesβ a string variable made up of the names and values of the attributes you asked for β the ones requested by theattrinteractive command or the-Acommand line option. πx_inβ the x coordinate of entry into the current region.y_inβ the y coordinate of entry into the current region.z_inβ the z coordinate of entry into the current region.d_inβ the d coordinate of entry into the current region.x_outβ the x coordinate of exit from the current region.y_outβ the y coordinate of exit from the current region.z_outβ the z coordinate of exit from the current region.d_outβ the d coordinate of exit from the current region.losβ the line-of-sight distance through the current region. β¨scaled_losβ the scaled line of sight: the product of the line-of-sight distance through the current region and the region solidity (sometimes called "percent LOS"). Heads up though β "region solidity" here means a thickness equivalence factor, the kind often used to simulate material properties like density. Ngl that trips people up every time. πpath_nameβ the full path name of the current region.reg_nameβ the name of the current region.reg_idβ the region ID of the current region.claimant_countβ the number of regions claiming this partition β like, the regions participating in a retained overlap. πclaimant_listβ a space-separated list of the names of the regions claiming this partition (again: the ones participating in a retained overlap).claimant_listnβ same asclaimant_list, except it's newline-separated instead of space-separated. Little glow-up, same energy. π¦obliq_inβ the entry obliquity for the current region.obliq_outβ the exit obliquity for the current region.nm_x_inβ the x component of the entry normal vector.nm_y_inβ the y component of the entry normal vector.nm_z_inβ the z component of the entry normal vector.nm_h_inβ the h component of the entry normal vector.nm_v_inβ the v component of the entry normal vector.nm_d_inβ the d component of the entry normal vector.nm_x_outβ the x component of the exit normal vector.nm_y_outβ the y component of the exit normal vector.nm_z_outβ the z component of the exit normal vector.nm_h_outβ the h component of the exit normal vector.nm_v_outβ the v component of the exit normal vector.nm_d_outβ the d component of the exit normal vector.surf_num_inβ the entry-surface ID of the entry solid. πΈ
That's the whole set β no skipping, no cap. π
surf_num_outβ the exit-surface ID of the exit solid. That's the last one from the surface crew, bestie π
π¦ Table 3. Overlap Variables
Okay so these are the ones that fire when two regions are literally occupying the same space β overlap reporting. Iconic of nirt to snitch on them π«Ά
ov_reg1_nameβ the name of one of the overlapping regions.ov_reg2_nameβ the name of the other overlapping region.ov_reg1_idβ the region ID of one of the overlapping regions.ov_reg2_idβ the region ID of the other overlapping region.ov_sol_inβ the name of one of the overlapping solids.ov_sol_outβ the name of the other overlapping solid.ov_losβ the line-of-sight distance through the overlap. πov_x_inβ the x coordinate of entry into the overlap.ov_y_inβ the y coordinate of entry into the overlap.ov_z_inβ the z coordinate of entry into the overlap.ov_d_inβ the d coordinate of entry into the overlap.ov_x_outβ the x coordinate of exit from the overlap.ov_y_outβ the y coordinate of exit from the overlap.ov_z_outβ the z coordinate of exit from the overlap.ov_d_outβ the d coordinate of exit from the overlap.
πΈ Table 4. Gap Variables
And these are for the gap situation β the lil empty stretches where your ray is just... traveling through nothing. Not a crisis, just a gap, and nirt is keeping receipts β¨
x_gap_inβ the x coordinate of entry into the gap.y_gap_inβ the y coordinate of entry into the gap.z_gap_inβ the z coordinate of entry into the gap.gap_losβ the line-of-sight distance through the gap. π
that's the whole variable roster, bestie β surfaces, overlaps, gaps, all accounted for. nothing dropped, nothing skipped, everything in its exact spot π
π§ a lil sign-off
That's the page, fr fr π This one's a DRAFT!!! from BRL-CAD β yes, the manual itself is stamped DRAFT!!! and titled nirt ... specifications(5), lowercase and mysterious, main character energy only ππ
So go forth, format your little heart out, and remember: the vibe is a draft, the notes are legendary. periodt. π π¦
π¦ 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