public CABoard(uint size, uint defaultState) { board = new uint[size][]; for(int i = 0; i < size; i++) { board[i] = new uint[size]; for(int j = 0; j < size; j++) { board[i][j] = defaultState; } } stepThreads = new StepPart[System.Environment.ProcessorCount]; for(int i = 0; i < stepThreads.Length; i++) { stepThreads[i] = new StepPart(this, board); var thread = new Thread(stepThreads[i].stepThread); thread.IsBackground = true; thread.Start(); } }
/** * Creates a CABoard of the given size in the given state * * @param size The size of board to use. * @param defaultState The state to initialize the board to **/ public CABoard(uint size, uint defaultState) { // Create the board, clear to default state board = new uint[size][]; for(int i = 0; i < size; i++) { board[i] = new uint[size]; for(int j = 0; j < size; j++) { board[i][j] = defaultState; } } // Create step threads corresponding to the number of processors available stepThreads = new StepPart[System.Environment.ProcessorCount]; for(int i = 0; i < stepThreads.Length; i++) { stepThreads[i] = new StepPart(this, board); var thread = new Thread(stepThreads[i].stepThread); thread.IsBackground = true; thread.Start(); } }
public static void CreateCube(double dimX, double dimY, double dimZ, double cubeX = 0, double cubeY = 0, double cubeZ = 0) { StepPart part = new StepPart(); StepShapeDefinitionRepresentation shapeRep = new StepShapeDefinitionRepresentation(); StepProductDefinitionShape defnShape = new StepProductDefinitionShape(); StepAdvancedBrepShapeRepresentation brepShapeRepresentation = new StepAdvancedBrepShapeRepresentation(); StepAxis2Placement axis = new StepAxis2Placement(); SetDefaultAxis(cubeX, cubeY, cubeZ, axis); //Create base face double x1, x2, y1, y2; double xPlus = 0, xMinus = 0; double yPlus = 0, yMinus = 0; double zPlus = 0, zMinus = 0; GeneratePlusMinusValues(dimZ, out zPlus, out zMinus); GenerateRectangularFaceVertices(dimX, dimY, out xPlus, out yPlus, out xMinus, out yMinus); }
public void AddPart(StepPart part) { Parts.Add(part); }