| Trees | Indices | Help |
|---|
|
|
The Blender.Geometry submodule.
This new module provides access to a geometry function.
|
|||
| list |
|
||
| Vector |
|
||
| tuple |
|
||
| int |
|
||
| int |
|
||
| tuple |
|
||
|
|||
__package__ = None
|
|||
|
|||
Takes a list of polylines and calculates triangles that would fill in the polylines. Multiple lines can be used to make holes inside a polyline, or fill in 2 seperate lines at once.
Notes:
|
Takes 2 lines vec1, vec2 for the 2 points of the first line and vec2, vec3 for the 2 points of the second line.
|
Takes 2 lines vec1, vec2 for the 2 points of the first line and vec2, vec3 for the 2 points of the second line.
|
Takes 4 vectors (one for the test point and 3 for the triangle) This is a 2d function so only X and Y are used, Z and W will be ignored.
|
Takes 5 vectors (one for the test point and 5 for the quad) This is a 2d function so only X and Y are used, Z and W will be ignored.
|
Takes a list of 2D boxes and packs them into a square. Each box in boxlist must be a list of at least 4 items - [x,y,w,h], after running this script, the X and Y values in each box will be moved to packed, non overlapping locations. Example:
# Make 500 random boxes, pack them and make a mesh from it
from Blender import Geometry, Scene, Mesh
import random
boxes = []
for i in xrange(500):
boxes.append( [0,0, random.random()+0.1, random.random()+0.1] )
boxsize = Geometry.BoxPack2D(boxes)
print 'BoxSize', boxsize
me = Mesh.New()
for x in boxes:
me.verts.extend([(x[0],x[1], 0), (x[0],x[1]+x[3], 0), (x[0]+x[2],x[1]+x[3], 0), (x[0]+x[2],x[1], 0) ])
v1= me.verts[-1]
v2= me.verts[-2]
v3= me.verts[-3]
v4= me.verts[-4]
me.faces.extend([(v1,v2,v3,v4)])
scn = Scene.GetCurrent()
scn.objects.new(me)
Note: Each boxlist item can be longer then 4, the extra items are ignored and stay untouched. |
| Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Fri Oct 24 10:23:50 2008 | http://epydoc.sourceforge.net |