Source code for cellpack.autopack.ingredient.multi_sphere

-from panda3d.core import Point3, TransformState
-from panda3d.bullet import BulletSphereShape, BulletRigidBodyNode
-from math import pi
+from math import pi
 import numpy
 
 from .Ingredient import Ingredient
@@ -299,22 +297,6 @@ 

Source code for cellpack.autopack.ingredient.multi_sphere

return False, insidePoints, newDistPoints
-
-[docs] - def add_rb_node(self, worldNP): - inodenp = worldNP.attachNewNode(BulletRigidBodyNode(self.name)) - inodenp.node().setMass(1.0) - level = self.deepest_level - centers = self.positions[level] - radii = self.radii[level] - for radc, posc in zip(radii, centers): - shape = BulletSphereShape(radc) - inodenp.node().addShape( - shape, TransformState.makePos(Point3(posc[0], posc[1], posc[2])) - ) # - return inodenp
- -
[docs] def get_signed_distance( diff --git a/_modules/cellpack/autopack/ingredient/single_cube.html b/_modules/cellpack/autopack/ingredient/single_cube.html index 854244736..c24f8911c 100644 --- a/_modules/cellpack/autopack/ingredient/single_cube.html +++ b/_modules/cellpack/autopack/ingredient/single_cube.html @@ -40,9 +40,6 @@

Navigation

Source code for cellpack.autopack.ingredient.single_cube

 from math import sqrt, pi
 import numpy
-from panda3d.core import Point3, TransformState, Vec3
-from panda3d.bullet import BulletBoxShape, BulletRigidBodyNode
-
 from .Ingredient import Ingredient
 from .utils import ApplyMatrix
 import cellpack.autopack as autopack
@@ -381,23 +378,6 @@ 

Source code for cellpack.autopack.ingredient.single_cube

return insidePoints, newDistPoints
-
-[docs] - def add_rb_node(self, worldNP): - halfextents = self.bb[1] - shape = BulletBoxShape( - Vec3(halfextents[0], halfextents[1], halfextents[2]) - ) # halfExtents - inodenp = worldNP.attachNewNode(BulletRigidBodyNode(self.name)) - inodenp.node().setMass(1.0) - # inodenp.node().addShape(shape) - inodenp.node().addShape( - shape, TransformState.makePos(Point3(0, 0, 0)) - ) # , pMat)#TransformState.makePos(Point3(jtrans[0],jtrans[1],jtrans[2])))#rotation ? - # spherenp.setPos(-2, 0, 4) - return inodenp
- -
[docs] def cube_surface_distance( diff --git a/_modules/cellpack/autopack/ingredient/single_cylinder.html b/_modules/cellpack/autopack/ingredient/single_cylinder.html index 5f8a3210d..33ee9739b 100644 --- a/_modules/cellpack/autopack/ingredient/single_cylinder.html +++ b/_modules/cellpack/autopack/ingredient/single_cylinder.html @@ -41,14 +41,10 @@

Source code for cellpack.autopack.ingredient.single_cylinder

import numpy import math from math import pi, sqrt -from panda3d.core import Point3, TransformState -from panda3d.bullet import BulletCylinderShape, BulletRigidBodyNode - from cellpack.autopack.utils import get_distance from .Ingredient import Ingredient import cellpack.autopack as autopack -from .utils import pandaMatrice helper = autopack.helper @@ -299,34 +295,6 @@

Source code for cellpack.autopack.ingredient.single_cylinder

)
-
-[docs] - def add_rb_node(self, worldNP): - inodenp = worldNP.attachNewNode(BulletRigidBodyNode(self.name)) - inodenp.node().setMass(1.0) - centT1 = self.positions[ - 0 - ] # ingr.transformPoints(jtrans, rotMat, ingr.positions[0]) - centT2 = self.positions2[ - 0 - ] # ingr.transformPoints(jtrans, rotMat, ingr.positions2[0]) - for radc, p1, p2 in zip(self.radii[0], centT1, centT2): - length, mat = autopack.helper.getTubePropertiesMatrix(p1, p2) - pMat = pandaMatrice(mat) - # d = numpy.array(p1) - numpy.array(p2) - # s = numpy.sum(d*d) - Point3( - self.principal_vector[0], - self.principal_vector[1], - self.principal_vector[2], - ) - shape = BulletCylinderShape( - radc, length, 1 - ) # math.sqrt(s), 1)# { XUp = 0, YUp = 1, ZUp = 2 } or LVector3f const half_extents - inodenp.node().addShape(shape, TransformState.makeMat(pMat)) # - return inodenp
- -
[docs] def checkCylCollisions( diff --git a/_modules/cellpack/autopack/ingredient/single_sphere.html b/_modules/cellpack/autopack/ingredient/single_sphere.html index 7faf9e63c..449b4c070 100644 --- a/_modules/cellpack/autopack/ingredient/single_sphere.html +++ b/_modules/cellpack/autopack/ingredient/single_sphere.html @@ -40,10 +40,6 @@

Navigation

Source code for cellpack.autopack.ingredient.single_sphere

 import numpy
 from math import pi
-from panda3d.bullet import BulletRigidBodyNode, BulletSphereShape
-from panda3d.core import Point3, TransformState, Vec3
-from panda3d.ode import OdeBody, OdeMass, OdeSphereGeom
-
 import cellpack.autopack as autopack
 
 from .Ingredient import Ingredient
@@ -322,35 +318,6 @@ 

Source code for cellpack.autopack.ingredient.single_sphere

return insidePoints, newDistPoints
-
-[docs] - def add_rb_node(self, worldNP): - shape = BulletSphereShape(self.encapsulating_radius) - inodenp = worldNP.attachNewNode(BulletRigidBodyNode(self.name)) - inodenp.node().setMass(1.0) - # inodenp.node().addShape(shape) - inodenp.node().addShape( - shape, TransformState.makePos(Point3(0, 0, 0)) - ) # rotation ? - # spherenp.setPos(-2, 0, 4) - return inodenp
- - -
-[docs] - def add_rb_node_ode(self, world, jtrans, pMat): - body = OdeBody(world) - M = OdeMass() - M.setSphereTotal(1.0, self.encapsulating_radius) - body.setMass(M) - body.setPosition(Vec3(jtrans[0], jtrans[1], jtrans[2])) - body.setRotation(pMat) - # the geometry for the collision ? - geom = OdeSphereGeom(self.ode_space, self.encapsulating_radius) - geom.setBody(body) - return geom
- -
[docs] def initialize_mesh(self, mesh_store): diff --git a/_modules/cellpack/autopack/ingredient/utils.html b/_modules/cellpack/autopack/ingredient/utils.html index c684ccd1a..0e0a38f62 100644 --- a/_modules/cellpack/autopack/ingredient/utils.html +++ b/_modules/cellpack/autopack/ingredient/utils.html @@ -39,8 +39,6 @@

Navigation

Source code for cellpack.autopack.ingredient.utils

 import numpy
-import panda3d
-from panda3d.core import Mat4
 from math import sqrt, pi, sin, cos, asin
 from cellpack.autopack.transformation import angle_between_vectors
 
@@ -267,36 +265,6 @@ 

Source code for cellpack.autopack.ingredient.utils

# TODO : move somewhere in a more apropriate place ? -
-[docs] -def pandaMatrice(mat): - if panda3d is None: - return - mat = mat.transpose().reshape((16,)) - # print mat,len(mat),mat.shape - pMat = Mat4( - mat[0], - mat[1], - mat[2], - mat[3], - mat[4], - mat[5], - mat[6], - mat[7], - mat[8], - mat[9], - mat[10], - mat[11], - mat[12], - mat[13], - mat[14], - mat[15], - ) - return pMat
- - -
[docs] def get_reflected_point(self, new_position, boundingBox=None): diff --git a/_modules/cellpack/autopack/loaders/config_loader.html b/_modules/cellpack/autopack/loaders/config_loader.html index fa4d935d2..8270aa007 100644 --- a/_modules/cellpack/autopack/loaders/config_loader.html +++ b/_modules/cellpack/autopack/loaders/config_loader.html @@ -53,9 +53,7 @@

Source code for cellpack.autopack.loaders.config_loader

[docs] class Place_Methods(MetaEnum): JITTER = "jitter" - SPHERES_SST = "spheresSST" - PANDA_BULLET = "pandaBullet" - PANDA_BULLET_RELAX = "pandaBulletRelax"
+ SPHERES_SST = "spheresSST"
diff --git a/_sources/RECIPE_SCHEMA.md.txt b/_sources/RECIPE_SCHEMA.md.txt index ac0eb0e7a..b0e6ca6ae 100644 --- a/_sources/RECIPE_SCHEMA.md.txt +++ b/_sources/RECIPE_SCHEMA.md.txt @@ -94,7 +94,7 @@ Display packing in realtime (slow) ### place_method -_Optional `enum`_. One of `"jitter"`, `"spheresSST"`, `"pandaBullet"`.. Default: `"jitter"`. +_Optional `enum`_. One of `"jitter"`, `"spheresSST"`.. Default: `"jitter"`. Will be use if place_method isn't in an ingredient setup @@ -102,8 +102,6 @@ Will be use if place_method isn't in an ingredient setup `"spheresSST"` gets the sphereTrees of the potential colliding neighbors, and does an efficient sphereTree-sphereTree collision detection of the sphereTree for the object being packed against the sphereTrees of each neighbor- returns false if a collision is detected -`"pandaBullet"` Python wrapper for Bullet Physics Engine (popular in ~2010 and used by C4D, Maya, Blender, etc) that provides a variety of object-object collision detection, including collision min/max overlap distance, etc. Allows relaxation in its own loop, springs, rejection, meshes, primitives, etc. - ### use_gradient _Optional `boolean`_. Default: `false`. @@ -321,15 +319,13 @@ The amount this ingredient can move in x, y and z. If z is set to 0, will be a 2 _Optional `number`_. Default: `5.0`. ### place_method -_Optional enum. One of `"jitter"`, `"spheresSST"`, `"pandaBullet"`_. Default: `"jitter"`. +_Optional enum. One of `"jitter"`, `"spheresSST"`_. Default: `"jitter"`. `"jitter"` uses a simple algorithm developed by GJ, M-A-A, MS, and LA to test if a single sphere, sphere-tree, or other primative (box and cylinder) are colliding with masked/unallowed points on the grid... I can't recall all of the allowed types, but check the input parameters that it accepts. I believe there is also an option to perform simple collisions directly between primatives, e.g. sphere-sphere, sphere-box, sphere-cylinder, cylinder-box, and spheretree-others `"spheresSST"` gets the sphereTrees of the potential colliding neighbors, and does an efficient sphereTree-sphereTree collision detection of the sphereTree for the object being packed against the sphereTrees of each neighbor- returns false if a collision is detected -`"pandaBullet"` Python wrapper for Bullet Physics Engine (popular in ~2010 and used by C4D, Maya, Blender, etc) that provides a variety of object-object collision detection, including collision min/max overlap distance, etc. Allows relaxation in its own loop, springs, rejection, meshes, primitives, etc. - ### rejection_threshold _Optional `number`_. Default: `30`. diff --git a/cellpack.autopack.html b/cellpack.autopack.html index 419a23f7e..d4ccad09a 100644 --- a/cellpack.autopack.html +++ b/cellpack.autopack.html @@ -71,8 +71,6 @@

SubpackagesIngredient