api_get_entity_box
List of: Functions
Subjects: Model Topology
Contents: Kernel

Action: Gets the bounding box for a list of entities relative to the active working coordinate system.

Prototype: outcome api_get_entity_box (


const ENTITY_LIST& ent_list, // list of entities


WCS* wcs,
// WCS to use or NULL





// (model space)


SPAposition& min_pt,
// minimum position





// of bounding box





// returned


SPAposition& max_pt,
// maximum position





// of bounding box





// returned


AcisOptions* ao = NULL
// acis options


);

Includes: #include "kernel/acis.hxx"

#include "kernel/geomhusk/wcs.hxx"

#include "kernel/kernapi/api/api.hxx"

#include "kernel/kernapi/api/kernapi.hxx"

#include "kernel/kerndata/lists/lists.hxx"

#include "baseutil/vector/position.hxx"

#include "kernel/kernapi/api/acis_options.hxx"

Description: If wcs is specified, then the bounding box computes relative to that WCS. The positions (min_pt and max_pt) that are returned as the corners of the bounding box are always returned relative to model space. Use care in interpreting the results. Consider the following code example:


This function is not guaranteed to return the tightest bounding box on spheres and tori. There are two options tight_sphere_box and tight_torus_box that must be set to get this.


outcome result;

BODY* box;

WCS* wcs1;

ENTITY_LIST elist;

SPAposition pt1(0,0,0);

SPAposition pt2(1,2,3);

SPAposition xpt(-1,0,0);

SPAposition ypt(0,-1,0);


result = api_solid_block(pt1, pt2, box);


elist.add(box);

result = api_wcs_create(pt1, xpt, ypt, wcs1);


SPAposition min_pt, max_pt;

result = api_get_entity_box(elist, wcs1, min_pt,








max_pt);


This code example creates a box with corners at (0, 0, 0) and (1, 2, 3), and a WCS that is model space rotated about the z-axis by 180 degrees.


Relative to wcs1, the original corners of the box are (0, 0, 0) and (-1, -2, 3). The extrema relative to wcs are (-1, -2, 0) and (0, 0, 3). When these results are mapped back to model space, they are (1, 2, 0) and (0, 0, 3).


Because the API computes the extrema relative to wcs1 and returns the results mapped back into model space, the returned positions are:


min_pt = (1,2,0)

max_pt = (0,0,3)

Library: kernel

Filename: kern/kernel/kernapi/api/kernapi.hxx

Effect: Read-only
PDF/KERN/16FNA.PDF
HTM/DATA/KERN/KERN/16FNA/0054.HTM