Stream: brlcad

Topic: Deuces


view this post on Zulip ANUJ MITTAL (Feb 21 2020 at 20:57):

Greetings!
I am junior year undergrad. I started to explore brl-cad as its projects matched with my interests. I am currently working on building a ray tracing software (using C++) for radiative heat transfer purpose using Monte Carlo Methods. In that I am using IGES files for building geometry.

view this post on Zulip ANUJ MITTAL (Feb 21 2020 at 20:58):

I followed this (https://brlcad.org/wiki/Deuces#Getting_Started) link to get started with brl-cad. I am facing a problem with VirtualBox. Screenshot-131.png

It is instructing to disable hardware virtualization as host system doesn't support it. I unchecked the "enable-box", but I am unable to update this setting. I am not familiar with VirtualBox, can anybody please guide?

view this post on Zulip Sean (Feb 22 2020 at 17:04):

hello @ANUJ MITTAL and welcome! what brings you to brl-cad?

view this post on Zulip Sean (Feb 22 2020 at 17:05):

I think the issue with virtualbox is that you have to shut down the virtual machine before you can change settings

view this post on Zulip Sean (Feb 22 2020 at 17:06):

that or you need to change Legacy to something else like off

view this post on Zulip ANUJ MITTAL (Feb 22 2020 at 17:11):

Hi @Sean

I came across brl-cad a while ago when I was looking for open source ray tracing + cad software.
I came to know that it is among the gsoc organizations and its projects are similar to my ongoing projects.

I am excited to contribute something to brl-cad as good open-source ray-tracing + cad software are actually required by the community.

view this post on Zulip Sean (Feb 22 2020 at 17:13):

@ANUJ MITTAL what's your ray tracing background?

view this post on Zulip ANUJ MITTAL (Feb 22 2020 at 17:15):

I used ray-tracing mostly for heat transfer calculations rather than computer graphics.

view this post on Zulip ANUJ MITTAL (Feb 22 2020 at 17:16):

Initially I used TracePro at a laboratory where I was an intern.
I do not have that software at my university. So I decided to write a code myself for those calculations.

view this post on Zulip ANUJ MITTAL (Feb 22 2020 at 17:17):

I have a decent knowledge of Monte Carlo methods and mathematics required for ray-tracing.

view this post on Zulip ANUJ MITTAL (Feb 22 2020 at 17:19):

Also, the code I am writing is able to read data from IGES files. I have successfully imported NURBS data from IGES, in the sense that I can create a surface grid for calculations.

view this post on Zulip Sean (Feb 22 2020 at 17:19):

heat transfer? do tell me ...

view this post on Zulip Sean (Feb 22 2020 at 17:20):

s/me/more/

view this post on Zulip Sean (Feb 22 2020 at 17:21):

we have a pretty extensive iges converter in brl-cad, but it hasn't been updated in over 10 years. it's mostly useful for importing polygonal iges models, though in theory it imports nurbs geometries too

view this post on Zulip Sean (Feb 22 2020 at 17:21):

code is in src/conv/iges if you want to take a look

view this post on Zulip ANUJ MITTAL (Feb 22 2020 at 17:23):

I am from mechanical engineering background.
We do not have formulae to calculate heat transfer through radiation from non standard surfaces like a solar reflector or complex shaped mirrors. So we trace the rays by giving them some energy value and calculate how and how many rays fall on target surface

view this post on Zulip Sean (Feb 22 2020 at 17:25):

that sounds a LOT like a tool we used to have in brl-cad called "rttherm" which did thermal energy transfer calculations

view this post on Zulip Sean (Feb 22 2020 at 17:25):

we finally deleted it a couple years ago because we had no users or customers for it, decided to focus more on our core capabilities

view this post on Zulip ANUJ MITTAL (Feb 22 2020 at 17:30):

Oh!
I think people mostly develop their own programs because open-source is not yet popular in this domain and every one have their different requirements. Moreover, software like TracePro are too expensive for many researchers.

view this post on Zulip ANUJ MITTAL (Feb 22 2020 at 18:28):

Sean said:

I think the issue with virtualbox is that you have to shut down the virtual machine before you can change settings

Thanks @Sean

I am now able to see the codes.
This (https://2nwiki.2n.cz/pages/viewpage.action?pageId=75202968) link provided the steps to enable virtualization.

view this post on Zulip ANUJ MITTAL (Feb 23 2020 at 07:42):

HI @Sean

view this post on Zulip ANUJ MITTAL (Feb 23 2020 at 07:42):

I looked at the IGES codes

view this post on Zulip ANUJ MITTAL (Feb 23 2020 at 07:42):

many header files were missing.

view this post on Zulip ANUJ MITTAL (Feb 23 2020 at 07:44):

How shall I move forward?

view this post on Zulip ANUJ MITTAL (Feb 23 2020 at 07:45):

Meanwhile I will continue exploring deuces

view this post on Zulip Daniel Rossberg (Feb 23 2020 at 16:47):

ANUJ MITTAL said:

many header files were missing.

??? Which headers?

view this post on Zulip ANUJ MITTAL (Feb 23 2020 at 16:59):

@Daniel Rossberg

view this post on Zulip ANUJ MITTAL (Feb 23 2020 at 16:59):

common.h

view this post on Zulip ANUJ MITTAL (Feb 23 2020 at 17:00):

and others in main.c
Now i am looking at n_main.cpp
common.h is used in that as well

view this post on Zulip Daniel Rossberg (Feb 23 2020 at 17:01):

Well, common.h is a very common header, which can be found right in the include directory.

view this post on Zulip ANUJ MITTAL (Feb 23 2020 at 17:03):

oh, I am sorry
I was looking in src only

view this post on Zulip Daniel Rossberg (Feb 23 2020 at 17:09):

If you are using GNU makefiles, it isn't always obvious from where it reads the files.

view this post on Zulip Daniel Rossberg (Feb 23 2020 at 17:17):

A typical pattern is that every BRL-CAD source reads header files from the include directory and includes common.h from there. common.h is the common include for the BRL-CAD sources, which contains some basic declarations.

In src/other are sources from other projects, which are necessary for building BRL-CAD. These usually don't know about the include directory and common.h.

view this post on Zulip ANUJ MITTAL (Feb 23 2020 at 19:34):

Sorry to bug you all again.
I am new to using VirtualBox. I am unable to update cmake even though VM is connected to internet.
Is there a way to transfer files to my PC?

I am using windows10

view this post on Zulip Daniel Rossberg (Feb 25 2020 at 07:16):

@ANUJ MITTAL
Sure, you can compile and run the BRL-CAD programs with Visual Studio on Windows. To do this, you need to install Subversion for downloading the source code (e.g. TortoiseSVN), MS Visual Studio at least in version 2017 (e.g. the Visual Studio 2019 Community edition), and CMake.

view this post on Zulip Daniel Rossberg (Feb 25 2020 at 07:23):

There is an issue with Visual Studio 2019: https://brlcad.zulipchat.com/#narrow/stream/104062-general/topic/general/near/186695851. Maybe, I'll commit the patch and wait if someone with Visual Studio 2017 complains.

view this post on Zulip Daniel Rossberg (Feb 25 2020 at 07:30):

To update the programs in the Linux VM, you had to upgrade the Distribution there.
On the other hand, you could think about setting up a dual boot configuration on your computer with Windows and Linux.

view this post on Zulip ANUJ MITTAL (Feb 25 2020 at 07:46):

@Daniel Rossberg

Thanks! I will look into it

view this post on Zulip Sean (Feb 27 2020 at 04:40):

@ANUJ MITTAL how goes compilation?

view this post on Zulip ANUJ MITTAL (Feb 27 2020 at 07:07):

I downloaded the files through SVN and compiled them.

But I didn't go any further. I will do it this weekend.

view this post on Zulip Daniel Rossberg (Feb 27 2020 at 09:26):

Install the programs by building the CMakePredefinedTargets/INSTALL project and run mged or archer. You can set the installation directory with CMake (CMAKE_INSTALL_PREFIX), such that you don't need administrator privileges to do this.

view this post on Zulip ANUJ MITTAL (Feb 29 2020 at 16:58):

Hi @Daniel Rossberg

I needed some help. I installed Ubuntu and compiled files downloaded from SVN.
I installed it using: make DESTDIR=<path> install
In the usr/brlcad/dev-7.30.5/bin, all files are in this (application/x-sharedlib) format.
I tried to find solutions. Some suggestions were to make .desktop file. It didn't work.

When I try running it, it runs like this Screenshot-from-2020-02-29-22-27-28.png

What to do next?

view this post on Zulip ANUJ MITTAL (Feb 29 2020 at 17:02):

make benchmark worked, make regress failed for test 1 nirt
Screenshot-from-2020-02-29-22-40-01.png [Screenshot-from-2020-02-29-22-40-01.png]

view this post on Zulip Daniel Rossberg (Feb 29 2020 at 17:11):

First the good news: It looks like the build and installation were successful.
But, it wasn't build with X Window support. That's why there are no GUI elements available, but only the command line. At the end of the CMake configuration an overview of the modules which will be build is printed. This looks like

Compile Tcl ........................: ON
Compile Tk .........................: ON
Compile Itcl/Itk ...................: ON
Compile Iwidgets ...................: ON
Compile Tkhtml .....................: ON
Compile tkpng ......................: ON
Compile Tktable ....................: ON
Compile libpng .....................: OFF
Compile libregex ...................: OFF
Compile zlib .......................: OFF
Compile termlib ....................: OFF
Compile Utah Raster Toolkit ........: ON
Compile openNURBS ..................: ON
Compile STEPcode....................: ON

OpenGL support (optional) ..........: ON
X11 support (optional) .............: ON
Qt support (optional) ..............: OFF
Run-time debuggability (optional) ..: ON

Build 32/64-bit release ............: 64BIT (Auto)
Build optimized release ............: OFF
Build static libraries .............: ON
Build dynamic libraries ............: ON
Install example geometry models ....: ON
Generate extra docs ................: ON (html/man)

To activate the X11 support, you need to install the xorg development packages. See https://brlcad.org/wiki/Compiling.

view this post on Zulip ANUJ MITTAL (Feb 29 2020 at 19:20):

Thanks a lot @Daniel Rossberg

I was initially following this https://brlcad.org/wiki/Building_from_SVN
both archer and mged are successfully running now

view this post on Zulip ANUJ MITTAL (Feb 29 2020 at 19:29):

I think I should spend time on the deuces problem set to get familiarize with the code.
Do you all have any better path to follow?

view this post on Zulip Sean (Feb 29 2020 at 23:44):

@ANUJ MITTAL What/Which Deuces problem?

view this post on Zulip Sean (Feb 29 2020 at 23:47):

For getting familiarized with the code, it helps to identify an interest or goal. You mentioned heat transfer functions, so that already suggests a number of areas. You of course also mentioned iges, which is an endless set of possibilities.

view this post on Zulip ANUJ MITTAL (Mar 02 2020 at 12:33):

HI @Sean

Sorry for the late reply.

I am very much familiar with the way an IGES format file works.
I am using ray-tracing for heat transfer without any graphical outputs. So although I know concepts of ray-tracing, I am still unskilled in OpenGL and libraries like glew, glut, etc.
But I am very much interested to work in these two fields (geometry and ray-tracing related problems) and want to learn more in ray-tracing specifically.

view this post on Zulip ANUJ MITTAL (Mar 02 2020 at 12:33):

Can you suggest some problems to start working on?

view this post on Zulip Sean (Mar 02 2020 at 14:46):

@ANUJ MITTAL sure, you could:

And that's just the ones related to IGES.

view this post on Zulip Sean (Mar 02 2020 at 14:48):

There are hundreds of issues listed in our TODO and BUGS files that would be great for getting started. Unfortunately they're not sorted by time or complexity and some are 2 hour and some are 2 month tasks, but spending 5 minutes reading through and trying to work on the first one that sounds easy enough to you would be good too.

view this post on Zulip ANUJ MITTAL (Mar 02 2020 at 14:49):

Great!!

view this post on Zulip Sean (Mar 02 2020 at 14:52):

The most important aspect is actually contributing something useful that makes things better. Even tiny features are helpful. It's putting in the time and effort to polish it up (don't expect someone else will polish your mess ;)

view this post on Zulip ANUJ MITTAL (Mar 05 2020 at 15:37):

Can we import IGES file in mged? There's a library but I couldn't understand how it works.

add_executable is commented in CMakeLists.txt in IGES dir and BRLCAD_ADDEXEC is used. I am new to CMake and I couldn't understand what does BRLCAD_ADDEXEC do.

view this post on Zulip ANUJ MITTAL (Mar 05 2020 at 16:37):

I went through about 1/5 of TODO file. I understood some of the tasks but I need little time to understand the source code and how these libraries work.

Few tasks that I can undertake:

There are other tasks where I understood 'What' but don't know 'How', yet.

view this post on Zulip ANUJ MITTAL (Mar 05 2020 at 16:38):

I am referring the 'Introduction to MGED' guide to explore various functionalities of these libs.
Is a guide available for archer as well?

view this post on Zulip ANUJ MITTAL (Mar 05 2020 at 16:43):

I observed that working on many projects needed deep understanding of CMake. I started learning the basics through the official tutorial https://cmake.org/cmake/help/latest/guide/tutorial/index.html#cmake-tutorial.
But more knowledge is required it seems. Is there a better way?

view this post on Zulip ANUJ MITTAL (Mar 05 2020 at 16:55):

Also, I am impressed by the concept of mged. I am from mechanical engg background and geometry creation through command line makes our work too easy and saves a lot of time. :)

