push_back grows the array to accomodate the new element. A vector has a capacity and a size. The capcity is how much physical storage is has available before needing to reallocate space on a push_back request. The size is how many elements are currently stored.
You can still write code like vec[3] = 5;, but that implies at 3 is a valid index into vec. A tested alternative vec.at(3) = 5; throws an exception if 3 is out of range.
You can either initialize the vector with how many elements you want and then process it. Or you may add each time a new object to your vector and process it. I recommend the first method btw.
1 2 3 4 5 6 7
std::vector<point2d> arraypoints;
for (int i = 0; i < maxpoints; ++i){
point2d myobject;
myobject.mx = 10 * rand() / float(RAND_MAX);
arraypoints.push_back(myobject);
}