[Bf-committers] Questions regarding adding new mesh primitive

Rodrigo Hernandez kwizatz at aeongames.com
Wed Aug 22 00:53:53 CEST 2007


Hello,

My name is Rodrigo Hernandez and I am writing some code to add an 
Octahedron primitive
(dubbed "octaspehere" following the icosphere convention).
I have already managed to add the code, however I have a couple of 
questions before submitting a patch:

1- My changes are on header_info.c and editmesh_add.c, I reckon I also 
need to add some code to
python\api2_2x\meshPrimitive.c in order to expose the function to Python 
(am I right?), but I also noticed
that the file toolbox.c in the create_mesh_sublevel function has 
something that looks vaguely as a primitive menu,
How should I modify it in order to add the new primitive? would just 
adding the line for octasphere do?
My code works without any changes to this file, so I am wondering what 
exactly does it do.

2 - In order not to reinvent the wheel I just made a search for the 
string icosphere and duplicated the code, then
made the appropriate modifications, I noticed the static arrays icoverts 
and icofaces.
I noticed that icoverts are normal vectors multiplied by 200, I use the 
length 1 normal vectors on my octaverts,
it works fine, but I am wondering if I should be using the times 200 
version instead, is this some sort of floating
point safeguard? the octaverts are actually coaxial, so I doubt there 
would be any problems,
but I rather use the Blender standard and keep everything consistent...
I might have just answered my own question there.

So, thats it for now.
Thanks.



More information about the Bf-committers mailing list