Exemple #1
0
static int l_uc_al2bv(lua_State* L)
{
	UnitCell* uc = lua_tounitcell(L, 1);
	if(!uc) return 0;
	
	double v[6];
	for(int i=0; i<6; i++)
	{
		v[i] = lua_tonumber(L, i+2);
		if(v[i] == 0)
			return luaL_error(L, "UnitCell:anglesLengthsToBasisVectors requires 6 numbers");
	}
	
	uc->anglesLengthsToBasisVectors(
		v[0], v[1], v[2],
		v[3], v[4], v[5]);
	return 0;
}