Generate rect