//	public static bool CreatePrimitive (ISSCBGrid grid, ModuleType moduleType, ISSCBlockVector origin, float radius, float height,Vector3 direction)
//	{
//		if (moduleType != ModuleType.Cone)
//			return false;
//		if (!grid.IsBlockAvailable (origin))
//			return false;
//		if (radius <= 0 || height <= 0)
//			return false;
//		return true;
//
//		
//	}

	public static void CreateCylinder (ISSCBGrid grid, int fillWith, ISSCBlockVector origin, float radius, float height)
	{
		if (!grid.IsBlockAvailable (origin)) return;
		if (radius <= 0 || height <= 0) return;
			
		ISSCBlockVector[] bvs = grid.BlocksOverlapCylinder(origin,radius,height);
		foreach(ISSCBlockVector bv in bvs){
			grid.SetBlock(bv,fillWith);
		}
		
		return;

	}
//	public static bool CreatePrimitive (ISSCBGrid grid, ModuleType moduleType, ISSCBlockVector origin, float radius, float height,Vector3 direction)
//	{
//		if (moduleType != ModuleType.Cone)
//			return false;
//		if (!grid.IsBlockAvailable (origin))
//			return false;
//		if (radius <= 0 || height <= 0)
//			return false;
//		return true;
//
//
//	}

    public static void CreateCylinder(ISSCBGrid grid, int fillWith, ISSCBlockVector origin, float radius, float height)
    {
        if (!grid.IsBlockAvailable(origin))
        {
            return;
        }
        if (radius <= 0 || height <= 0)
        {
            return;
        }

        ISSCBlockVector[] bvs = grid.BlocksOverlapCylinder(origin, radius, height);
        foreach (ISSCBlockVector bv in bvs)
        {
            grid.SetBlock(bv, fillWith);
        }

        return;
    }