| 114 | } |
| 115 | |
| 116 | void WireNetwork::scale_fit(const VectorF& bbox_min, const VectorF& bbox_max) { |
| 117 | center_at_origin(); |
| 118 | |
| 119 | VectorF bbox_size = bbox_max - bbox_min; |
| 120 | VectorF bbox_center = 0.5 * (bbox_min + bbox_max); |
| 121 | VectorF cur_bbox_size = get_bbox_max() - get_bbox_min(); |
| 122 | |
| 123 | VectorF scale_factor = bbox_size.cwiseQuotient(cur_bbox_size); |
| 124 | scale(scale_factor); |
| 125 | |
| 126 | translate(bbox_center); |
| 127 | } |
| 128 | |
| 129 | void WireNetwork::translate(const VectorF& offset) { |
| 130 | if (offset.size() != m_dim) { |
no outgoing calls