First, I want to thank all of the developers of BRL CAD. I want to create a cut down specialized CAD viewer for dxf files. Is there a text file that will help me get started and show me what I need to download? I am using a Windows platform. Thank you.
There is quite a lot of documentation. I'd suggest starting with the README and INSTALL files, naturally, and the following up with the doc/README.Windows and HACKING files. They are all available in a source distribution.
Source code relevant to your goal:
Current dxf importer and exporter.
src/librt and include/raytrace.h
Our main LIBRT ray trace library including support for reading/writing .g files and processing geometry in memory
Display manager code that displays geometry for various BRL-CAD tools (e.g., mged).
A library that provides hundreds of geometry editing/processing commands to calling applications via C.
The main source code for our main editing GUI.
Thank you for your response. I only got Archer to open a file. I guess it had to move in and get its furniture in order before it would work in my PC. It looks very limited. Am I doing something wrong? I cannot see a file after I open it using MGED. I was hoping I could take an existing program and do some severe modifications for my use. Any more suggestions?
I will get working on the C files tonight.
There is a (closed source) BRL-CAD viewer application for MS Windows:
It is build on top of the brlcad.dll runtime library. To do as well you need the DLL's developer package brlcad-~-dll_devel.zip. There you may use the usual BRL-CAD C API or the core's C++ interface:
My final application for BRL-CAD is a CAD viewer. My need for CPU speed may not be critical. I would like to try VisualBasic. Will the DLL's work with Visual Basic? If so, does anyone have a starter template in VB? Also, I cannot view the XML files. I only get source code. Is there an index.xml, UNIX converter or something that will allow me to view the instructions? Thank you again.
You're probably not doing anything wrong other than just not knowing how to use MGED. It's not a discoverable interface - it requires training. There are beginner tutorials on the website to get one started that take most people about a day to get through. (Tools->GeometryBrowser might help too).
That said, the DLLs should certainly work with Visual Basic but I'm not aware of anyone that has tried. The documentation "source" files are XML which are then processed into HTML and PDF when a source release is produced. If you don't have xslt/fop processing tools set up on your system (which you probably don't if you had to ask), then you'll probably be best off downloading one of the binary linux distributions and reading the html docs.
Thank you Sean. I am trying to find info on brlcad.dll and openNurbs.dll. I have them declared and now I cannot find the statements to call.
The DLLs will work with VisualBasic. I even programmed a COM interface together with an example application in MS Excel (VBA). However, this was some years ago. I'll look for it. If you are interested I could probably release the code for the COM interface (but today a .NET managed code interface would be more up-to-date).
Daniel, that would be great.
Sean, last night, I went through several dozen commands with MGED.
I can see how to manipulate images using MGED. I still am not able to find the CALL commands for brlcad.dll.
However, I did find some commands for openNurbs.dll. Our work is expanding to some CAD modelling. We now want to extend our work with brlcad with some tensor analysis in response to ballistic collisions. We are working with super fibers.
That sounds great, though I'm not sure what your question is exactly. If you mean that you don't know what the API is and what functions are available, the place to start is in the public header files. There are, however, hundreds of functions available that work together differently depending on your needs.
I'd suggest starting with something very simple like calling "bu_log" (a simple function that prints a string to console) which if I understand my VB calling practice, would simply be a _bu_log call. The brlcad.def file in the runtime distribution lists the calls exported as do all of the public API headers (e.g., raytrace.h).
A word of caution, and Daniel may correct me, but I believe the brlcad.dll you're using there from the Runtime DLL distribution only exports about 70 of the most frequently used core functions. There are more than 2000 calls in a full binary distribution. The "bu_log" function is one of those exported in both, though, so you should be able to test with that regardless.
I recommend 1) asking a lot of detailed questions - don't be shy, and 2) make sure you've at least glanced through http://brlcad.org/wiki/Developing_applications
The HACKING file (contained within all source distributions) also has a section on the individual libraries available (e.g., LIBRT) and how the filesystem is organized.
Hope some of that helps.
If you are using MS Visual Basic you need to declare the C API functions there (if you want to use them). E.g.
Declare Sub rt_gettree Lib "brlcad.dll" (rtiHandle As Long, objectName As String)
It is possible to use BRL-CAD's C API from VB directly but it's not trivial. I would recommend a layer in between (COM or managed code for .NET).
What does rt_gettree return? I still have not been able to get much performed in VB other than using it as a dos terminal. Where can I find more documentation?
The prototype of rt_gettree can be found in include/raytrace.h. BRL-CAD's native API is in C, therefore you need to understand it and the tutorials brlcad mentioned.
If you program your GUI in VB I recommend a layer in between. As an example I wrote a draft managed code interface:
There you may find the interface's sources (needs the brlcad.dll develop package) and usage examples for C# and VB.
This will show you how VB can make use of BRL-CAD functionality. However, the interface had to be extended to make it practical.