https://brlcad.org/w/api.php?action=feedcontributions&user=MinuteElectron&feedformat=atomBRL-CAD - User contributions [en]2024-03-19T03:35:59ZUser contributionsMediaWiki 1.32.2https://brlcad.org/w/index.php?title=File:TclTk_Integration.pdf&diff=76File:TclTk Integration.pdf2007-09-09T09:59:49Z<p>MinuteElectron: Category:User group presentations</p>
<hr />
<div>[[Category:User group presentations]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:Colorizing_Geometry.pdf&diff=75File:Colorizing Geometry.pdf2007-09-09T09:46:56Z<p>MinuteElectron: Category:User group presentations</p>
<hr />
<div>[[Category:User group presentations]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:Optical_Shaders.pdf&diff=74File:Optical Shaders.pdf2007-09-09T09:28:55Z<p>MinuteElectron: Category:user group presentations</p>
<hr />
<div>[[Category:user group presentations]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:RtWizard.pdf&diff=73File:RtWizard.pdf2007-09-09T09:02:33Z<p>MinuteElectron: Category:User group presentations</p>
<hr />
<div>[[Category:User group presentations]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:V5_Database_Format.pdf&diff=70File:V5 Database Format.pdf2007-09-09T08:55:10Z<p>MinuteElectron: Category:User group presentations</p>
<hr />
<div>[[Category:User group presentations]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Category:Benchmarking&diff=69Category:Benchmarking2007-09-09T08:53:36Z<p>MinuteElectron: Categorizing.</p>
<hr />
<div>[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Category:Documentation&diff=68Category:Documentation2007-09-09T08:52:25Z<p>MinuteElectron: Categorising.</p>
<hr />
<div>[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Category:User_group_presentations&diff=67Category:User group presentations2007-09-09T08:51:41Z<p>MinuteElectron: Categorizing.</p>
<hr />
<div>[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Users_group_presentations&diff=66Users group presentations2007-09-09T08:51:16Z<p>MinuteElectron: Categorising.</p>
<hr />
<div>Included below are some of the presentation slides from the BRL-CAD 2002 Users Group Meeting. Enjoy!<br />
<br />
* {{pdf|Application Development|An introduction to writing BRL-CAD applications}}<br />
* {{pdf|Benchmark|The BRL-CAD Benchmark}}<br />
* {{pdf|Geometry Conversions|Geometry Conversions to and from BRL-CAD and other formats}}<br />
* {{pdf|On Microsoft Windows|BRL-CAD on Microsoft Windows}}<br />
* {{pdf|2002 UGM Host|Survice Engineering, Inc. hosts the 2002 UGM}}<br />
* {{pdf|On Mac OS X|BRL-CAD on Mac OS X}}<br />
* {{pdf|v5 Database Format|The BRL-CAD v5 Database Format}}<br />
* {{pdf|RtWizard|Geometry visualizations using the RtWizard}}<br />
* {{pdf|Optical Shaders|BRL-CAD's optical shaders}}<br />
* {{pdf|Colorizing Geometry|Standard methods for colorizing BRL-CAD geometry}}<br />
* {{pdf|TclTk Integration|BRL-CAD's integration with TclTk}}<br />
<br />
[[Category:Documentation]]<br />
[[Category:User group presentations]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:On_Mac_OS_X.pdf&diff=65File:On Mac OS X.pdf2007-09-09T08:37:16Z<p>MinuteElectron: Category:User group presentations</p>
<hr />
<div>[[Category:User group presentations]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:2002_UGM_Host.pdf&diff=64File:2002 UGM Host.pdf2007-09-09T08:21:10Z<p>MinuteElectron: Category:User group presentations</p>
<hr />
<div>[[Category:User group presentations]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:On_Microsoft_Windows.pdf&diff=63File:On Microsoft Windows.pdf2007-09-09T08:10:32Z<p>MinuteElectron: Category:User group presentations</p>
<hr />
<div>[[Category:User group presentations]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:Geometry_Conversions.pdf&diff=62File:Geometry Conversions.pdf2007-09-09T08:02:04Z<p>MinuteElectron: Category:User group presentations</p>
<hr />
<div>[[Category:User group presentations]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:Benchmark.pdf&diff=61File:Benchmark.pdf2007-09-08T23:09:47Z<p>MinuteElectron: Category:User group presentations</p>
<hr />
<div>[[Category:User group presentations]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:Application_Development.pdf&diff=60File:Application Development.pdf2007-09-08T22:55:25Z<p>MinuteElectron: Category:User group presentations</p>
<hr />
<div>[[Category:Documentation]]<br />
[[Category:User group presentations]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Users_group_presentations&diff=59Users group presentations2007-09-08T22:47:53Z<p>MinuteElectron: New page: Included below are some of the presentation slides from the BRL-CAD 2002 Users Group Meeting. Enjoy! * {{pdf|Application Development|An introduction to writing BRL-CAD applications}} * {{...</p>
<hr />
<div>Included below are some of the presentation slides from the BRL-CAD 2002 Users Group Meeting. Enjoy!<br />
<br />
* {{pdf|Application Development|An introduction to writing BRL-CAD applications}}<br />
* {{pdf|Benchmark|The BRL-CAD Benchmark}}<br />
* {{pdf|Geometry Conversions|Geometry Conversions to and from BRL-CAD and other formats}}<br />
* {{pdf|On Microsoft Windows|BRL-CAD on Microsoft Windows}}<br />
* {{pdf|2002 UGM Host|Survice Engineering, Inc. hosts the 2002 UGM}}<br />
* {{pdf|On Mac OS X|BRL-CAD on Mac OS X}}<br />
* {{pdf|v5 Database Format|The BRL-CAD v5 Database Format}}<br />
* {{pdf|RtWizard|Geometry visualizations using the RtWizard}}<br />
* {{pdf|Optical Shaders|BRL-CAD's optical shaders}}<br />
* {{pdf|Colorizing Geometry|Standard methods for colorizing BRL-CAD geometry}}<br />
* {{pdf|TclTk Integration|BRL-CAD's integration with TclTk}}</div>MinuteElectronhttps://brlcad.org/w/index.php?title=ARL_Technical_Reports&diff=58ARL Technical Reports2007-09-08T22:27:17Z<p>MinuteElectron: Needs some links.</p>
<hr />
<div>These ARL documents are interesting both as reference and from a historical perspective. The HTML here was prepared in 1993 for distribution on ARL's web server. The original ARL web service was one of the first 500 web servers on the internet.<br />
<br />
* ''Animation Techniques in BRL-CAD'' December, 1993<br />
:Lee A. Butler, Christine Murdza<br />
* ''Practices and Standards in the Construction of BRL-CAD Target Descriptions'' May, 1993<br />
:Paul H. Deitz, Keith Applin<br />
* ''IGES 4.0 to BRL-CAD Translator for CSG Models'' December, 1993<br />
:John R. Anderson, Earl P. Weaver, Susanne L. Muuss <br />
<br />
[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Overview&diff=57Overview2007-09-08T22:13:41Z<p>MinuteElectron: categorising</p>
<hr />
<div>Since 1979, the U.S. Army Research Laboratory has been developing and distributing the BRL-CAD constructive solid geometry (CSG) modeling package for a wide range of military and industrial applications. The package includes a large collection of tools and utilities including an interactive geometry editor, raytracing and generic framebuffer libraries, a network-distributed image-processing and signal-processing capability, and an embedded scripting language.<br />
<br />
== What is BRL-CAD? ==<br />
Since the late 1950s, computers have been used to assist with the design and study of combat vehicle systems. The result has been a reduction in the amount of time and money required to take a system from the drawing board to full-scale production as well as increased efficiency in testing and evaluation.<br />
<br />
In 1979, the U.S. Army Ballistic Research Laboratory (BRL) (now the U.S. Army Research Laboratory [ARL]) expressed a need for tools that could assist with the computer simulation and engineering analysis of combat vehicle systems and environments. When no existing computer-aided design (CAD) package was found to be adequate for this purpose, BRL software developers began assembling a suite of utilities capable of interactively displaying, editing, and interrogating geometric models. This suite became known as BRL-CAD.<br />
<br />
Now comprising almost a million lines of C code, BRL-CAD has become a powerful constructive solid geometry (CSG) modeling package that has been licensed at over 2,000 sites throughout the world. It contains a large collection of tools, utilities, and libraries including an interactive geometry editor, raytracing and generic framebuffer libraries, a network-distributed image-processing and signal-processing capability, and a customizable embedded scripting language. In addition, BRL-CAD simultaneously supports dual interaction methods, one using a command line and one using a graphical user interface (GUI).<br />
<br />
A particular strength of the package lies in its ability to build and analyze realistic models of complex objects using a relatively small set of "primitive shapes." To do this, the shapes are manipulated by employing the basic Boolean operations of union, subtraction, and intersection. Another strength of the package is the speed of its raytracer, which is one of the fastest in existence. Finally, BRL-CAD users can accurately model objects on scales ranging from the subatomic through the galactic and get "all the details, all the time." <br />
<br />
== Why CSG Modeling? ==<br />
Although BRL-CAD has been used for a wide variety of engineering and graphics applications, the package's primary purpose continues to be the support of (1) ballistic and (2) electromagnetic analyses. Accordingly, developers have found CSG modeling to be the best approach in terms of model accuracy, storage efficiency, precision, and speed of computational analysis.<br />
<br />
While polygonal and boundary representation (B-rep) modeling often focuses on just the surfaces of objects, CSG modeling focuses on the entire volume and content of objects. This gives BRL-CAD the capability to be "more than skin deep" and build objects with real-world materials, densities, and thicknesses so that analysts can study physical phenomena such as ballistic penetration and thermal, radiative, neutron, and other types of transport. <br />
<br />
== Package Content ==<br />
[[Image:Data flow structure.png|thumb|396px|right|'''Figure 1.''' BRL-CAD data flow structure]]<br />
In keeping with the UNIX philosophy of developing independent tools to perform single, specific tasks and then linking the tools together in a package, BRL-CAD is basically a collection of libraries, tools, and utilities that work together to create, raytrace, and interrogate geometry and manipulate files and data. The basic data flow structure of the package is provided in Figure 1.<br />
<br />
== Libraries ==<br />
The BRL-CAD libraries (designated by the prefix "lib") are designed primarily for the geometric modeler who also wants to tinker with software and, perhaps, design custom tools. Each library fits into one of three categories: (1) creating and/or editing geometry, (2) raytracing geometry, or (3) image handling. The following is a list of the major BRL-CAD libraries and descriptions of their functions. <br />
<br />
* libbu – a basic utility (bu) library containing fundamental computer science types of routines, including manipulating data (e.g., converting from host format data to network format data), parallel processing, parsing parameters, handling variable-length strings, performing error checks, converting units from one format to another, manipulating bit vectors, running parallel-safe versions of input/output (I/O) routines, and maintaining symbol tables.<br />
<br />
* libbn – a library of routines to support basic numerical (bn) handling, including 2-D/3-D vector, matrix, and quaternion manipulation; 3-D plotting support; automatic inference of image size (BRL-CAD images have no internal header; image dimensions are intuited from the size of the file); and wavelet decomposition and reconstruction, etc.<br />
<br />
* libdm – BRL-CAD's primary graphics display manager (dm) library. It handles opening windows onto the display and displaying geometry in the graphics window, etc.<br />
<br />
* libfb – the framebuffer (fb) library, which supports having a window in which the user puts pixel data when raytracing.<br />
<br />
* libmultispectral and liboptical – the shader and texturing libraries for the raytracer.<br />
<br />
* libpkg – a library that implements a remote procedure call (rpc) mechanism. This library is a predecessor of the modern rpc system. Unlike the typical UNIX rpc service, applications can set up services and handle requests without requiring configuration by a system administrator.<br />
<br />
* librt – the library that contains all of the geometry support, including data representations for the primitives, support for raytracing (rt), and binary I/O support for CSG geometric descriptions.<br />
<br />
* libz – a public-domain compression library.<br />
<br />
* libtcl, libtk, and libitcl – libraries that provide the Tcl/Tk scripting language.<br />
<br />
* libpng – a library that provides portable network graphics (png).<br />
<br />
== Tools and Utilities ==<br />
The application side of BRL-CAD also offers a number of tools and utilities. They primarily concern (1) geometric conversion, (2) geometric interrogation, (3) image format conversion, and (4) command-line-oriented image manipulation. The following is a list of the major BRL-CAD tools and utilities. <br />
<br />
* MGED (Multiple-Device Geometry Editor) – BRL-CAD's graphics editor. (For detailed guidance on the use of MGED as well as a list of all the MGED commands currently available, see Butler et al. [2001].)<br />
<br />
* Tools for raytracing and interrogating raytraced geometric objects.<br />
<br />
** rt – the main raytracer for rendering images in BRL-CAD.<br />
<br />
** nirt – a package for firing rays interactively and getting information about what the rays run into.<br />
<br />
** remrt – a network-distributed raytracing package.<br />
<br />
* An assortment of geometric converters to convert to and/or from other geometry formats, including Euclid, ACAD, AutoCAD DXF, TANKILL, Wavefront OBJ, Pro/ENGINEER, JACK (the human factors model for doing workload/usability studies), Viewpoint Data Lab, NASTRAN, Digital Equipment's Object File Format (OFF), Virtual Reality Mark-up Language (VRML), Stereo Lithography (STL), Cyberware Digitizer data, and FASTGEN4.<br />
<br />
* bwish – a Tcl/Tk interpreter in a windowing shell with enhancements compiled into it for accessing BRL-CAD libraries. It also includes various other extensions to the Tcl language.<br />
<br />
* irprep – produces input to the PRISM (Physically Realistic Infrared Simulation Model) code.<br />
<br />
* JOVE (Jonathan's Own Version of Emacs) – a fast, light implementation of Emacs.<br />
<br />
* Applications for displaying images of various types on the framebuffer application and retrieving data from that framebuffer into images of various types.<br />
<br />
* Tools for generating geometry for common objects such as fences, walls, and geometric mathematical oddities (e.g., the sphereflake shown in Figure 2 in Section 4).<br />
<br />
* Data manipulation programs to (1) convert integers to floats, floats to doubles, etc. (e.g., cv); (2) perform mathematical operations on file elements (e.g., imod, umod, and dmod); (3) compute statistics of file elements (e.g., istat, ustat, and dstat); etc.<br />
<br />
* Utilities for building animation scripts – keeping track of columnar data and interpolating it to allow one to produce input to the rt program to render multiple items for animation.<br />
<br />
* Utah Raster Tool Kit – image manipulation of all RLE-based images.<br />
<br />
* Programs for manipulating images and converting between different image file types. The two primary BRL-CAD types are pix (24-bit red, green, and blue [RGB] color images) and bw (8-bit greyscale images). Converters exist for various image formats including alias, png, ppm, etc.<br />
<br />
* Programs for filtering images, doing histograms on the image data, and extracting rectangles from the images.<br />
<br />
* Tools for combining two images and blending them together. (These tools were created before good image editing tools for video production were available; today users would typically load the images directly into a video editing package.)<br />
<br />
== Benchmark Testing ==<br />
As changes are implemented in BRL-CAD, ARL developers run a standard set of computationally intensive image files (shown in Figure 2) on a common machine in order to benchmark and compare raytrace performance. In addition, these images are provided with each source distribution of the package so that users can also test performance on their machines, if desired.<br />
<br />
To run the benchmark images, run the script run.sh in the "bench" directory of the source directory tree.<br />
<gallery><br />
Image:Benchmarking Moss.jpg|Moss<br />
Image:Benchmarking World.jpg|World<br />
Image:Benchmarking Star.jpg|Star<br />
Image:Benchmarking Bldg 391.jpg|Bldg 391<br />
Image:Benchmarking M35.jpg|M35<br />
Image:Benchmarking Sphflake.jpg|Sphflake<br />
</gallery><br />
<br />
== Acknowledgements ==<br />
The authors would like to thank the members of the Advanced Computer Systems Team, who reviewed this document in a timely manner and made many helpful suggestions to improve its accuracy and presentation. At the time this document was prepared team members included John Anderson, TraNese Christy, Bob Parker, Ron Bowers, and Sean Morrison.<br />
<br />
In addition, the authors would like to especially acknowledge Mike Muuss, a team member and the original architect of BRL-CAD, who passed away in the fall of 2000. Without his vision, this work would not have been possible. Therefore, the BRL-CAD Tutorial Series is dedicated to his memory.<br />
<br />
[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Developing_applications&diff=56Developing applications2007-09-08T22:12:15Z<p>MinuteElectron: Categorising.</p>
<hr />
<div>The following links provide a very brief introduction into writing applications with BRL-CAD.<br />
<br />
* {{pdf|Application Development|An introduction to writing BRL-CAD applications}}<br />
* [[Example Application|An example program]]<br />
<br />
== Standards Support ==<br />
Several tools in BRL-CAD conform to various national and international standards including:<br />
* C Programming Language (ANSI/ISO 9899:1990)<br />
* International Graphics Exchange Standard (IGES) (ANSI Y14.26M-1981)<br />
* Virtual Reality Modeling Language (VRML) 2.0 (ISO/IEC 14772-1:1997)<br />
* Portable Network Graphics (PNG) Specification (ISO/IEC 15948:2003)<br />
* Transmission Control Protocol (TCP) (IETF RFC 793)<br />
* Internet Protocol (IP) v4 (IETF RFC 791)<br />
* User Datagram Protocol (UDP) (IETF RFC 768)<br />
* Internet Control Message Protocol (ICMP) (IETF RFC 792)<br />
* Test Transmission Control Protocol (TTCP) (NWG RFC 2398)<br />
* X Window System Protocol (X10R4 and X11R6)<br />
* OpenGL Standard (OpenGL Graphics System 1.2 Specification)<br />
* Character Encoding (ISO/IEC 8859-1)<br />
* Portable Operating System Interface (POSIX) Shell (IEEE 1003.2 and ISO/IEC 9945-2:2003)<br />
* American Standard Code for Information Interchange (ASCII) (ANSI X3.4-1986, EMCA-6, ISO/IEC 646:1991)<br />
* Really Simple Syndication (RSS) 2.0 (subset of ISO 8879:1986(E) and REC-xml-20040204)<br />
* International System of Units (SI and ISO 31 and ISO 1000 and 55 FR 52242-52245)<br />
* U.S. customary units (NIST Handbook 44)<br />
<br />
[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Documentation&diff=53Documentation2007-09-08T21:57:36Z<p>MinuteElectron: Adding final links.</p>
<hr />
<div># [[Overview|Overview of BRL-CAD]]<br />
## {{pdf|Industry Diagram|BRL-CAD Industry Diagram}}<br />
# {{pdf|Introduction to MGED|Introduction to MGED}}<br />
## {{pdf|MGED Quick Reference Card|MGED Quick Reference Card}} (Also available as a {{pdf|MGED Quick Reference Trifold Card|Trifold Card}})<br />
## {{pdf|Shift Grips Quick Reference Guide|Shift Grips Quick Reference Guide}}<br />
# {{pdf|Principles of Effective Modeling|Principles of Effective Modeling}}<br />
# {{pdf|Converting Geometry|Converting Geometry Between BRL-CAD and other Formats}}<br />
# [[Developing applications]]<br />
# [[Building from CVS]]<br />
# Doxygen<br />
# [[ARL Technical Reports]]<br />
# [[Users group presentations]]<br />
<br />
[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Example_Application&diff=52Example Application2007-09-08T21:46:26Z<p>MinuteElectron: New page: <source lang="c"> /* * R T E X A M P L E . C * * A trivial example of a program that uses librt. With comments. * * cc -I/path/to/include/brlcad -o rtexample rtexample.c librt.a ...</p>
<hr />
<div><source lang="c"><br />
/*<br />
* R T E X A M P L E . C<br />
*<br />
* A trivial example of a program that uses librt. With comments.<br />
*<br />
* cc -I/path/to/include/brlcad -o rtexample rtexample.c librt.a -lm<br />
*/<br />
#include "common.h"<br />
<br />
#include <stdio.h><br />
#include <math.h><br />
#include "machine.h" /* machine specific definitions */<br />
#include "vmath.h" /* vector math macros */<br />
#include "raytrace.h" /* librt interface definitions */<br />
<br />
/* every application needs one of these */<br />
struct application ap;<br />
<br />
/* routines for shootray() to call on hit or miss */<br />
extern int hit(struct application *ap, struct partition *PartHeadp, struct seg *segs);<br />
extern int miss(register struct application *ap);<br />
<br />
char usage[] = "\<br />
Usage: rtexample model.g objects...\n";<br />
<br />
main(int argc, char **argv)<br />
{<br />
static struct rt_i *rtip; /* rt_dirbuild returns this */<br />
char idbuf[132]; /* First ID record info */<br />
<br />
if( argc < 3 ) {<br />
(void)fputs(usage, stderr);<br />
exit(1);<br />
}<br />
<br />
/*<br />
* Load database.<br />
* rt_dirbuild() returns an "instance" pointer which describes<br />
* the database to be ray traced. It also gives you back the<br />
* title string in the header (ID) record.<br />
*/<br />
if( (rtip=rt_dirbuild(argv[1], idbuf, sizeof(idbuf))) == RTI_NULL ) {<br />
fprintf(stderr,"rtexample: rt_dirbuild failure\n");<br />
exit(2);<br />
}<br />
ap.a_rt_i = rtip; /* your application uses this instance */<br />
fprintf(stderr, "db title: %s\n", idbuf);<br />
<br />
/* Walk trees.<br />
* Here you identify any object trees in the database that you<br />
* want included in the ray trace.<br />
*/<br />
while( argc > 2 ) {<br />
if( rt_gettree(rtip, argv[2]) < 0 )<br />
fprintf(stderr,"rt_gettree(%s) FAILED\n", argv[0]);<br />
argc--;<br />
argv++;<br />
}<br />
/*<br />
* This next call gets the database ready for ray tracing.<br />
* (it precomputes some values, sets up space partitioning, etc.)<br />
*/<br />
rt_prep_parallel(rtip,1);<br />
<br />
/*<br />
* Set the ray start point and direction<br />
* rt_shootray() uses these two to determine what ray to fire.<br />
* In this case we simply shoot down the z axis toward the<br />
* origin from 10 meters away [librt assumes units of millimeters.<br />
* not that is really maters here, but an MGED database made with<br />
* units=mm will have the same values in the file (and thus in<br />
* librt) that you see displayed by MGED.<br />
*/<br />
VSET( ap.a_ray.r_pt, 0, 0, 10000 );<br />
VSET( ap.a_ray.r_dir, 0, 0, -1 );<br />
<br />
VPRINT( "Pnt", ap.a_ray.r_pt );<br />
VPRINT( "Dir", ap.a_ray.r_dir );<br />
<br />
/* Shoot Ray */<br />
ap.a_hit = hit; /* where to go on a hit */<br />
ap.a_miss = miss; /* where to go on a miss */<br />
(void)rt_shootray( &ap ); /* do it */<br />
<br />
/*<br />
* A real application would probably set up another<br />
* ray and fire again.<br />
*/<br />
<br />
return(0);<br />
}<br />
<br />
/*<br />
* rt_shootray() was told to call this on a hit. He gives up the<br />
* application structure which describes the state of the world<br />
* (see raytrace.h), and a circular linked list of partitions,<br />
* each one describing one in and out segment of one region.<br />
*/<br />
hit(register struct application *ap, struct partition *PartHeadp, struct seg *segs)<br />
{<br />
/* see raytrace.h for all of these guys */<br />
register struct partition *pp;<br />
register struct hit *hitp;<br />
register struct soltab *stp;<br />
struct curvature cur;<br />
point_t pt;<br />
vect_t inormal;<br />
vect_t onormal;<br />
<br />
/* examine each partition until we get back to the head */<br />
for( pp=PartHeadp->pt_forw; pp != PartHeadp; pp = pp->pt_forw ) {<br />
bu_log("\n--- Hit region %s (in %s, out %s)\n",<br />
pp->pt_regionp->reg_name,<br />
pp->pt_inseg->seg_stp->st_name,<br />
pp->pt_outseg->seg_stp->st_name );<br />
<br />
/* inhit info */<br />
hitp = pp->pt_inhit;<br />
stp = pp->pt_inseg->seg_stp;<br />
<br />
VJOIN1( pt, ap->a_ray.r_pt, hitp->hit_dist, ap->a_ray.r_dir );<br />
<br />
/* This macro takes care of the flip flag and all that */<br />
RT_HIT_NORMAL( inormal, hitp, stp, &(ap->a_ray), pp->pt_inflip );<br />
<br />
rt_pr_hit( " In", hitp );<br />
VPRINT( " Ipoint", pt );<br />
VPRINT( " Inormal", inormal );<br />
/*<br />
* This next macro fills in the curvature information<br />
* which consists on a principle direction vector, and<br />
* the inverse radii of curvature along that direction<br />
* and perpendicular to it. Positive curvature bends<br />
* toward the outward pointing normal.<br />
*/<br />
RT_CURVATURE( &cur, hitp, pp->pt_inflip, stp );<br />
VPRINT("PDir", cur.crv_pdir );<br />
bu_log(" c1=%g\n", cur.crv_c1);<br />
bu_log(" c2=%g\n", cur.crv_c2);<br />
<br />
/* outhit info */<br />
hitp = pp->pt_outhit;<br />
stp = pp->pt_outseg->seg_stp;<br />
VJOIN1( pt, ap->a_ray.r_pt, hitp->hit_dist, ap->a_ray.r_dir );<br />
RT_HIT_NORMAL( onormal, hitp, stp, &(ap->a_ray), pp->pt_outflip );<br />
<br />
rt_pr_hit( " Out", hitp );<br />
VPRINT( " Opoint", pt );<br />
VPRINT( " Onormal", onormal );<br />
}<br />
<br />
/*<br />
* A more complicated application would probably fill in a<br />
* new local application structure and describe say a reflected<br />
* or refracted ray, and then call rt_shootray with it.<br />
*/<br />
<br />
/*<br />
* This value is returned by rt_shootray<br />
* a hit usually returns 1, miss 0.<br />
*/<br />
return(1);<br />
}<br />
<br />
/*<br />
* rt_shootray() was told to call this on a miss.<br />
*/<br />
miss(register struct application *ap)<br />
{<br />
bu_log("missed\n");<br />
return(0);<br />
}<br />
<br />
/*<br />
* Local Variables:<br />
* mode: C<br />
* tab-width: 8<br />
* c-basic-offset: 4<br />
* indent-tabs-mode: t<br />
* End:<br />
* ex: shiftwidth=4 tabstop=8<br />
*/<br />
</source></div>MinuteElectronhttps://brlcad.org/w/index.php?title=Developing_applications&diff=51Developing applications2007-09-08T21:45:40Z<p>MinuteElectron: New page: The following links provide a very brief introduction into writing applications with BRL-CAD. * {{pdf|Application Development|An introduction to writing BRL-CAD applications}} * [[Example...</p>
<hr />
<div>The following links provide a very brief introduction into writing applications with BRL-CAD.<br />
<br />
* {{pdf|Application Development|An introduction to writing BRL-CAD applications}}<br />
* [[Example Application|An example program]]<br />
<br />
== Standards Support ==<br />
Several tools in BRL-CAD conform to various national and international standards including:<br />
* C Programming Language (ANSI/ISO 9899:1990)<br />
* International Graphics Exchange Standard (IGES) (ANSI Y14.26M-1981)<br />
* Virtual Reality Modeling Language (VRML) 2.0 (ISO/IEC 14772-1:1997)<br />
* Portable Network Graphics (PNG) Specification (ISO/IEC 15948:2003)<br />
* Transmission Control Protocol (TCP) (IETF RFC 793)<br />
* Internet Protocol (IP) v4 (IETF RFC 791)<br />
* User Datagram Protocol (UDP) (IETF RFC 768)<br />
* Internet Control Message Protocol (ICMP) (IETF RFC 792)<br />
* Test Transmission Control Protocol (TTCP) (NWG RFC 2398)<br />
* X Window System Protocol (X10R4 and X11R6)<br />
* OpenGL Standard (OpenGL Graphics System 1.2 Specification)<br />
* Character Encoding (ISO/IEC 8859-1)<br />
* Portable Operating System Interface (POSIX) Shell (IEEE 1003.2 and ISO/IEC 9945-2:2003)<br />
* American Standard Code for Information Interchange (ASCII) (ANSI X3.4-1986, EMCA-6, ISO/IEC 646:1991)<br />
* Really Simple Syndication (RSS) 2.0 (subset of ISO 8879:1986(E) and REC-xml-20040204)<br />
* International System of Units (SI and ISO 31 and ISO 1000 and 55 FR 52242-52245)<br />
* U.S. customary units (NIST Handbook 44)</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:Application_Development.pdf&diff=50File:Application Development.pdf2007-09-08T21:02:07Z<p>MinuteElectron: Category:Documentation</p>
<hr />
<div>[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Documentation&diff=49Documentation2007-09-08T20:44:52Z<p>MinuteElectron: Developing applications</p>
<hr />
<div># [[Overview|Overview of BRL-CAD]]<br />
## {{pdf|Industry Diagram|BRL-CAD Industry Diagram}}<br />
# {{pdf|Introduction to MGED|Introduction to MGED}}<br />
## {{pdf|MGED Quick Reference Card|MGED Quick Reference Card}} (Also available as a {{pdf|MGED Quick Reference Trifold Card|Trifold Card}})<br />
## {{pdf|Shift Grips Quick Reference Guide|Shift Grips Quick Reference Guide}}<br />
# {{pdf|Principles of Effective Modeling|Principles of Effective Modeling}}<br />
# {{pdf|Converting Geometry|Converting Geometry Between BRL-CAD and other Formats}}<br />
# [[Developing applications]]<br />
[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:PDF_icon.png&diff=48File:PDF icon.png2007-09-08T20:04:26Z<p>MinuteElectron: uploaded a new version of "Image:PDF icon.png": Transparency.</p>
<hr />
<div>PDF icon.</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:PDF_icon.png&diff=47File:PDF icon.png2007-09-08T19:58:27Z<p>MinuteElectron: uploaded a new version of "Image:PDF icon.png"</p>
<hr />
<div>PDF icon.</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Template:Pdf&diff=46Template:Pdf2007-09-08T19:55:05Z<p>MinuteElectron: Adding icon.</p>
<hr />
<div>[[Media:{{{1}}}.pdf|{{{2}}}]] [[Image:PDF icon.png|17px]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:PDF_icon.png&diff=45File:PDF icon.png2007-09-08T19:53:02Z<p>MinuteElectron: PDF icon.</p>
<hr />
<div>PDF icon.</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Documentation&diff=44Documentation2007-09-08T19:36:02Z<p>MinuteElectron: Adding all pdfs.</p>
<hr />
<div># [[Overview|Overview of BRL-CAD]]<br />
## {{pdf|Industry Diagram|BRL-CAD Industry Diagram}}<br />
# {{pdf|Introduction to MGED|Introduction to MGED}}<br />
## {{pdf|MGED Quick Reference Card|MGED Quick Reference Card}} (Also available as a {{pdf|MGED Quick Reference Trifold Card|Trifold Card}})<br />
## {{pdf|Shift Grips Quick Reference Guide|Shift Grips Quick Reference Guide}}<br />
# {{pdf|Principles of Effective Modeling|Principles of Effective Modeling}}<br />
# {{pdf|Converting Geometry|Converting Geometry Between BRL-CAD and other Formats}}<br />
<br />
[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:Converting_Geometry.pdf&diff=43File:Converting Geometry.pdf2007-09-08T19:35:43Z<p>MinuteElectron: Category:Documentation</p>
<hr />
<div>[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:Principles_of_Effective_Modeling.pdf&diff=42File:Principles of Effective Modeling.pdf2007-09-08T19:29:45Z<p>MinuteElectron: Category:Documentation</p>
<hr />
<div>[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:Shift_Grips_Quick_Reference_Guide.pdf&diff=41File:Shift Grips Quick Reference Guide.pdf2007-09-08T19:21:16Z<p>MinuteElectron: Category:Documentation</p>
<hr />
<div>[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Template:Pdf&diff=40Template:Pdf2007-09-08T19:20:23Z<p>MinuteElectron: Adding.pdf</p>
<hr />
<div>[[Media:{{{1}}}.pdf|{{{2}}}]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:MGED_Quick_Reference_Trifold_Card.pdf&diff=39File:MGED Quick Reference Trifold Card.pdf2007-09-08T19:16:44Z<p>MinuteElectron: Category:Documentation</p>
<hr />
<div>[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:MGED_Quick_Reference_Card.pdf&diff=38File:MGED Quick Reference Card.pdf2007-09-08T19:13:58Z<p>MinuteElectron: Category:Documentation</p>
<hr />
<div>[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Template:Pdf&diff=37Template:Pdf2007-09-08T19:05:20Z<p>MinuteElectron: Adding Media prefix</p>
<hr />
<div>[[Media:{{{1}}}|{{{2}}}]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Documentation&diff=36Documentation2007-09-08T19:05:04Z<p>MinuteElectron: Removing image prefix.</p>
<hr />
<div># [[Overview|Overview of BRL-CAD]]<br />
## {{pdf|Industry Diagram.pdf|BRL-CAD Industry Diagram}}<br />
# {{pdf|Introduction to MGED.pdf|Introduction to MGED}}<br />
<br />
[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Template:Pdf&diff=35Template:Pdf2007-09-08T19:04:18Z<p>MinuteElectron: Adding a colon.</p>
<hr />
<div>[[:{{{1}}}|{{{2}}}]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Template:Pdf&diff=34Template:Pdf2007-09-08T18:58:14Z<p>MinuteElectron: Weird.</p>
<hr />
<div>[[{{{1}}}|{{{2}}}]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Documentation&diff=33Documentation2007-09-08T18:56:53Z<p>MinuteElectron: Adding some more stuff.</p>
<hr />
<div># [[Overview|Overview of BRL-CAD]]<br />
## {{pdf|Image:Industry Diagram.pdf|BRL-CAD Industry Diagram}}<br />
# {{pdf|Image:Introduction to MGED.pdf|Introduction to MGED}}<br />
<br />
[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:Introduction_to_MGED.pdf&diff=32File:Introduction to MGED.pdf2007-09-08T18:55:31Z<p>MinuteElectron: Introduction to MGED.
Category:Documentation</p>
<hr />
<div>Introduction to MGED.<br />
<br />
[[Category:Documentation]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Template:Pdf&diff=31Template:Pdf2007-09-08T18:50:19Z<p>MinuteElectron: Adding closing ].</p>
<hr />
<div>[[{{{2}}}|{{{1}}}]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Template:Pdf&diff=30Template:Pdf2007-09-08T18:49:39Z<p>MinuteElectron: Changing order.</p>
<hr />
<div>[[{{{2}}}|{{{1}}}]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Template:Pdf&diff=29Template:Pdf2007-09-08T18:41:08Z<p>MinuteElectron: Starting template, could be improved.</p>
<hr />
<div>[[{{{1}}}|{{{2}}}]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:Industry_Diagram.pdf&diff=28File:Industry Diagram.pdf2007-09-08T18:22:28Z<p>MinuteElectron: 4th version of a diagram showing BRL-CAD industry coverage.</p>
<hr />
<div>4th version of a diagram showing BRL-CAD industry coverage.</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Overview&diff=27Overview2007-09-08T14:23:20Z<p>MinuteElectron: adding section acknowlegements, some of the stuff might need to be here due to copyrights. But could be moved to the seperate Credits page.</p>
<hr />
<div>Since 1979, the U.S. Army Research Laboratory has been developing and distributing the BRL-CAD constructive solid geometry (CSG) modeling package for a wide range of military and industrial applications. The package includes a large collection of tools and utilities including an interactive geometry editor, raytracing and generic framebuffer libraries, a network-distributed image-processing and signal-processing capability, and an embedded scripting language.<br />
<br />
== What is BRL-CAD? ==<br />
Since the late 1950s, computers have been used to assist with the design and study of combat vehicle systems. The result has been a reduction in the amount of time and money required to take a system from the drawing board to full-scale production as well as increased efficiency in testing and evaluation.<br />
<br />
In 1979, the U.S. Army Ballistic Research Laboratory (BRL) (now the U.S. Army Research Laboratory [ARL]) expressed a need for tools that could assist with the computer simulation and engineering analysis of combat vehicle systems and environments. When no existing computer-aided design (CAD) package was found to be adequate for this purpose, BRL software developers began assembling a suite of utilities capable of interactively displaying, editing, and interrogating geometric models. This suite became known as BRL-CAD.<br />
<br />
Now comprising almost a million lines of C code, BRL-CAD has become a powerful constructive solid geometry (CSG) modeling package that has been licensed at over 2,000 sites throughout the world. It contains a large collection of tools, utilities, and libraries including an interactive geometry editor, raytracing and generic framebuffer libraries, a network-distributed image-processing and signal-processing capability, and a customizable embedded scripting language. In addition, BRL-CAD simultaneously supports dual interaction methods, one using a command line and one using a graphical user interface (GUI).<br />
<br />
A particular strength of the package lies in its ability to build and analyze realistic models of complex objects using a relatively small set of "primitive shapes." To do this, the shapes are manipulated by employing the basic Boolean operations of union, subtraction, and intersection. Another strength of the package is the speed of its raytracer, which is one of the fastest in existence. Finally, BRL-CAD users can accurately model objects on scales ranging from the subatomic through the galactic and get "all the details, all the time." <br />
<br />
== Why CSG Modeling? ==<br />
Although BRL-CAD has been used for a wide variety of engineering and graphics applications, the package's primary purpose continues to be the support of (1) ballistic and (2) electromagnetic analyses. Accordingly, developers have found CSG modeling to be the best approach in terms of model accuracy, storage efficiency, precision, and speed of computational analysis.<br />
<br />
While polygonal and boundary representation (B-rep) modeling often focuses on just the surfaces of objects, CSG modeling focuses on the entire volume and content of objects. This gives BRL-CAD the capability to be "more than skin deep" and build objects with real-world materials, densities, and thicknesses so that analysts can study physical phenomena such as ballistic penetration and thermal, radiative, neutron, and other types of transport. <br />
<br />
== Package Content ==<br />
[[Image:Data flow structure.png|thumb|396px|right|'''Figure 1.''' BRL-CAD data flow structure]]<br />
In keeping with the UNIX philosophy of developing independent tools to perform single, specific tasks and then linking the tools together in a package, BRL-CAD is basically a collection of libraries, tools, and utilities that work together to create, raytrace, and interrogate geometry and manipulate files and data. The basic data flow structure of the package is provided in Figure 1.<br />
<br />
== Libraries ==<br />
The BRL-CAD libraries (designated by the prefix "lib") are designed primarily for the geometric modeler who also wants to tinker with software and, perhaps, design custom tools. Each library fits into one of three categories: (1) creating and/or editing geometry, (2) raytracing geometry, or (3) image handling. The following is a list of the major BRL-CAD libraries and descriptions of their functions. <br />
<br />
* libbu – a basic utility (bu) library containing fundamental computer science types of routines, including manipulating data (e.g., converting from host format data to network format data), parallel processing, parsing parameters, handling variable-length strings, performing error checks, converting units from one format to another, manipulating bit vectors, running parallel-safe versions of input/output (I/O) routines, and maintaining symbol tables.<br />
<br />
* libbn – a library of routines to support basic numerical (bn) handling, including 2-D/3-D vector, matrix, and quaternion manipulation; 3-D plotting support; automatic inference of image size (BRL-CAD images have no internal header; image dimensions are intuited from the size of the file); and wavelet decomposition and reconstruction, etc.<br />
<br />
* libdm – BRL-CAD's primary graphics display manager (dm) library. It handles opening windows onto the display and displaying geometry in the graphics window, etc.<br />
<br />
* libfb – the framebuffer (fb) library, which supports having a window in which the user puts pixel data when raytracing.<br />
<br />
* libmultispectral and liboptical – the shader and texturing libraries for the raytracer.<br />
<br />
* libpkg – a library that implements a remote procedure call (rpc) mechanism. This library is a predecessor of the modern rpc system. Unlike the typical UNIX rpc service, applications can set up services and handle requests without requiring configuration by a system administrator.<br />
<br />
* librt – the library that contains all of the geometry support, including data representations for the primitives, support for raytracing (rt), and binary I/O support for CSG geometric descriptions.<br />
<br />
* libz – a public-domain compression library.<br />
<br />
* libtcl, libtk, and libitcl – libraries that provide the Tcl/Tk scripting language.<br />
<br />
* libpng – a library that provides portable network graphics (png).<br />
<br />
== Tools and Utilities ==<br />
The application side of BRL-CAD also offers a number of tools and utilities. They primarily concern (1) geometric conversion, (2) geometric interrogation, (3) image format conversion, and (4) command-line-oriented image manipulation. The following is a list of the major BRL-CAD tools and utilities. <br />
<br />
* MGED (Multiple-Device Geometry Editor) – BRL-CAD's graphics editor. (For detailed guidance on the use of MGED as well as a list of all the MGED commands currently available, see Butler et al. [2001].)<br />
<br />
* Tools for raytracing and interrogating raytraced geometric objects.<br />
<br />
** rt – the main raytracer for rendering images in BRL-CAD.<br />
<br />
** nirt – a package for firing rays interactively and getting information about what the rays run into.<br />
<br />
** remrt – a network-distributed raytracing package.<br />
<br />
* An assortment of geometric converters to convert to and/or from other geometry formats, including Euclid, ACAD, AutoCAD DXF, TANKILL, Wavefront OBJ, Pro/ENGINEER, JACK (the human factors model for doing workload/usability studies), Viewpoint Data Lab, NASTRAN, Digital Equipment's Object File Format (OFF), Virtual Reality Mark-up Language (VRML), Stereo Lithography (STL), Cyberware Digitizer data, and FASTGEN4.<br />
<br />
* bwish – a Tcl/Tk interpreter in a windowing shell with enhancements compiled into it for accessing BRL-CAD libraries. It also includes various other extensions to the Tcl language.<br />
<br />
* irprep – produces input to the PRISM (Physically Realistic Infrared Simulation Model) code.<br />
<br />
* JOVE (Jonathan's Own Version of Emacs) – a fast, light implementation of Emacs.<br />
<br />
* Applications for displaying images of various types on the framebuffer application and retrieving data from that framebuffer into images of various types.<br />
<br />
* Tools for generating geometry for common objects such as fences, walls, and geometric mathematical oddities (e.g., the sphereflake shown in Figure 2 in Section 4).<br />
<br />
* Data manipulation programs to (1) convert integers to floats, floats to doubles, etc. (e.g., cv); (2) perform mathematical operations on file elements (e.g., imod, umod, and dmod); (3) compute statistics of file elements (e.g., istat, ustat, and dstat); etc.<br />
<br />
* Utilities for building animation scripts – keeping track of columnar data and interpolating it to allow one to produce input to the rt program to render multiple items for animation.<br />
<br />
* Utah Raster Tool Kit – image manipulation of all RLE-based images.<br />
<br />
* Programs for manipulating images and converting between different image file types. The two primary BRL-CAD types are pix (24-bit red, green, and blue [RGB] color images) and bw (8-bit greyscale images). Converters exist for various image formats including alias, png, ppm, etc.<br />
<br />
* Programs for filtering images, doing histograms on the image data, and extracting rectangles from the images.<br />
<br />
* Tools for combining two images and blending them together. (These tools were created before good image editing tools for video production were available; today users would typically load the images directly into a video editing package.)<br />
<br />
== Benchmark Testing ==<br />
As changes are implemented in BRL-CAD, ARL developers run a standard set of computationally intensive image files (shown in Figure 2) on a common machine in order to benchmark and compare raytrace performance. In addition, these images are provided with each source distribution of the package so that users can also test performance on their machines, if desired.<br />
<br />
To run the benchmark images, run the script run.sh in the "bench" directory of the source directory tree.<br />
<gallery><br />
Image:Benchmarking Moss.jpg|Moss<br />
Image:Benchmarking World.jpg|World<br />
Image:Benchmarking Star.jpg|Star<br />
Image:Benchmarking Bldg 391.jpg|Bldg 391<br />
Image:Benchmarking M35.jpg|M35<br />
Image:Benchmarking Sphflake.jpg|Sphflake<br />
</gallery><br />
<br />
== Acknowledgements ==<br />
The authors would like to thank the members of the Advanced Computer Systems Team, who reviewed this document in a timely manner and made many helpful suggestions to improve its accuracy and presentation. At the time this document was prepared team members included John Anderson, TraNese Christy, Bob Parker, Ron Bowers, and Sean Morrison.<br />
<br />
In addition, the authors would like to especially acknowledge Mike Muuss, a team member and the original architect of BRL-CAD, who passed away in the fall of 2000. Without his vision, this work would not have been possible. Therefore, the BRL-CAD Tutorial Series is dedicated to his memory.</div>MinuteElectronhttps://brlcad.org/w/index.php?title=Overview&diff=26Overview2007-09-08T14:20:41Z<p>MinuteElectron: Adding benchmark testing section.</p>
<hr />
<div>Since 1979, the U.S. Army Research Laboratory has been developing and distributing the BRL-CAD constructive solid geometry (CSG) modeling package for a wide range of military and industrial applications. The package includes a large collection of tools and utilities including an interactive geometry editor, raytracing and generic framebuffer libraries, a network-distributed image-processing and signal-processing capability, and an embedded scripting language.<br />
<br />
== What is BRL-CAD? ==<br />
Since the late 1950s, computers have been used to assist with the design and study of combat vehicle systems. The result has been a reduction in the amount of time and money required to take a system from the drawing board to full-scale production as well as increased efficiency in testing and evaluation.<br />
<br />
In 1979, the U.S. Army Ballistic Research Laboratory (BRL) (now the U.S. Army Research Laboratory [ARL]) expressed a need for tools that could assist with the computer simulation and engineering analysis of combat vehicle systems and environments. When no existing computer-aided design (CAD) package was found to be adequate for this purpose, BRL software developers began assembling a suite of utilities capable of interactively displaying, editing, and interrogating geometric models. This suite became known as BRL-CAD.<br />
<br />
Now comprising almost a million lines of C code, BRL-CAD has become a powerful constructive solid geometry (CSG) modeling package that has been licensed at over 2,000 sites throughout the world. It contains a large collection of tools, utilities, and libraries including an interactive geometry editor, raytracing and generic framebuffer libraries, a network-distributed image-processing and signal-processing capability, and a customizable embedded scripting language. In addition, BRL-CAD simultaneously supports dual interaction methods, one using a command line and one using a graphical user interface (GUI).<br />
<br />
A particular strength of the package lies in its ability to build and analyze realistic models of complex objects using a relatively small set of "primitive shapes." To do this, the shapes are manipulated by employing the basic Boolean operations of union, subtraction, and intersection. Another strength of the package is the speed of its raytracer, which is one of the fastest in existence. Finally, BRL-CAD users can accurately model objects on scales ranging from the subatomic through the galactic and get "all the details, all the time." <br />
<br />
== Why CSG Modeling? ==<br />
Although BRL-CAD has been used for a wide variety of engineering and graphics applications, the package's primary purpose continues to be the support of (1) ballistic and (2) electromagnetic analyses. Accordingly, developers have found CSG modeling to be the best approach in terms of model accuracy, storage efficiency, precision, and speed of computational analysis.<br />
<br />
While polygonal and boundary representation (B-rep) modeling often focuses on just the surfaces of objects, CSG modeling focuses on the entire volume and content of objects. This gives BRL-CAD the capability to be "more than skin deep" and build objects with real-world materials, densities, and thicknesses so that analysts can study physical phenomena such as ballistic penetration and thermal, radiative, neutron, and other types of transport. <br />
<br />
== Package Content ==<br />
[[Image:Data flow structure.png|thumb|396px|right|'''Figure 1.''' BRL-CAD data flow structure]]<br />
In keeping with the UNIX philosophy of developing independent tools to perform single, specific tasks and then linking the tools together in a package, BRL-CAD is basically a collection of libraries, tools, and utilities that work together to create, raytrace, and interrogate geometry and manipulate files and data. The basic data flow structure of the package is provided in Figure 1.<br />
<br />
== Libraries ==<br />
The BRL-CAD libraries (designated by the prefix "lib") are designed primarily for the geometric modeler who also wants to tinker with software and, perhaps, design custom tools. Each library fits into one of three categories: (1) creating and/or editing geometry, (2) raytracing geometry, or (3) image handling. The following is a list of the major BRL-CAD libraries and descriptions of their functions. <br />
<br />
* libbu – a basic utility (bu) library containing fundamental computer science types of routines, including manipulating data (e.g., converting from host format data to network format data), parallel processing, parsing parameters, handling variable-length strings, performing error checks, converting units from one format to another, manipulating bit vectors, running parallel-safe versions of input/output (I/O) routines, and maintaining symbol tables.<br />
<br />
* libbn – a library of routines to support basic numerical (bn) handling, including 2-D/3-D vector, matrix, and quaternion manipulation; 3-D plotting support; automatic inference of image size (BRL-CAD images have no internal header; image dimensions are intuited from the size of the file); and wavelet decomposition and reconstruction, etc.<br />
<br />
* libdm – BRL-CAD's primary graphics display manager (dm) library. It handles opening windows onto the display and displaying geometry in the graphics window, etc.<br />
<br />
* libfb – the framebuffer (fb) library, which supports having a window in which the user puts pixel data when raytracing.<br />
<br />
* libmultispectral and liboptical – the shader and texturing libraries for the raytracer.<br />
<br />
* libpkg – a library that implements a remote procedure call (rpc) mechanism. This library is a predecessor of the modern rpc system. Unlike the typical UNIX rpc service, applications can set up services and handle requests without requiring configuration by a system administrator.<br />
<br />
* librt – the library that contains all of the geometry support, including data representations for the primitives, support for raytracing (rt), and binary I/O support for CSG geometric descriptions.<br />
<br />
* libz – a public-domain compression library.<br />
<br />
* libtcl, libtk, and libitcl – libraries that provide the Tcl/Tk scripting language.<br />
<br />
* libpng – a library that provides portable network graphics (png).<br />
<br />
== Tools and Utilities ==<br />
The application side of BRL-CAD also offers a number of tools and utilities. They primarily concern (1) geometric conversion, (2) geometric interrogation, (3) image format conversion, and (4) command-line-oriented image manipulation. The following is a list of the major BRL-CAD tools and utilities. <br />
<br />
* MGED (Multiple-Device Geometry Editor) – BRL-CAD's graphics editor. (For detailed guidance on the use of MGED as well as a list of all the MGED commands currently available, see Butler et al. [2001].)<br />
<br />
* Tools for raytracing and interrogating raytraced geometric objects.<br />
<br />
** rt – the main raytracer for rendering images in BRL-CAD.<br />
<br />
** nirt – a package for firing rays interactively and getting information about what the rays run into.<br />
<br />
** remrt – a network-distributed raytracing package.<br />
<br />
* An assortment of geometric converters to convert to and/or from other geometry formats, including Euclid, ACAD, AutoCAD DXF, TANKILL, Wavefront OBJ, Pro/ENGINEER, JACK (the human factors model for doing workload/usability studies), Viewpoint Data Lab, NASTRAN, Digital Equipment's Object File Format (OFF), Virtual Reality Mark-up Language (VRML), Stereo Lithography (STL), Cyberware Digitizer data, and FASTGEN4.<br />
<br />
* bwish – a Tcl/Tk interpreter in a windowing shell with enhancements compiled into it for accessing BRL-CAD libraries. It also includes various other extensions to the Tcl language.<br />
<br />
* irprep – produces input to the PRISM (Physically Realistic Infrared Simulation Model) code.<br />
<br />
* JOVE (Jonathan's Own Version of Emacs) – a fast, light implementation of Emacs.<br />
<br />
* Applications for displaying images of various types on the framebuffer application and retrieving data from that framebuffer into images of various types.<br />
<br />
* Tools for generating geometry for common objects such as fences, walls, and geometric mathematical oddities (e.g., the sphereflake shown in Figure 2 in Section 4).<br />
<br />
* Data manipulation programs to (1) convert integers to floats, floats to doubles, etc. (e.g., cv); (2) perform mathematical operations on file elements (e.g., imod, umod, and dmod); (3) compute statistics of file elements (e.g., istat, ustat, and dstat); etc.<br />
<br />
* Utilities for building animation scripts – keeping track of columnar data and interpolating it to allow one to produce input to the rt program to render multiple items for animation.<br />
<br />
* Utah Raster Tool Kit – image manipulation of all RLE-based images.<br />
<br />
* Programs for manipulating images and converting between different image file types. The two primary BRL-CAD types are pix (24-bit red, green, and blue [RGB] color images) and bw (8-bit greyscale images). Converters exist for various image formats including alias, png, ppm, etc.<br />
<br />
* Programs for filtering images, doing histograms on the image data, and extracting rectangles from the images.<br />
<br />
* Tools for combining two images and blending them together. (These tools were created before good image editing tools for video production were available; today users would typically load the images directly into a video editing package.)<br />
<br />
== Benchmark Testing ==<br />
As changes are implemented in BRL-CAD, ARL developers run a standard set of computationally intensive image files (shown in Figure 2) on a common machine in order to benchmark and compare raytrace performance. In addition, these images are provided with each source distribution of the package so that users can also test performance on their machines, if desired.<br />
<br />
To run the benchmark images, run the script run.sh in the "bench" directory of the source directory tree.<br />
<gallery><br />
Image:Benchmarking Moss.jpg|Moss<br />
Image:Benchmarking World.jpg|World<br />
Image:Benchmarking Star.jpg|Star<br />
Image:Benchmarking Bldg 391.jpg|Bldg 391<br />
Image:Benchmarking M35.jpg|M35<br />
Image:Benchmarking Sphflake.jpg|Sphflake<br />
</gallery></div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:Benchmarking_Sphflake.jpg&diff=25File:Benchmarking Sphflake.jpg2007-09-08T14:16:55Z<p>MinuteElectron: 'Sphflake' benchmarking image.
Category:Benchmarking</p>
<hr />
<div>'Sphflake' benchmarking image.<br />
<br />
[[Category:Benchmarking]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:Benchmarking_M35.jpg&diff=24File:Benchmarking M35.jpg2007-09-08T14:16:18Z<p>MinuteElectron: 'M35' benchmarking image.
Category:Benchmarking</p>
<hr />
<div>'M35' benchmarking image.<br />
<br />
[[Category:Benchmarking]]</div>MinuteElectronhttps://brlcad.org/w/index.php?title=File:Benchmarking_Bldg_391.jpg&diff=22File:Benchmarking Bldg 391.jpg2007-09-08T14:14:37Z<p>MinuteElectron: 'Bldg 291' benchmarking image.
Category:Benchmarking</p>
<hr />
<div>'Bldg 291' benchmarking image.<br />
<br />
[[Category:Benchmarking]]</div>MinuteElectron