src/bbox.c
void bbox_to_origin(struct bbox *bb, const struct bbox *bb_glb)
{
    int i;

    if(bb->num_dims != bb_glb->num_dims) {
        fprintf(stderr, "ERROR: '%s()': dimensionality mismatch.\n", __func__);
    }

    bb->num_dims = bb_glb->num_dims;
    for(i = 0; i < bb->num_dims; i++) {
        bb->lb.c[i] -= bb_glb->lb.c[i];
        bb->ub.c[i] -= bb_glb->lb.c[i];
    }
}
/*
  Translates a bounding box coordinates from global space described by
  bb_glb to local space. The bounding box for a local space should
  always start at coordinates (0,0,0).
*/
Translates a bounding box coordinates from global space described by
bb_glb to local space. The bounding box for a local space should
always start at coordinates (0,0,0).
Translates a bounding box coordinates from global space described by bb_glb to local space . The bounding box for a local space should always start at coordinates ( 0 0 0 ) .
void bbox_to_origin(struct bbox *bb, const struct bbox *bb_glb)
{
    int i;
    if(bb->num_dims != bb_glb->num_dims) {
        fprintf(stderr, "ERROR: '%s()': dimensionality mismatch.\n", __func__);
    }
    bb->num_dims = bb_glb->num_dims;
    for(i = 0; i < bb->num_dims; i++) {
        bb->lb.c[i] -= bb_glb->lb.c[i];
        bb->ub.c[i] -= bb_glb->lb.c[i];
    }
}
void bbox_to_origin ( struct bbox * bb , const struct bbox * bb_glb ) { int i ; if ( bb -> num_dims != bb_glb -> num_dims ) { fprintf ( stderr , " \n " , __func__ ) ; } bb -> num_dims = bb_glb -> num_dims ; for ( i = 0 ; i < bb -> num_dims ; i ++ ) { bb -> lb . c [ i ] -= bb_glb -> lb . c [ i ] ; bb -> ub . c [ i ] -= bb_glb -> lb . c [ i ] ; } }
Translates a bounding box coordinates from global space described by
bb_glb to local space.
Translates a bounding box coordinates from global space described by bb_glb to local space .