ymport.stl function scale and shift
Dear all,
I have a question, if I look into the documentation of Yade DEM the stl import function: ymport.stl should work fine with the following commands:
ymport(file, scale = 1.0, shift=Vector3(
I have tried this with the rod penetration example https:/
I have only added the the scale to the code as attached. Can it be that it is connect to the stl file or these commands (scale / shift) does not work for the ymport.stl ?
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
from builtins import range
import random
from yade import ymport
## PhysicalParameters
## Variant of mesh
mesh = 'coarse'
#mesh = 'fine'
#mesh = 'tiny'
## Import geometry
rod = O.bodies.
# Spheres
sphereRadius = 0.01
nbSpheres = (32,11,32)
print("Creating %d spheres.
for i in range(nbSpheres
for j in range(nbSpheres
for k in range(nbSpheres
x = (i*2 - nbSpheres[
y = -j*sphereRadius
z = (k*2 - nbSpheres[
r = random.
fixed = False
color=
if (i==0 or i==nbSpheres[0]-1 or j==nbSpheres[1]-1 or k==0 or k==nbSpheres[2]-1):
fixed = True
color=
O.bodies.
print("done\n")
## Estimate time step
#O.dt=PWaveTime
O.dt=0.0001
## Engines
O.engines=[
## Resets forces and momenta the act on bodies
ForceResetter(),
## Using bounding boxes find possible body collisions.
InsertionSortC
Bo1_Sphere_
Bo1_Facet_Aabb(),
]),
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
## Apply gravity
## Motion equation
NewtonIntegrat
## Apply kinematics to rod
TranslationEng
## Save force on rod
#ForceRecorder
]
import sys,time
print("Start simulation: " + mesh)
nbIter=10000
from yade import qt
qt.View()
O.stopAtIter=nbIter
O.run()
#for t in xrange(2):
# start=time.
# speed=nbIter/
#print "FINISH"
#quit()
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Hans Henning
- Solved:
- Last query:
- Last reply: