Menu

Getting Started

Developers
dug kirven
2011-01-28
2013-04-22
  • dug kirven

    dug kirven - 2011-01-28

    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.

     
  • Sean Morrison

    Sean Morrison - 2011-01-28

    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:

    src/conv/dxf
        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
    src/libdm
        Display manager code that displays geometry for various BRL-CAD tools (e.g., mged).
    src/libged
       A library that provides hundreds of geometry editing/processing commands to calling applications via C.
    src/mged
       The main source code for our main editing GUI.

    Cheers!
    Sean

     
  • dug kirven

    dug kirven - 2011-01-30

    Sean,
    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.

    Thank you.

    Doug

     
  • Daniel Roßberg

    Daniel Roßberg - 2011-01-31

    There is a (closed source) BRL-CAD viewer application for MS Windows:
    http://www.iabg.de/verteidigung/brlcad/index_en.php
    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:
    http://brlcad.org/wiki/BRL-CAD%27s_core_C%2B%2B_interface

    Regards
        Daniel

     
  • dug kirven

    dug kirven - 2011-02-01

    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.

     
  • Sean Morrison

    Sean Morrison - 2011-02-02

    Doug,

    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.

    Cheers!
    Sean

     
  • dug kirven

    dug kirven - 2011-02-02

    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.

     
  • Daniel Roßberg

    Daniel Roßberg - 2011-02-02

    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

     
  • dug kirven

    dug kirven - 2011-02-02

    Daniel, that would be great.
    Sean, last night, I went through several dozen commands with MGED.

     
  • dug kirven

    dug kirven - 2011-02-03

    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.

     
  • Sean Morrison

    Sean Morrison - 2011-02-03

    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.

    Cheers!
    Sean

     
  • Daniel Roßberg

    Daniel Roßberg - 2011-02-04

    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).

    Daniel

     
  • dug kirven

    dug kirven - 2011-02-05

    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?

     
  • Daniel Roßberg

    Daniel Roßberg - 2011-02-07

    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:
    http://brlcad.org/~rossberg/dotNET.zip
    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.

    Daniel

     

Log in to post a comment.