So far this is a small subset of the brl-cad primitives with some notion of object-oriented design, being emitted as tcl scripts that mged can directly process into database (.g) files. Requirements are Python and brl-cad.
# git clone this repository
cd python-brlcad-tcl
python -m examples.motor_28BYJ_48__example output.tcl
motor_28BYJ_48__COMPLETE1.r
here is the 'region' that was created at the end of the motor's init function, it is a special type of combination that 'instantiates' all of the non-region 'object definitions' (primitives and combinations).meshlab output.stl
The multi-part example shows how to use two python-brlcad-tcl objects (including motor_28BYJ_48__example.py
). In addition to emitting the tcl script, it runs mged to create a new geometry database, and then converts that to an STL.
To view the resulting (.g) file in mged
:
# git clone this repository
cd python-brlcad-tcl
python -m examples.multi_part_example.py multi_part.tcl
mged multi_part.g
brl_db.save_stl
to save some run-time time)
I was running this example then opening the resulting (.STL) file in meshlab (because I don't know how/if mged has a real-time raytracing display mode) :meshlab multi_part.stl
Looking at the stack of STL files emitted:
Looking at the raster output, with greyscale output option:
Looking at the raster output:
self.script_string_list
objectname = self._default_name_(name)
None
inspect
module to learn the caller-function name, and uses that function name as a "new name"return name