mainpyFormex - 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

Post a Comment

Add a New Comment Rich Markup
   

Discussion

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>
Group 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 mesh.py? Or it is already available somewhere? (in coords.py 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>
Group Member

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

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

    Votes

    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.

     

    History

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.16.
    Corresponding source code