Issue gts randon dense paking

Asked by Luis Barbosa on 2021-02-17

Hi all,

I am used to create pakings from gts surfaces. However, I am having problem with this right now.
I am trying to create a dense pack in gts predicates, but it seems it is operating in an inverse way. Instead of the pack be presented inside the predicate, it appears outside. The predicate is the void region inside the pack. It seems a boolean operation, but has nothing to do with my code. I already tried creating gts binary or ascii, or even changing the language ( -*- coding: utf-8 -*-).

Here is the script I am using

#!/usr/bin/python
# -*- coding: utf-8 -*-
# F.T. Silva <email address hidden>

from yade.pack import *
from yade import pack,export,qt
from math import *
from yade import plot
from yade import ymport
import gts

######################################Material#################################################
O.materials.append(JCFpmMat(type=1,young=70e5,poisson=0.3,frictionAngle=radians(30),density=0.0025,tensileStrength=194,cohesion=194,jointNormalStiffness=10,jointShearStiffness=10,jointCohesion=194,jointFrictionAngle=radians(30),jointDilationAngle=0.0,label='spheres'))
######################################Selector############################################
sel=22
######################################Surface#############################################
surf=gts.read(open('agg'+str(sel)+'.gts'))

if surf.is_closed():
 pred=pack.inGtsSurface(surf)
 radius=0.03 #(cm)
 O.bodies.append(pack.randomDensePack(pred,radius=radius))

O.bodies.append(pack.gtsSurface2Facets(surf,wire=True))

######################################Engine#################################################
O.engines=[
  ForceResetter(),

 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
  [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False, Key="Wei", recordCracks=True)]
 ),

  GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=500,timestepSafetyCoefficient=0.5),
  NewtonIntegrator(damping=0.1,gravity=[0,0,-981]),#cm/s2

]

from yade import qt
qt.View()
qt.Controller()

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Luis Barbosa
Solved:
2021-02-17
Last query:
2021-02-17
Last reply:
Luis Barbosa (luis-pires-b) said : #1

Hi guys,

Sorry, I discovery the issue. So silly.

When using the command stl2gts to convert an STL file to GTS format, I was activating "revert face normals".
So, when implementing the pack it considered the pred to be a void.
Maybe a useful approach for some cases.

Cheers,
Luis