
We now express procedural geometry as pythonic scripts that generate. Approach 2 : Tcl ScriptsĪs a solution to shortcomings of the ctypesgen approach, a new approach for procedural geometry was developed. A minor drawback with this approach is that, the bindings might need to be updates to accommodate changes brought to the C code. These bindings parse the header files of the primitives from the installed version of BRL-CAD and uses them to construct a standard library of abstractions around the bindings. The project focusses on wrapping BRL-CAD’s primitives in python using ctypesgen. Python BRL-CAD came into existence in 2014. Python Procedural Geometry Approach 1 : Ctypesgen The issue with this approach is that, it depends on interacting with BRL-CAD’s geometry editor GUI, mged. The script sets up functions (procedures)that create spheres (SPHs) and cylinders (RCCs) going back and forth in various directions, creating the corresponding geometry for each of those directions. This is an example shell script that uses BRL-CAD tools to procedurally create and render the SGI Cube.

Procedural geometry of sorts has existed in BRL-CAD for a while now. “Make it work, make it right, make it fast.” - Kent Beck The procedural approach is not only easier but it also saves you time and can be done with only a few lines of code. Loop over your procedure to create all wheels.Create a procedure (function) that calculates co-ordinates for each wheel and draws the wheel.So, what would be an alternate (and better) way to do this? Now, let’s think about this problem as programmers, you don’t want to put in so much effort if your laptop with a ton of stickers can do it for you. Manually create each wheel by passing specific co-ordinates.

