get_bbox unlinked from base

This commit is contained in:
djerom
2022-05-13 14:02:28 +05:00
parent 87174bfb83
commit 2a8d03bae5
4 changed files with 5 additions and 156 deletions

View File

@@ -3,12 +3,12 @@ const well_head = require('./drawers/well-head')
const corel_layer = require('./drawers/corel-layer')
const BBox = require('../libs/bbox')
function get_wells_bbox(data) {
let bbox = BBox.from_array(data.map((w) => ({ x: w.whx, y: w.why })));
function get_bbox(data, min_size = 1000) {
let bbox = BBox.from_array(data)
if (bbox.w() == 0 || bbox.h() == 0) {
bbox.r += 1000;
bbox.b += 1000;
bbox.r += min_size;
bbox.b += min_size;
}
return bbox;
@@ -65,7 +65,7 @@ function build_it_layer(wells, settings, style) {
}
module.exports = {
get_wells_bbox,
get_bbox,
build_pt_layer,
build_it_layer,
};