diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2006-03-01 18:30:10 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2006-03-01 18:30:10 +0300 |
commit | b9861d2a800d22730e1319c0cd29996d281c89ed (patch) | |
tree | 929b9d713d52a681affc3b5779b2ecfcd13c761e /source/blender/blenlib | |
parent | b4505d32dcc6b7bd1cdbcbdadb65b63158051609 (diff) |
Array modifier patch by Ben Batt! (#3788)
This modifier allows to make arrays of meshes, with multiple offset types:
- constant offset
- offset relative to object width
- offset with scale and rotation based on another object
The number of duplicates can be computed based on a fixed count, fixed length
or length of a curve. Duplicate vertices can be automatically merged.
Nice docs and example files available in the wiki:
http://mediawiki.blender.org/index.php/BlenderDev/ArrayModifier
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_arithb.h | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/arithb.c | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index fedcefcd8b8..fcb72f7d8f0 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -490,6 +490,12 @@ VecMulf( float *v1, float f ); + int +VecLenCompare( + float *v1, + float *v2, + float limit +); int VecCompare( float *v1, diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 0cc98a3b429..67f3cca92f3 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -1814,6 +1814,17 @@ void VecMulf(float *v1, float f) v1[2]*= f; } +int VecLenCompare(float *v1, float *v2, float limit) +{ + float x,y,z; + + x=v1[0]-v2[0]; + y=v1[1]-v2[1]; + z=v1[2]-v2[2]; + + return ((x*x + y*y + z*z) < (limit*limit)); +} + int VecCompare( float *v1, float *v2, float limit) { if( fabs(v1[0]-v2[0])<limit ) |