Hi
We are working on a project to use ray tracing functionality of BRL CAD
with python. How can we achieve this?  By using the ctypes module, we
loaded a dll library of BRL CAD and in particular used librt.c. By ctypes,
we wrapped the functions rt_dirbuilt(), rt_gettree(), rt_prep and finally
rt_shootray(). We implemented all needed structs and unions, including
application and partition structures. Application structure is initialized
with 0s as documentation stated. For hit and miss routines, we define
python functions and wrap them by using CFUNCTYPES to pass as valid C
arguments. Arguments of hit and miss functions are defined according to
documentation, too. However, when rt_shootray is called, the program
crashes and gives the following errors. "Corrupt application struct" error
raised in run mode and "OSError: exception: access violation writing
0x000002B220192BE8" error raised in debug mode in PyCharm.  "corrupt
application struct" error raised when the attributes of application
struct which are a_zero1 and a_zero2 are not 0 but both of them seem to be
zero in our code. What can cause this and how can we solve this? We also
use the function rt_init_resource since it gives another error when it's
not added even though the source code call this functions just in the
script.

Thanks in advance.
[image: image.png]

[image: image.png]
error from debugger mode
[image: image.png]
_______________________________________________
BRL-CAD Users mailing list
brlcad-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-users

Reply via email to