Skip to content

Commit 1104217

Browse files
committed
randomize pattern example
1 parent 3b2ae33 commit 1104217

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/dem_thrust.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import pathlib
2+
import random
23

34
import compas
45
from compas.datastructures import Mesh
6+
from compas_libigl.mapping import TESSAGON_TYPES
57

68
from compas_dem.models import BlockModel
79
from compas_dem.viewer import DEMViewer
@@ -18,9 +20,11 @@
1820
# Model and interactions
1921
# =============================================================================
2022

21-
model = BlockModel.from_meshpattern(mesh, "ZigZag", tmin=0.05, tmax=0.3)
23+
patternname = random.choice(list(TESSAGON_TYPES.keys()))
2224

23-
# model.compute_contacts(tolerance=0.001)
25+
model = BlockModel.from_meshpattern(mesh, patternname, tmin=0.05, tmax=0.3)
26+
27+
model.compute_contacts(tolerance=0.001)
2428

2529
# =============================================================================
2630
# Viz

0 commit comments

Comments
 (0)