Skip to content

Commit

Permalink
Added 3D functionality to barrier rigid body problem
Browse files Browse the repository at this point in the history
* TODO: Add point-triangle and segment-segment distance
* TODO: Debug convergence problems
* Load meshes from mesh directory
* Added 3D primitve scenes
* Added Erleben geometry
* Adde ability to reload scene with out changing view
  • Loading branch information
zfergus committed Mar 3, 2020
1 parent ddf693b commit 5f8d487
Show file tree
Hide file tree
Showing 26 changed files with 12,871 additions and 178 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -252,5 +252,7 @@ tmp
hpc-results
paper
temp-plot.html
*.blend[123456789]
erleben.blend

**/*.bak
4 changes: 2 additions & 2 deletions fixtures/3D.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
"coefficient_restitution": -1,
"gravity": [0, -9.8, 0],
"rigid_bodies": [{
"mesh": "/Users/zachary/models/keenan-crane/spot/spot_triangulated.obj",
"mesh": "spot.obj",
"position": [0, 0, 0],
"rotation": [0, 135, 0],
"linear_velocity": [0, 0, 0],
"angular_velocity": [0, 0, 0]
},
{
"mesh": "/Users/zachary/Development/grad-research/collisions/fixing-collisions/meshes/plane.obj",
"mesh": "plane.obj",
"is_dof_fixed": [true, true, true, true, true, true],
"position": [0, -1, 0]
}
Expand Down
36 changes: 36 additions & 0 deletions fixtures/3D/edge-edge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"scene_type": "distance_barrier_rb_problem",
"max_iterations": 1000,
"timestep_size": 0.01,
"distance_barrier_constraint": {
"custom_initial_epsilon": 0.01,
"detection_method": "hash_grid",
"active_constraint_scale": 1.01
},
"barrier_solver": {
"e_b": 1e-06,
"m": 1,
"t_init": 100,
"t_inc": 100,
"c": 0.1,
"inner_solver": "newton_solver"
},
"rigid_body_problem": {
"coefficient_restitution": -1,
"gravity": [0, -9.8, 0],
"rigid_bodies": [{
"mesh": "tet-perp.obj",
"position": [0, 0.5, 0],
"rotation": [0, 0, 0],
"linear_velocity": [0, 0, 0],
"angular_velocity": [0, 0, 0]
},
{
"mesh": "tet-perp.obj",
"position": [0, -0.5, 0],
"rotation": [0, 0, 0],
"is_dof_fixed": [true, true, true, true, true, true]
}
]
}
}
36 changes: 36 additions & 0 deletions fixtures/3D/face-vertex.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"scene_type": "distance_barrier_rb_problem",
"max_iterations": 1000,
"timestep_size": 0.01,
"distance_barrier_constraint": {
"custom_initial_epsilon": 0.01,
"detection_method": "hash_grid",
"active_constraint_scale": 1.01
},
"barrier_solver": {
"e_b": 1e-06,
"m": 1,
"t_init": 100,
"t_inc": 100,
"c": 0.1,
"inner_solver": "newton_solver"
},
"rigid_body_problem": {
"coefficient_restitution": -1,
"gravity": [0, -9.8, 0],
"rigid_bodies": [{
"mesh": "tet-pyramid.obj",
"position": [0, 0.5, 0],
"rotation": [0, 0, 0],
"linear_velocity": [0, 0, 0],
"angular_velocity": [0, 0, 0]
},
{
"mesh": "tet-pyramid.obj",
"position": [0, -0.5, 0],
"rotation": [0, 0, 0],
"is_dof_fixed": [true, true, true, true, true, true]
}
]
}
}
36 changes: 36 additions & 0 deletions fixtures/3D/vertex-face.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"scene_type": "distance_barrier_rb_problem",
"max_iterations": 1000,
"timestep_size": 0.01,
"distance_barrier_constraint": {
"custom_initial_epsilon": 0.01,
"detection_method": "hash_grid",
"active_constraint_scale": 1.01
},
"barrier_solver": {
"e_b": 1e-06,
"m": 1,
"t_init": 100,
"t_inc": 100,
"c": 0.1,
"inner_solver": "newton_solver"
},
"rigid_body_problem": {
"coefficient_restitution": -1,
"gravity": [0, -9.8, 0],
"rigid_bodies": [{
"mesh": "tet-pyramid.obj",
"position": [0, 0.5, 0],
"rotation": [0, 0, 180],
"linear_velocity": [0, 0, 0],
"angular_velocity": [0, 0, 0]
},
{
"mesh": "tet-pyramid.obj",
"position": [0, -0.5, 0],
"rotation": [0, 0, 180],
"is_dof_fixed": [true, true, true, true, true, true]
}
]
}
}
23 changes: 23 additions & 0 deletions meshes/erleben/cliff.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Blender v2.80 (sub 75) OBJ File: 'erleben.blend'
# www.blender.org
v -0.750000 -0.500000 0.750000
v -0.500000 0.500000 0.500000
v -0.750000 -0.500000 -0.750000
v -0.500000 0.500000 -0.500000
v 0.750000 -0.500000 0.750000
v 0.500000 0.500000 0.500000
v 0.750000 -0.500000 -0.750000
v 0.500000 0.500000 -0.500000
s off
f 2 3 1
f 4 7 3
f 8 5 7
f 6 1 5
f 7 1 3
f 4 6 8
f 2 4 3
f 4 8 7
f 8 6 5
f 6 2 1
f 7 5 1
f 4 2 6
59 changes: 59 additions & 0 deletions meshes/erleben/crack.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Blender v2.80 (sub 75) OBJ File: ''
# www.blender.org
v -1.000000 -0.500000 -2.000000
v -0.500000 -0.500000 -2.000000
v 0.000000 -0.500000 -2.000000
v 0.500000 -0.500000 -2.000000
v 1.000000 -0.500000 -2.000000
v -1.000000 0.500000 -2.000000
v -0.500000 0.500000 -2.000000
v 0.000000 0.000000 -2.000000
v 0.500000 0.500000 -2.000000
v 1.000000 0.500000 -2.000000
v -1.000000 0.500000 2.000000
v -1.000000 -0.500000 2.000000
v -0.500000 -0.500000 2.000000
v -0.500000 0.500000 2.000000
v 0.000000 -0.500000 2.000000
v 0.000000 0.000000 2.000000
v 0.500000 0.500000 2.000000
v 0.500000 -0.500000 2.000000
v 1.000000 -0.500000 2.000000
v 1.000000 0.500000 2.000000
s off
f 1 6 7
f 4 8 9
f 8 2 7
f 5 4 9
f 3 8 4
f 8 3 2
f 5 9 10
f 1 7 2
f 12 14 11
f 18 17 16
f 16 14 13
f 19 17 18
f 15 18 16
f 16 13 15
f 19 20 17
f 12 13 14
f 10 19 5
f 2 12 1
f 9 20 10
f 8 7 14
f 9 8 16
f 6 14 7
f 5 18 4
f 1 11 6
f 3 4 18
f 2 3 15
f 10 20 19
f 2 13 12
f 9 17 20
f 8 14 16
f 9 16 17
f 6 11 14
f 5 19 18
f 1 12 11
f 3 18 15
f 2 15 13
139 changes: 139 additions & 0 deletions meshes/erleben/hole.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Blender v2.80 (sub 75) OBJ File: ''
# www.blender.org
v -1.000000 -0.500000 -0.500000
v -1.000000 0.500000 -0.500000
v -1.000000 -0.500000 -1.000000
v -1.000000 0.500000 -1.000000
v -0.500000 -0.500000 -0.500000
v -0.500000 0.500000 -0.500000
v -0.500000 -0.500000 -1.000000
v -0.500000 0.500000 -1.000000
v -1.000000 -0.500000 0.500000
v -1.000000 0.500000 0.500000
v -0.500000 0.500000 0.500000
v -0.500000 -0.500000 0.500000
v -1.000000 -0.500000 1.000000
v -1.000000 0.500000 1.000000
v -0.500000 0.500000 1.000000
v -0.500000 -0.500000 1.000000
v 0.500000 0.500000 0.500000
v 0.500000 -0.500000 0.500000
v 0.500000 0.500000 1.000000
v 0.500000 -0.500000 1.000000
v 1.000000 0.500000 0.500000
v 1.000000 -0.500000 0.500000
v 1.000000 0.500000 1.000000
v 1.000000 -0.500000 1.000000
v 0.500000 0.500000 -0.500000
v 0.500000 -0.500000 -0.500000
v 1.000000 0.500000 -0.500000
v 1.000000 -0.500000 -0.500000
v 0.500000 0.500000 -1.000000
v 0.500000 -0.500000 -1.000000
v 1.000000 0.500000 -1.000000
v 1.000000 -0.500000 -1.000000
v -0.500000 -0.000000 -0.500000
v -0.500000 -0.000000 0.500000
v -0.500000 0.500000 -0.000000
v 0.500000 -0.000000 0.500000
v -0.000000 0.500000 0.500000
v 0.500000 -0.000000 -0.500000
v 0.500000 0.500000 -0.000000
v -0.000000 0.500000 -0.500000
v 1.000000 -0.500000 -0.000000
v 1.000000 0.500000 -0.000000
v -1.000000 -0.500000 -0.000000
v -1.000000 0.500000 -0.000000
v -0.000000 0.500000 1.000000
v -0.000000 -0.500000 1.000000
v 0.000000 0.500000 -1.000000
v 0.000000 -0.500000 -1.000000
s off
f 2 3 1
f 4 7 3
f 43 10 44
f 3 5 1
f 4 6 8
f 12 13 9
f 48 26 5
f 44 11 35
f 6 34 33
f 15 13 16
f 9 14 10
f 10 15 11
f 45 17 37
f 18 24 20
f 46 19 45
f 12 9 43
f 21 24 22
f 41 27 42
f 19 21 17
f 20 23 19
f 27 29 25
f 17 38 36
f 42 25 39
f 26 28 41
f 29 32 30
f 28 31 27
f 28 30 32
f 47 30 48
f 18 20 46
f 38 6 33
f 47 8 40
f 11 36 34
f 12 26 18
f 38 34 36
f 22 42 21
f 8 48 7
f 16 45 15
f 1 44 2
f 2 4 3
f 4 8 7
f 43 9 10
f 3 7 5
f 4 2 6
f 12 16 13
f 5 7 48
f 48 30 26
f 35 6 2
f 44 10 11
f 35 2 44
f 6 11 34
f 15 14 13
f 9 13 14
f 10 14 15
f 37 11 15
f 45 19 17
f 37 15 45
f 18 22 24
f 46 20 19
f 1 5 43
f 5 12 43
f 21 23 24
f 41 28 27
f 19 23 21
f 20 24 23
f 27 31 29
f 17 25 38
f 39 17 21
f 42 27 25
f 39 21 42
f 41 22 18
f 18 26 41
f 29 31 32
f 28 32 31
f 28 26 30
f 47 29 30
f 46 16 12
f 12 18 46
f 38 25 6
f 8 6 40
f 40 25 47
f 25 29 47
f 11 17 36
f 12 5 26
f 38 33 34
f 22 41 42
f 8 47 48
f 16 46 45
f 1 43 44
Loading

0 comments on commit 5f8d487

Please sign in to comment.