helppyFormex - Support: sr #108330, bounding boxes / spheres of Mesh...


sr #108330: bounding boxes / spheres of Mesh elements

Submitter:  gianluca de santis <gianlucadesi>
Submitted:  Thu 27 Jun 2013 10:36:53 AM UTC
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Privacy:  Public
Assigned to:  None Open/Closed:  Open
Operating System:  None
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


Thu 27 Jun 2013 01:45:43 PM UTC, comment #1: 

Commit 8eda126 adds a general array minmax function, and a
bboxes() method for Coords, Geometry, Formex, Mesh.

From these you can also compute:

centers = bb.mean(axis=1)
diagonal_size = length(bb)

Benedict Verhegghe <bverheg>
Project Administrator
Thu 27 Jun 2013 10:36:53 AM UTC, original submission:  

It would be usefull for some operations to have a rough estimation of the space (ie. a BOX or a SPHERE) taken by each element of a mesh. While it is not trivial to find the smallest bounding sphere, it is easy and very fast to find the sphere around the bbox of each element. This is of course larger (but not much) than the smallest bounding sphere. Should we add the following or a similar method to Or it is already available somewhere? (in there is a method working for all coords)

def elemBoxes(self):
    Returns bounding box, center and radius of all elements of a mesh (working for any possible eltype).
    Centers are defined as mod point on the diagonal of the boxes; radii are the semidiagonals of the boxes.
    f = self.coords[self.elems]   
    boxes=concatenate([ f.min(axis=1), f.max(axis=1)], axis=1).reshape(-1, 2, 3)
    diag = boxes[:, 1]-boxes[:, 0]
    ce = boxes[:, 0]+diag*0.5
    r = length(diag)*0.5
    return boxes, ce, r

gianluca de santis <gianlucadesi>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by bverheg (Posted a comment)
  • -email is unavailable- added by gianlucadesi (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.





    No changes have been made to this item

    Back to the top

    Powered by Savane 3.9