How to efficiently convert polyhedrons to potential blocks in batches?
Dear all,
I have created many different polyhedrons of different sizes in makeCloud, how can I convert them in batch without error?
In my MWS below, I found that only one polyhedron was converted, and the shape of this polyhedron was wrong.
Thanks in advance.
Jie
Below is my script:
#######
from yade import polyhedra_
import numpy as np
import math
import random
import os
#------
#Material
n = PolyhedraMat(
powderDensity = 2500
O.materials.
#------
#Dimensions
meanSize = 0.05
wallThickness = 0.5*meanSize
distanceToCentre = 0.01
lengthOfBase = 0.250
heightOfBase = 0.600
#------
#Make Cloud
sp=pack.
mn,mx=Vector3(
R=sqrt(
sp.makeCloud(
for center,radius in sp:
b=Body()
b.mask=1
color=
b=polyhedra
b.state.pos =center #s[0] stores center
b.state.ori = Quaternion(
O.bodies.
def dvalue(vecn1,pp1):
dd1=1*
return dd1
for b in O.bodies:
aa=[]
bb=[]
cc=[]
dd=[]
if not isinstance(
continue
vs = [b.state.ori*v for v in b.shape.v] # vertices in global coords
face2=
id1=0
while id1<len(face2):
face11=face2[id1]
if len(face11)>2:
vec1=
vec2=
vects=
dvalue2=
dv=dvalue2
#dv=
aa.append(
bb.append(
cc.append(
dd.append(dv)
id1=id1+1
print(dd)
r=min(np.
print(r)
bbb=Body()
bbb.aspherical=True
wire=False
color=[125,2,1]
highlight=True
bbb.shape=
utils._
bbb.state.
bbb.state.pos = [0,0.5,0]
O.bodies.
from yade import qt
v=qt.View()
O.saveTmp()
Question information
- Language:
- English Edit question
- Status:
- Invalid
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Vasileios Angelidakis
- Solved:
- Last query:
- Last reply: