← Back to team overview

yade-dev team mailing list archive

Re: ymport.text adding a new field 'material'

 

Hi, Luc,

that is possible. But it is better to know, how many materials with different frictionAngles you have in your simulation. In this case, you can simply use 'x_y_z_r_matId' import. If your each body has unique friction angle, you should create separate material for each body.

Because, if 2 bodies have the same material but different frictionangle:

body[0].material.frictionAngle=0.1 | => It is not a code, just to show algorithm
body[1].material.frictionAngle=0.2     |

After that, body [0] will have a friction angle 0.2 as well.


Anton

On 09/01/2010 02:29 AM, luc scholtes wrote:
Sorry to dig out this message, but it is probably related to the following question:

Would it be possible to specify material properties (frictionAngle for example) using the export/ymport text? I mean, can a material properties such as frictionAngle be defined through an import (saying that the concerned text file contained the corresponding additional column)?

Would the following code be suitable in the ymport.py file?

...
elif (format=='x_y_z_r_frictionAngle'): ret.append(utils.sphere([shift[0]+scale*float(data[0]),shift[1]+scale*float(data[1]),shift[2]+scale*float(data[2])],scale*float(data[3]),mat.frictionAngle(data[4]),**kw))
...

Thanks for your advices

 Luc


2010/5/19 Anton Gladky <gladky.anton@xxxxxxxxx <mailto:gladky.anton@xxxxxxxxx>>

    Ok, good
    ______________________________

    Anton Gladkyy


    2010/5/19 Václav Šmilauer <eudoxos@xxxxxxxx <mailto:eudoxos@xxxxxxxx>>

        > Could you not have a look at that code?
        > What if I textExt() rename to text(), they are backward
        compatible.
        Keep them separate. Better to not have bugs in the simple one.
        Cheers, v




    _______________________________________________
    Mailing list: https://launchpad.net/~yade-dev
    <https://launchpad.net/%7Eyade-dev>
    Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
    <mailto:yade-dev@xxxxxxxxxxxxxxxxxxx>
    Unsubscribe : https://launchpad.net/~yade-dev
    <https://launchpad.net/%7Eyade-dev>
    More help   : https://help.launchpad.net/ListHelp




References