yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00488
Re: facets, edges, vertices (questions to sega)
Hi, thanks for your responses. One thing that I find baffling...
I create a facet that reads like this in the .xml file:
<physicalParameters _className_="BodyMacroParameters" se3="{0 0 0 1
0 0 0}" mass="0" velocity="{0 0 0}" inertia="{0 0 0}"
angularVelocity="{0 0 0}" young="70000" poisson="0.2"
frictionAngle="0.5236" />
<geometricalModel _className_="Facet" diffuseColor="{1 1 1}"
wire="1" visible="1" shadowCaster="0" vertices="[{1 0 0} {0 1 0} {-1 0
0} {0 -1 0}]" />
<interactingGeometry _className_="InteractingFacet" diffuseColor="{1
1 1}" vertices="[{1 0 0} {0 1 0} {-1 0 0} {0 -1 0}]" />
The intent was to have unit square slab in the xy plane; its
se3.position is in the origin. However, in the rendering, I get facet
with 5 edges!
I am attaching the code and screenshot of the rendering.
> Edge is the intersection of two faces.
> Since the facets are distinct objects, and they are not connected to any
> combinatorial structure (such as, for example, triangulation), the scope of
> interaction with an edge will be the scope of interaction with two faces
> simultaneously. To exclude such a dual interaction imposed edges as separate
> body. (Similarly for vertices as the intersection of two or more edges).
>
I find edges useful only if there is falling onto a convex object
between two facets, such that in the direction of both facets, there
will be no projection of the sphere on the respective facet; the sphere
would fall through then, right?
>> I tried running your model but didn't succeed (will investigate shortly).
>>
> What happened?
>
That was a bug with initializers I fixed now (r1401)
>> They > are calculated in postProcessAttributes, is that why in your example,
>> you save the simulation and load it again?
>>
>
> Yes.
>
Added that to the python wrappers - see in the attached script.
# encoding: utf-8
o=Omega()
from yade import utils
from math import *
from yade.wrapper import *
def facet(center,vertices,relative=False,young=30e9,poisson=0.2):
if not relative: relCenter=[0,0,0]
else: relCenter=center
vStr='['+' '.join(['{%g %g %g}'%(v[0]-relCenter[0],v[1]-relCenter[1],v[2]-relCenter[2]) for v in vertices])+']'
b=Body()
b.shape=GeometricalModel("Facet",{'wire':True,'visible':True})
b.shape.setRaw('vertices',vStr)
b.mold=InteractingGeometry("InteractingFacet")
b.mold.setRaw('vertices',vStr)
b.mold.postProcessAttributes() # calculates normals etc. - instead of saving and loading the whole simulation
b.phys=PhysicalParameters("BodyMacroParameters",{'se3':[center[0],center[1],center[2],1,0,0,0],'mass':0,'inertia':[0,0,0],'young':young,'poisson':poisson})
b.bound=BoundingVolume('AABB',{'diffuseColor':[0,1,0]})
b['isDynamic']=False
return b
o.bodies.append(facet(center=[0,0,0],vertices=[[1,0,0],[0,1,0],[-1,0,0],[0,-1,0]],young=7e4))
o.bodies.append(utils.sphere([.1,0,1],0.2,wire=False,young=7e4))
o.bodies.append(utils.sphere([0,-.1,1.5],0.2,young=7e4))
o.bodies.append(utils.sphere([0,.1,2],0.2,young=7e4))
o.dt=1e-5
o.initializers=[
StandAloneEngine('PhysicalActionContainerInitializer'),
MetaEngine('BoundingVolumeMetaEngine',[EngineUnit('InteractingSphere2AABB'),EngineUnit('InteractingFacet2AABB'),EngineUnit('MetaInteractingGeometry2AABB')])
]
o.engines=[
StandAloneEngine('PhysicalActionContainerReseter'),
MetaEngine('BoundingVolumeMetaEngine',[
EngineUnit('InteractingSphere2AABB'),
EngineUnit('InteractingFacet2AABB'),
EngineUnit('MetaInteractingGeometry2AABB')
]),
StandAloneEngine('PersistentSAPCollider'),
MetaEngine('InteractionGeometryMetaEngine',[
EngineUnit('InteractingSphere2InteractingSphere4SpheresContactGeometry'),
EngineUnit('InteractingFacet2InteractingSphere4SpheresContactGeometry'),
]),
MetaEngine('InteractionPhysicsMetaEngine',[EngineUnit('SimpleElasticRelationships')]),
StandAloneEngine('ElasticContactLaw'),
DeusExMachina('GravityEngine',{'gravity':[0,0,-10]}),
DeusExMachina('NewtonsDampedLaw',{'damping':0.2}),
]
o.run(5)
_______________________________________________
yade-dev mailing list
yade-dev@xxxxxxxxxxxxxxxx
https://lists.berlios.de/mailman/listinfo/yade-dev
Follow ups
References