view this post on Zulip Daniel Rossberg (Mar 08 2020 at 14:42):

ANUJ MITTAL said:

add_executable is commented in CMakeLists.txt in IGES dir and BRLCAD_ADDEXEC is used. I am new to CMake and I couldn't understand what does BRLCAD_ADDEXEC do.

BRL-CAD defines some own CMake funktions. BRLCAD_ADDEXEC() is one of them. You can find their declarations in the misc/CMake directory. BRLCAD_ADDEXEC() is declared in BRLCAD_Targets.cmake and is mainly a wrapper for add_executable() with some additional (standard BRL-CAD) settings.

view this post on Zulip ANUJ MITTAL (Mar 08 2020 at 14:43):

Thanks!

view this post on Zulip Daniel Rossberg (Mar 08 2020 at 15:00):

ANUJ MITTAL said:

I am referring the 'Introduction to MGED' guide to explore various functionalities of these libs.
Is a guide available for archer as well?

The tutorials are mainly valid for archer as well. You have to type the commands in the archer command window.

view this post on Zulip ANUJ MITTAL (Mar 08 2020 at 15:31):

Okay

view this post on Zulip ANUJ MITTAL (Mar 12 2020 at 06:35):

ANUJ MITTAL said:

Can we import IGES file in mged? There's a library but I couldn't understand how it works.

