bugpyFormex - Bugs: bug #40393, drawPropNumbers, fix and extend to...

 
 

bug #40393: drawPropNumbers, fix and extend to draw PatchNumbers

Submitted by:  gianluca de santis <gianlucadesi>
Submitted on:  Mon 28 Oct 2013 12:45:56 PM UTC  
 
Category: RenderingSeverity: 2 - Minor
Item Group: Functionality errorStatus: Fixed
Privacy: PublicAssigned to: Benedict Verhegghe <bverheg>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 28 Oct 2013 01:24:26 PM UTC, comment #2:

The error was fixed in commit b35a3a6.

Concerning the drawPatchNumbers: I do not think such a function would be generally useful enough: the color already shows the different prop values.

A remark about the implementation: it will create a complete copy of the geometry, which is a waste to just draw some numbers.
It would be better to directly use drawMarks with computed points and text strings. The string could also contain other info, like number of elements.

Also, notice the setting a property value -1 is illegal. Maybe we should set a warning/error message for this case.

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Mon 28 Oct 2013 12:45:56 PM UTC, comment #1:

This item has been reassigned from the project pyFormex support tracker to your tracker.

The original report is still available at support #108424

Following are the information included in the original report:

[field #0] Item ID: 108424
[field #1] Group ID: 10866
[field #2] Open/Closed: Open
[field #3] Severity: 2 - Minor
[field #4] Privacy: Public
[field #9] Category: GUI
[field #10] Submitted by: gianlucadesi
[field #11] Assigned to: None
[field #12] Submitted on: Mon 28 Oct 2013 12:06:19 PM CET
[field #13] Summary: drawPropNumbers, fix and extend to draw PatchNumbers
[field #14] Original Submission: drawPropNumbers in gui.draw.py does not work: line 963 should be replaced by

nrs = -ones(F.nelems(),dtype=int)

At the moment PropNumbers are drawn on ALL elements, which may be not needed, especially for large models. Maybe, we could add an other function (or an option) to draw the PropNumbers only once:

def drawPatchNumbers(self, mode='centroid'):
"""Draw one number per property number.

Patch is a set of elements with the same property number.
If mode is 'first' the propery number is drawn on the first element of a patch.
If mode is 'centroid' the propery number is drawn at the centroid of a patch.
"""
if not isinstance(self,Mesh):
self = self.toMesh()
print ('here')
if self.prop is None:
self=self.setProp(-1)
ps = self.propSet()
if mode=='centroid':
f=Formex([self.withProp(i).compact().centroid() for i in ps]).setProp(ps)
drawPropNumbers(f)
if mode=='first':
drawPropNumbers(Mesh.concatenate([self.withProp(i).select([0]) for i in ps]))


[field #16] Item Group: None
[field #17] Status: None
[field #18] Component Version: None
[field #19] Operating System: None
[field #20] Reproducibility: None
[field #21] Size (loc): None
[field #22] Fixed Release: None
[field #23] Planned Release: None
[field #24] Effort: 0.00
[field #28] Priority: 5 - Normal
[field #31] Percent Complete: 0%
[field #33] Release: None
[field #58] Custom Select Box #1: None
[field #59] Custom Select Box #2: None
[field #60] Custom Select Box #3: None
[field #61] Custom Select Box #4: None
[field #62] Custom Select Box #5: None
[field #63] Custom Select Box #6: None
[field #64] Custom Select Box #7: None
[field #65] Custom Select Box #8: None
[field #66] Custom Select Box #9: None
[field #67] Custom Select Box #10: None

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Mon 28 Oct 2013 12:45:56 PM UTC, original submission:

drawPropNumbers in gui.draw.py does not work: line 963 should be replaced by

nrs = -ones(F.nelems(),dtype=int)

At the moment PropNumbers are drawn on ALL elements, which may be not needed, especially for large models. Maybe, we could add an other function (or an option) to draw the PropNumbers only once:

def drawPatchNumbers(self, mode='centroid'):
"""Draw one number per property number.

Patch is a set of elements with the same property number.
If mode is 'first' the propery number is drawn on the first element of a patch.
If mode is 'centroid' the propery number is drawn at the centroid of a patch.
"""
if not isinstance(self,Mesh):
self = self.toMesh()
print ('here')
if self.prop is None:
self=self.setProp(-1)
ps = self.propSet()
if mode=='centroid':
f=Formex([self.withProp(i).compact().centroid() for i in ps]).setProp(ps)
drawPropNumbers(f)
if mode=='first':
drawPropNumbers(Mesh.concatenate([self.withProp(i).select([0]) for i in ps]))

gianluca de santis <gianlucadesi>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 07 Nov 2013 02:48:54 PM UTCbverhegOpen/ClosedOpen=>Closed
    Mon 28 Oct 2013 01:24:26 PM UTCbverhegCategoryNone=>Rendering
      Item GroupNone=>Functionality error
      StatusNone=>Fixed
      Assigned toNone=>bverheg
    Mon 28 Oct 2013 12:45:56 PM UTCbverhegReassign itempyFormex, sr #108424=>pyFormex, bug #40393

    Back to the top


    Powered by Savane 3.1-cleanup1