How do i get all the points that make the area of a cube such that they are separated by "n" units from each other?

Goal -

Creation of an array of {x,y,z} vectors , a wireframe of points, that go through the area of a cube of 1 unit.

Example -

For a square of 1 unit with a seperation of 0.5 units starting at (0 , 0), the points would be (0 , 0)(0 , 0.5)(0.5 , 0)(0 , 1) (1 , 0) (1 , 0.5)(0.5 , 1)(1 , 1)

See how they did it in THREE.BoxGeometry.