I tried importing IGES file as MGED and exporting MGED as IGES using iges-g and g-iges respectively.
I get "invalid command name" in both cases.

What could be the issue here?

view this post on Zulip Sean (Mar 19 2020 at 05:49):

@ANUJ MITTAL it sounds like you're probably trying to run them from the mged command prompt instead of your system command prompt. You don't run iges-g and g-iges inside mged. They're run externally like mged.

view this post on Zulip scorp08 (Dec 26 2020 at 10:26):

where is ft_curve() defined :joy: :joy: I think not defined , so does it means that RT_CURVATURE not doing anything in hit function ?

view this post on Zulip Daniel Rossberg (Dec 26 2020 at 14:15):

ft_curve isn't a function but a pointer to a function. RT_CURVATURE checks if this pointer is not NULL, and calls the function it points to then. Possible candidates for these functions are the ~_curve() functions defined in the src/librt/primitives subdirectories.

view this post on Zulip scorp08 (Dec 27 2020 at 03:55):

Daniel Rossberg said:

ft_curve isn't a function but a pointer to a function. RT_CURVATURE checks if this pointer is not NULL, and calls the function it points to then. Possible candidates for these functions are the ~_curve() functions defined in the src/librt/primitives subdirectories.

I think 7.28 not have any, could not find in librt build project or another library. What is the point of curvature of point calculation ? Why need?

