pyg.pyb.pyb.
pyb
[source]¶Bases: object
An object to save commands for blender 3d plotting and render
The pyb
class is your blender scene, and I’ve coded in a limited
set of commands for some simplified bldnder plotting. Right now, it
automatically saves to “brender_01.blend/.png” in the current
directory, if you can’t find the files.
cone
(c=(0.0, 0.0, 0.0), r1=None, r2=None, h=None, name=’cone’, color=None, direction=’z’, alpha=1.0, emis=False)[source]¶cone
makes a truncated cone with height h
and radii r1
and r2
.
cone
creates a truncated cone with the center of the cone at
point c
, a tuple of three dimensions. Then, the base has radius
r1
, the tip has radius r2
, and the base and tip are
separated by h
.
Todo
Make sure rotation works here
Parameters: |
|
---|
gq
(A=0.0, B=0.0, C=0.0, D=0.0, E=0.0, F=0.0, G=0.0, H=0.0, J=0.0, K=0.0, name=’gq’, color=None, alpha=1.0, emis=False)[source]¶gq
adds a generalized quadratic surface using the mesh.
gq
adds a generalized quadratic surface using the mesh operators.
The surface itself is defined by the function
and takes inputs of \(A\), \(B\), \(C\), \(D\), \(E\), \(F\), \(G\), \(H\), \(J\), and \(K\).
Note that this object is not necessarily closed, so it may need to be added to or subtracted from other surfaces or it will look unrealistic.
Parameters: |
|
---|
plane
(x1=None, x2=None, y1=None, y2=None, z1=None, z2=None, c=None, l=None, name=’rpp’, color=None, alpha=1.0, verts=None)[source]¶rcc
(c=None, r=None, h=None, name=’rcc’, color=None, direction=’z’, alpha=1.0, emis=False)[source]¶makes a cylinder with center point c
, radius r
, and height h
Todo
Make sure rotation works here
render
(camera_location=(500, 500, 300), c=(0.0, 0.0, 0.0), l=(250.0, 250.0, 250.0), render=True, fit=True, samples=20, res=[1920, 1080], draft=False, **kwargs)[source]¶rpp
(x1=None, x2=None, y1=None, y2=None, z1=None, z2=None, c=None, l=None, name=’rpp’, color=None, alpha=1.0, verts=None)[source]¶run
(filename=None, **kwargs)[source]¶Opens a blender instance and runs the generated model rendering
scene_setup
()[source]¶deletes the default cube and sets up a scene to be used to render
pyb.scene_setup
is a convenience class that creates a new
scene and deletes the default cube, leaving you with a clean slate
to render on. It is called automatically during initialization,
so there’s no real reason that the user should ever call this.
Returns: | None |
---|
sun
(strength=1.0)[source]¶creates a blender sun lamp
pyb.sun
creates a blender sun lamp and places it. Location is
non-sensical in this context, as blender places its sun lamps
infinitely far away. Strength, however, should be set, and set
much lower than the strength for a point lamp.
Parameters: | strength (float) – the strength of the sun lamp |
---|---|
Returns: | pyb object with sun lamp added |