mainpyFormex - Support: sr #108602, Offset an object in the same plane

 
 

sr #108602: Offset an object in the same plane

Submitter:  None
Submitted:  Mon 23 Jun 2014 09:25:15 AM UTC
   
 
Category:  Examples Priority:  5 - Normal
Severity:  3 - Normal Privacy:  Public
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Open Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 23 Jun 2014 03:39:25 PM UTC, comment #1: 

I understand that what you want is something like the Formex.shrink() method. But while this one shrinks each triangle with a constant factor with respect to its center, you want to offset the triangle edges with a fixed amount. That of course requires recomputing all vertices as the intersections of translated lines.

In attachment (facet.py) you find the Facet class that we used to do just that for our work in cooperation with Anne Bagger some years ago (http://orbit.dtu.dk/en/publications/modeling-plate-shell-structures-using-pyformex%2826281803-23af-4024-abe8-5e6c94fd203b%29.html). The class is more general than you need: our facets could have any number of edges (which is why we could not use the normal Formex class), but it also works well if you only have triangles. There is quite some extra functionality, like detecting diappearing edges (our facets could have some short edges, which disappeared by offsetting the edges inwards). The class will probably (someday, in some form) become part of pyFormex.

The second attachment (shrink.py) is an example script using the class. It should work well if you put both in the same accessible directory.

Finally, there is an image (shrink.png) that illustrates the results: the black edges are the original triangles, the red ones are those from using Formex.shrink, the blue ones are obtained with the Facet.shrink method.

This has been tested on pyFormex 0.9.1

(file #31602, file #31603,

Benedict Verhegghe <bverheg>
Group administrator
Mon 23 Jun 2014 09:25:15 AM UTC, original submission:  

I actually discovered and already tried using offset command on TriSurface class. What I really want to achieve is to offest each edge of the triangle and effectively create a new triangle, in the same plane, but slightly smaller. When I apply offset command to entire triangle, what it does, it offsets the triangle in the normal direction: is there a way to tell in which direction to offset? And I assume I have to offset individual edges of my elements and then create a new elements? Thank you.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #31602:  facet.py added by bverheg (10KiB - text/x-python)
file #31603:  shrink.py added by bverheg (992B - text/x-python)
file #31604:  shrink.png added by bverheg (16KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bverheg (Updated the item)
  • -email is unavailable- added by None (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.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-06-23 bverheg Attached File- Added facet.py, #31602
        Attached File- Added shrink.py, #31603
        Attached File- Added shrink.png, #31604

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code