view this post on Zulip Sean (Dec 27 2020 at 06:07):

@scorp08 the curve callbacks are in 7.28 (they go way way back to the beginning of rt)

view this post on Zulip Sean (Dec 27 2020 at 06:08):

you're probably just not looking for the right thing or didn't understand what daniel explained perhaps.

view this post on Zulip Sean (Dec 27 2020 at 06:11):

An example of the callbacks are in each of the primitive implementation folders like src/librt/primitives/ell/ell.c has an rt_ell_curve() function. That's the 'ell' primitive's ft_curve callback. That callback is registered in src/librt/primitives/table.cpp in the entry where all 'ell' callbacks are listed. So when something calls ft_curve() on an ell object, it calls the rt_ell_curve() function.

view this post on Zulip Sean (Dec 27 2020 at 06:16):

as for the point, the curvature callback is defined per object and is a value at a given hit point indicating what the surface is like there.

view this post on Zulip Sean (Dec 27 2020 at 06:16):

from include/rt/hit.h it elaborates:

/**
 * Information about curvature of the surface at a hit point.  The
 * principal direction pdir has unit length and principal curvature
 * c1.  |c1| <= |c2|, i.e. c1 is the most nearly flat principle
 * curvature.  A POSITIVE curvature indicates that the surface bends
 * TOWARD the (outward pointing) normal vector at that point.  c1 and
 * c2 are the inverse radii of curvature.  The other principle
 * direction is implied: pdir2 = normal x pdir1.
 */

view this post on Zulip scorp08 (Dec 27 2020 at 07:09):

Sean said:

you're probably just not looking for the right thing or didn't understand what daniel explained perhaps.

Oh, but when I type _curve or ~_curve and seached in vs2017 , rt_ell_curve not shown but there are some other functions shown. Why vs2017 search like this, need to do a setting??

view this post on Zulip Sean (Dec 30 2020 at 19:48):

@scorp08 I imagine visual studio is doing a symbol search, not a substring search. I don't know if there's a setting to change that. I typically use "grep" on mac/linux/bsd, not visual studio, for things like that.

We provide https://brlcad.org/docs/api/ but that's ONLY for public api and rt_ell_curve is not public api, it's implementation.


Last updated: Oct 09 2024 at 00:44 UTC