Making a floor

I would like to add a floor having, with alternating black and white tiles, so basically showing like a chess board.

Input parameters are tile size and number of tiles in each direction.

I was thinking of creating a mesh (BRepMeshData_Model ) and use BRepBuilderAPI_MakeFace with AddFace?

How can I set the color for each tile?

Is there a better approach? Anybody know of any samples?

 

Luc

 

michelwijnja_165292's picture

I would like make somthing like :

//this is a 2d routine. 

for(int i=0; i<10; i++){
    for(int j=0; j<10; j++){
        
         if(i %2==0 && j %2==0){
              //tiles are white
         } else {
              //tiles are black
      } 
    }
}