warp-lang 1.5.1__py3-none-macosx_10_13_universal2.whl → 1.6.0__py3-none-macosx_10_13_universal2.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of warp-lang might be problematic. Click here for more details.
- warp/__init__.py +5 -0
- warp/autograd.py +414 -191
- warp/bin/libwarp-clang.dylib +0 -0
- warp/bin/libwarp.dylib +0 -0
- warp/build.py +40 -12
- warp/build_dll.py +13 -6
- warp/builtins.py +1076 -480
- warp/codegen.py +240 -119
- warp/config.py +1 -1
- warp/context.py +298 -84
- warp/examples/assets/square_cloth.usd +0 -0
- warp/examples/benchmarks/benchmark_gemm.py +27 -18
- warp/examples/benchmarks/benchmark_interop_paddle.py +3 -3
- warp/examples/benchmarks/benchmark_interop_torch.py +3 -3
- warp/examples/core/example_torch.py +18 -34
- warp/examples/fem/example_apic_fluid.py +1 -0
- warp/examples/fem/example_mixed_elasticity.py +1 -1
- warp/examples/optim/example_bounce.py +1 -1
- warp/examples/optim/example_cloth_throw.py +1 -1
- warp/examples/optim/example_diffray.py +4 -15
- warp/examples/optim/example_drone.py +1 -1
- warp/examples/optim/example_softbody_properties.py +392 -0
- warp/examples/optim/example_trajectory.py +1 -3
- warp/examples/optim/example_walker.py +5 -0
- warp/examples/sim/example_cartpole.py +0 -2
- warp/examples/sim/example_cloth_self_contact.py +260 -0
- warp/examples/sim/example_granular_collision_sdf.py +4 -5
- warp/examples/sim/example_jacobian_ik.py +0 -2
- warp/examples/sim/example_quadruped.py +5 -2
- warp/examples/tile/example_tile_cholesky.py +79 -0
- warp/examples/tile/example_tile_convolution.py +2 -2
- warp/examples/tile/example_tile_fft.py +2 -2
- warp/examples/tile/example_tile_filtering.py +3 -3
- warp/examples/tile/example_tile_matmul.py +4 -4
- warp/examples/tile/example_tile_mlp.py +12 -12
- warp/examples/tile/example_tile_nbody.py +180 -0
- warp/examples/tile/example_tile_walker.py +319 -0
- warp/math.py +147 -0
- warp/native/array.h +12 -0
- warp/native/builtin.h +0 -1
- warp/native/bvh.cpp +149 -70
- warp/native/bvh.cu +287 -68
- warp/native/bvh.h +195 -85
- warp/native/clang/clang.cpp +5 -1
- warp/native/cuda_util.cpp +35 -0
- warp/native/cuda_util.h +5 -0
- warp/native/exports.h +40 -40
- warp/native/intersect.h +17 -0
- warp/native/mat.h +41 -0
- warp/native/mathdx.cpp +19 -0
- warp/native/mesh.cpp +25 -8
- warp/native/mesh.cu +153 -101
- warp/native/mesh.h +482 -403
- warp/native/quat.h +40 -0
- warp/native/solid_angle.h +7 -0
- warp/native/sort.cpp +85 -0
- warp/native/sort.cu +34 -0
- warp/native/sort.h +3 -1
- warp/native/spatial.h +11 -0
- warp/native/tile.h +1185 -664
- warp/native/tile_reduce.h +8 -6
- warp/native/vec.h +41 -0
- warp/native/warp.cpp +8 -1
- warp/native/warp.cu +263 -40
- warp/native/warp.h +19 -5
- warp/optim/linear.py +22 -4
- warp/render/render_opengl.py +124 -59
- warp/sim/__init__.py +6 -1
- warp/sim/collide.py +270 -26
- warp/sim/integrator_euler.py +25 -7
- warp/sim/integrator_featherstone.py +154 -35
- warp/sim/integrator_vbd.py +842 -40
- warp/sim/model.py +111 -53
- warp/stubs.py +248 -115
- warp/tape.py +28 -30
- warp/tests/aux_test_module_unload.py +15 -0
- warp/tests/{test_sim_grad.py → flaky_test_sim_grad.py} +104 -63
- warp/tests/test_array.py +74 -0
- warp/tests/test_assert.py +242 -0
- warp/tests/test_codegen.py +14 -61
- warp/tests/test_collision.py +2 -2
- warp/tests/test_examples.py +9 -0
- warp/tests/test_grad_debug.py +87 -2
- warp/tests/test_hash_grid.py +1 -1
- warp/tests/test_ipc.py +116 -0
- warp/tests/test_mat.py +138 -167
- warp/tests/test_math.py +47 -1
- warp/tests/test_matmul.py +11 -7
- warp/tests/test_matmul_lite.py +4 -4
- warp/tests/test_mesh.py +84 -60
- warp/tests/test_mesh_query_aabb.py +165 -0
- warp/tests/test_mesh_query_point.py +328 -286
- warp/tests/test_mesh_query_ray.py +134 -121
- warp/tests/test_mlp.py +2 -2
- warp/tests/test_operators.py +43 -0
- warp/tests/test_overwrite.py +2 -2
- warp/tests/test_quat.py +77 -0
- warp/tests/test_reload.py +29 -0
- warp/tests/test_sim_grad_bounce_linear.py +204 -0
- warp/tests/test_static.py +16 -0
- warp/tests/test_tape.py +25 -0
- warp/tests/test_tile.py +134 -191
- warp/tests/test_tile_load.py +356 -0
- warp/tests/test_tile_mathdx.py +61 -8
- warp/tests/test_tile_mlp.py +17 -17
- warp/tests/test_tile_reduce.py +24 -18
- warp/tests/test_tile_shared_memory.py +66 -17
- warp/tests/test_tile_view.py +165 -0
- warp/tests/test_torch.py +35 -0
- warp/tests/test_utils.py +36 -24
- warp/tests/test_vec.py +110 -0
- warp/tests/unittest_suites.py +29 -4
- warp/tests/unittest_utils.py +30 -11
- warp/thirdparty/unittest_parallel.py +2 -2
- warp/types.py +409 -99
- warp/utils.py +9 -5
- {warp_lang-1.5.1.dist-info → warp_lang-1.6.0.dist-info}/METADATA +68 -44
- {warp_lang-1.5.1.dist-info → warp_lang-1.6.0.dist-info}/RECORD +121 -110
- {warp_lang-1.5.1.dist-info → warp_lang-1.6.0.dist-info}/WHEEL +1 -1
- warp/examples/benchmarks/benchmark_tile.py +0 -179
- warp/native/tile_gemm.h +0 -341
- {warp_lang-1.5.1.dist-info → warp_lang-1.6.0.dist-info}/LICENSE.md +0 -0
- {warp_lang-1.5.1.dist-info → warp_lang-1.6.0.dist-info}/top_level.txt +0 -0
warp/sim/model.py
CHANGED
|
@@ -591,6 +591,7 @@ class Model:
|
|
|
591
591
|
joint_attach_ke (float): Joint attachment force stiffness (used by :class:`SemiImplicitIntegrator`)
|
|
592
592
|
joint_attach_kd (float): Joint attachment force damping (used by :class:`SemiImplicitIntegrator`)
|
|
593
593
|
|
|
594
|
+
soft_contact_radius (float): Contact radius used for self-collisions in the VBD integrator.
|
|
594
595
|
soft_contact_margin (float): Contact margin for generation of soft contacts
|
|
595
596
|
soft_contact_ke (float): Stiffness of soft contacts (used by the Euler integrators)
|
|
596
597
|
soft_contact_kd (float): Damping of soft contacts (used by the Euler integrators)
|
|
@@ -761,6 +762,7 @@ class Model:
|
|
|
761
762
|
self.joint_attach_ke = 1.0e3
|
|
762
763
|
self.joint_attach_kd = 1.0e2
|
|
763
764
|
|
|
765
|
+
self.soft_contact_radius = 0.2
|
|
764
766
|
self.soft_contact_margin = 0.2
|
|
765
767
|
self.soft_contact_ke = 1.0e3
|
|
766
768
|
self.soft_contact_kd = 10.0
|
|
@@ -1046,6 +1048,8 @@ class Model:
|
|
|
1046
1048
|
@property
|
|
1047
1049
|
def soft_contact_max(self):
|
|
1048
1050
|
"""Maximum number of soft contacts that can be registered"""
|
|
1051
|
+
if self.soft_contact_particle is None:
|
|
1052
|
+
return 0
|
|
1049
1053
|
return len(self.soft_contact_particle)
|
|
1050
1054
|
|
|
1051
1055
|
|
|
@@ -1747,8 +1751,8 @@ class ModelBuilder:
|
|
|
1747
1751
|
mode: int = JOINT_MODE_FORCE,
|
|
1748
1752
|
limit_lower: float = -2 * math.pi,
|
|
1749
1753
|
limit_upper: float = 2 * math.pi,
|
|
1750
|
-
limit_ke: float =
|
|
1751
|
-
limit_kd: float =
|
|
1754
|
+
limit_ke: float = None,
|
|
1755
|
+
limit_kd: float = None,
|
|
1752
1756
|
linear_compliance: float = 0.0,
|
|
1753
1757
|
angular_compliance: float = 0.0,
|
|
1754
1758
|
armature: float = 1e-2,
|
|
@@ -1769,8 +1773,8 @@ class ModelBuilder:
|
|
|
1769
1773
|
target_kd: The damping of the joint target
|
|
1770
1774
|
limit_lower: The lower limit of the joint
|
|
1771
1775
|
limit_upper: The upper limit of the joint
|
|
1772
|
-
limit_ke: The stiffness of the joint limit
|
|
1773
|
-
limit_kd: The damping of the joint limit
|
|
1776
|
+
limit_ke: The stiffness of the joint limit (None to use the default value :attr:`default_joint_limit_ke`)
|
|
1777
|
+
limit_kd: The damping of the joint limit (None to use the default value :attr:`default_joint_limit_kd`)
|
|
1774
1778
|
linear_compliance: The linear compliance of the joint
|
|
1775
1779
|
angular_compliance: The angular compliance of the joint
|
|
1776
1780
|
armature: Artificial inertia added around the joint axis
|
|
@@ -1788,6 +1792,9 @@ class ModelBuilder:
|
|
|
1788
1792
|
if child_xform is None:
|
|
1789
1793
|
child_xform = wp.transform()
|
|
1790
1794
|
|
|
1795
|
+
limit_ke = limit_ke if limit_ke is not None else self.default_joint_limit_ke
|
|
1796
|
+
limit_kd = limit_kd if limit_kd is not None else self.default_joint_limit_kd
|
|
1797
|
+
|
|
1791
1798
|
action = 0.0
|
|
1792
1799
|
if target is None and mode == JOINT_MODE_TARGET_POSITION:
|
|
1793
1800
|
action = 0.5 * (limit_lower + limit_upper)
|
|
@@ -1834,8 +1841,8 @@ class ModelBuilder:
|
|
|
1834
1841
|
mode: int = JOINT_MODE_FORCE,
|
|
1835
1842
|
limit_lower: float = -1e4,
|
|
1836
1843
|
limit_upper: float = 1e4,
|
|
1837
|
-
limit_ke: float =
|
|
1838
|
-
limit_kd: float =
|
|
1844
|
+
limit_ke: float = None,
|
|
1845
|
+
limit_kd: float = None,
|
|
1839
1846
|
linear_compliance: float = 0.0,
|
|
1840
1847
|
angular_compliance: float = 0.0,
|
|
1841
1848
|
armature: float = 1e-2,
|
|
@@ -1856,8 +1863,8 @@ class ModelBuilder:
|
|
|
1856
1863
|
target_kd: The damping of the joint target
|
|
1857
1864
|
limit_lower: The lower limit of the joint
|
|
1858
1865
|
limit_upper: The upper limit of the joint
|
|
1859
|
-
limit_ke: The stiffness of the joint limit
|
|
1860
|
-
limit_kd: The damping of the joint limit
|
|
1866
|
+
limit_ke: The stiffness of the joint limit (None to use the default value :attr:`default_joint_limit_ke`)
|
|
1867
|
+
limit_kd: The damping of the joint limit (None to use the default value :attr:`default_joint_limit_ke`)
|
|
1861
1868
|
linear_compliance: The linear compliance of the joint
|
|
1862
1869
|
angular_compliance: The angular compliance of the joint
|
|
1863
1870
|
armature: Artificial inertia added around the joint axis
|
|
@@ -1875,6 +1882,9 @@ class ModelBuilder:
|
|
|
1875
1882
|
if child_xform is None:
|
|
1876
1883
|
child_xform = wp.transform()
|
|
1877
1884
|
|
|
1885
|
+
limit_ke = limit_ke if limit_ke is not None else self.default_joint_limit_ke
|
|
1886
|
+
limit_kd = limit_kd if limit_kd is not None else self.default_joint_limit_kd
|
|
1887
|
+
|
|
1878
1888
|
action = 0.0
|
|
1879
1889
|
if target is None and mode == JOINT_MODE_TARGET_POSITION:
|
|
1880
1890
|
action = 0.5 * (limit_lower + limit_upper)
|
|
@@ -2523,7 +2533,7 @@ class ModelBuilder:
|
|
|
2523
2533
|
last_dynamic_body_name = self.body_name[last_dynamic_body] if last_dynamic_body > -1 else "world"
|
|
2524
2534
|
if verbose:
|
|
2525
2535
|
print(
|
|
2526
|
-
f
|
|
2536
|
+
f"Remove fixed joint {joint['name']} between {parent_name} and {child_name}, "
|
|
2527
2537
|
f"merging {child_name} into {last_dynamic_body_name}"
|
|
2528
2538
|
)
|
|
2529
2539
|
child_id = body_data[child_body]["original_id"]
|
|
@@ -2775,7 +2785,7 @@ class ModelBuilder:
|
|
|
2775
2785
|
c = np.cross(normal, (0.0, 1.0, 0.0))
|
|
2776
2786
|
angle = np.arcsin(np.linalg.norm(c))
|
|
2777
2787
|
axis = np.abs(c) / np.linalg.norm(c)
|
|
2778
|
-
rot = wp.quat_from_axis_angle(axis, angle)
|
|
2788
|
+
rot = wp.quat_from_axis_angle(wp.vec3(*axis), wp.float32(angle))
|
|
2779
2789
|
scale = wp.vec3(width, length, 0.0)
|
|
2780
2790
|
|
|
2781
2791
|
return self._add_shape(
|
|
@@ -3501,11 +3511,11 @@ class ModelBuilder:
|
|
|
3501
3511
|
i: int,
|
|
3502
3512
|
j: int,
|
|
3503
3513
|
k: int,
|
|
3504
|
-
tri_ke: float =
|
|
3505
|
-
tri_ka: float =
|
|
3506
|
-
tri_kd: float =
|
|
3507
|
-
tri_drag: float =
|
|
3508
|
-
tri_lift: float =
|
|
3514
|
+
tri_ke: float = None,
|
|
3515
|
+
tri_ka: float = None,
|
|
3516
|
+
tri_kd: float = None,
|
|
3517
|
+
tri_drag: float = None,
|
|
3518
|
+
tri_lift: float = None,
|
|
3509
3519
|
) -> float:
|
|
3510
3520
|
"""Adds a triangular FEM element between three particles in the system.
|
|
3511
3521
|
|
|
@@ -3525,6 +3535,11 @@ class ModelBuilder:
|
|
|
3525
3535
|
between the particles in their initial configuration.
|
|
3526
3536
|
"""
|
|
3527
3537
|
# TODO: Expose elastic parameters on a per-element basis
|
|
3538
|
+
tri_ke = tri_ke if tri_ke is not None else self.default_tri_ke
|
|
3539
|
+
tri_ka = tri_ka if tri_ka is not None else self.default_tri_ka
|
|
3540
|
+
tri_kd = tri_kd if tri_kd is not None else self.default_tri_kd
|
|
3541
|
+
tri_drag = tri_drag if tri_drag is not None else self.default_tri_drag
|
|
3542
|
+
tri_lift = tri_lift if tri_lift is not None else self.default_tri_lift
|
|
3528
3543
|
|
|
3529
3544
|
# compute basis for 2D rest pose
|
|
3530
3545
|
p = self.particle_q[i]
|
|
@@ -3705,8 +3720,8 @@ class ModelBuilder:
|
|
|
3705
3720
|
k: int,
|
|
3706
3721
|
l: int,
|
|
3707
3722
|
rest: float = None,
|
|
3708
|
-
edge_ke: float =
|
|
3709
|
-
edge_kd: float =
|
|
3723
|
+
edge_ke: float = None,
|
|
3724
|
+
edge_kd: float = None,
|
|
3710
3725
|
):
|
|
3711
3726
|
"""Adds a bending edge element between four particles in the system.
|
|
3712
3727
|
|
|
@@ -3727,6 +3742,9 @@ class ModelBuilder:
|
|
|
3727
3742
|
winding: (i, k, l), (j, l, k).
|
|
3728
3743
|
|
|
3729
3744
|
"""
|
|
3745
|
+
edge_ke = edge_ke if edge_ke is not None else self.default_edge_ke
|
|
3746
|
+
edge_kd = edge_kd if edge_kd is not None else self.default_edge_kd
|
|
3747
|
+
|
|
3730
3748
|
# compute rest angle
|
|
3731
3749
|
if rest is None:
|
|
3732
3750
|
x1 = self.particle_q[i]
|
|
@@ -3834,17 +3852,17 @@ class ModelBuilder:
|
|
|
3834
3852
|
fix_right: bool = False,
|
|
3835
3853
|
fix_top: bool = False,
|
|
3836
3854
|
fix_bottom: bool = False,
|
|
3837
|
-
tri_ke: float =
|
|
3838
|
-
tri_ka: float =
|
|
3839
|
-
tri_kd: float =
|
|
3840
|
-
tri_drag: float =
|
|
3841
|
-
tri_lift: float =
|
|
3842
|
-
edge_ke: float =
|
|
3843
|
-
edge_kd: float =
|
|
3855
|
+
tri_ke: float = None,
|
|
3856
|
+
tri_ka: float = None,
|
|
3857
|
+
tri_kd: float = None,
|
|
3858
|
+
tri_drag: float = None,
|
|
3859
|
+
tri_lift: float = None,
|
|
3860
|
+
edge_ke: float = None,
|
|
3861
|
+
edge_kd: float = None,
|
|
3844
3862
|
add_springs: bool = False,
|
|
3845
|
-
spring_ke: float =
|
|
3846
|
-
spring_kd: float =
|
|
3847
|
-
particle_radius: float =
|
|
3863
|
+
spring_ke: float = None,
|
|
3864
|
+
spring_kd: float = None,
|
|
3865
|
+
particle_radius: float = None,
|
|
3848
3866
|
):
|
|
3849
3867
|
"""Helper to create a regular planar cloth grid
|
|
3850
3868
|
|
|
@@ -3866,6 +3884,16 @@ class ModelBuilder:
|
|
|
3866
3884
|
fix_top: Make the top-most edge of particles kinematic
|
|
3867
3885
|
fix_bottom: Make the bottom-most edge of particles kinematic
|
|
3868
3886
|
"""
|
|
3887
|
+
tri_ke = tri_ke if tri_ke is not None else self.default_tri_ke
|
|
3888
|
+
tri_ka = tri_ka if tri_ka is not None else self.default_tri_ka
|
|
3889
|
+
tri_kd = tri_kd if tri_kd is not None else self.default_tri_kd
|
|
3890
|
+
tri_drag = tri_drag if tri_drag is not None else self.default_tri_drag
|
|
3891
|
+
tri_lift = tri_lift if tri_lift is not None else self.default_tri_lift
|
|
3892
|
+
edge_ke = edge_ke if edge_ke is not None else self.default_edge_ke
|
|
3893
|
+
edge_kd = edge_kd if edge_kd is not None else self.default_edge_kd
|
|
3894
|
+
spring_ke = spring_ke if spring_ke is not None else self.default_spring_ke
|
|
3895
|
+
spring_kd = spring_kd if spring_kd is not None else self.default_spring_kd
|
|
3896
|
+
particle_radius = particle_radius if particle_radius is not None else self.default_particle_radius
|
|
3869
3897
|
|
|
3870
3898
|
def grid_index(x, y, dim_x):
|
|
3871
3899
|
return y * dim_x + x
|
|
@@ -3968,17 +3996,17 @@ class ModelBuilder:
|
|
|
3968
3996
|
density: float,
|
|
3969
3997
|
edge_callback=None,
|
|
3970
3998
|
face_callback=None,
|
|
3971
|
-
tri_ke: float =
|
|
3972
|
-
tri_ka: float =
|
|
3973
|
-
tri_kd: float =
|
|
3974
|
-
tri_drag: float =
|
|
3975
|
-
tri_lift: float =
|
|
3976
|
-
edge_ke: float =
|
|
3977
|
-
edge_kd: float =
|
|
3999
|
+
tri_ke: float = None,
|
|
4000
|
+
tri_ka: float = None,
|
|
4001
|
+
tri_kd: float = None,
|
|
4002
|
+
tri_drag: float = None,
|
|
4003
|
+
tri_lift: float = None,
|
|
4004
|
+
edge_ke: float = None,
|
|
4005
|
+
edge_kd: float = None,
|
|
3978
4006
|
add_springs: bool = False,
|
|
3979
|
-
spring_ke: float =
|
|
3980
|
-
spring_kd: float =
|
|
3981
|
-
particle_radius: float =
|
|
4007
|
+
spring_ke: float = None,
|
|
4008
|
+
spring_kd: float = None,
|
|
4009
|
+
particle_radius: float = None,
|
|
3982
4010
|
):
|
|
3983
4011
|
"""Helper to create a cloth model from a regular triangle mesh
|
|
3984
4012
|
|
|
@@ -3999,6 +4027,17 @@ class ModelBuilder:
|
|
|
3999
4027
|
|
|
4000
4028
|
The mesh should be two manifold.
|
|
4001
4029
|
"""
|
|
4030
|
+
tri_ke = tri_ke if tri_ke is not None else self.default_tri_ke
|
|
4031
|
+
tri_ka = tri_ka if tri_ka is not None else self.default_tri_ka
|
|
4032
|
+
tri_kd = tri_kd if tri_kd is not None else self.default_tri_kd
|
|
4033
|
+
tri_drag = tri_drag if tri_drag is not None else self.default_tri_drag
|
|
4034
|
+
tri_lift = tri_lift if tri_lift is not None else self.default_tri_lift
|
|
4035
|
+
edge_ke = edge_ke if edge_ke is not None else self.default_edge_ke
|
|
4036
|
+
edge_kd = edge_kd if edge_kd is not None else self.default_edge_kd
|
|
4037
|
+
spring_ke = spring_ke if spring_ke is not None else self.default_spring_ke
|
|
4038
|
+
spring_kd = spring_kd if spring_kd is not None else self.default_spring_kd
|
|
4039
|
+
particle_radius = particle_radius if particle_radius is not None else self.default_particle_radius
|
|
4040
|
+
|
|
4002
4041
|
num_tris = int(len(indices) / 3)
|
|
4003
4042
|
|
|
4004
4043
|
start_vertex = len(self.particle_q)
|
|
@@ -4076,9 +4115,11 @@ class ModelBuilder:
|
|
|
4076
4115
|
cell_z: float,
|
|
4077
4116
|
mass: float,
|
|
4078
4117
|
jitter: float,
|
|
4079
|
-
radius_mean: float =
|
|
4118
|
+
radius_mean: float = None,
|
|
4080
4119
|
radius_std: float = 0.0,
|
|
4081
4120
|
):
|
|
4121
|
+
radius_mean = radius_mean if radius_mean is not None else self.default_particle_radius
|
|
4122
|
+
|
|
4082
4123
|
rng = np.random.default_rng(42)
|
|
4083
4124
|
for z in range(dim_z):
|
|
4084
4125
|
for y in range(dim_y):
|
|
@@ -4113,11 +4154,11 @@ class ModelBuilder:
|
|
|
4113
4154
|
fix_right: bool = False,
|
|
4114
4155
|
fix_top: bool = False,
|
|
4115
4156
|
fix_bottom: bool = False,
|
|
4116
|
-
tri_ke: float =
|
|
4117
|
-
tri_ka: float =
|
|
4118
|
-
tri_kd: float =
|
|
4119
|
-
tri_drag: float =
|
|
4120
|
-
tri_lift: float =
|
|
4157
|
+
tri_ke: float = None,
|
|
4158
|
+
tri_ka: float = None,
|
|
4159
|
+
tri_kd: float = None,
|
|
4160
|
+
tri_drag: float = None,
|
|
4161
|
+
tri_lift: float = None,
|
|
4121
4162
|
):
|
|
4122
4163
|
"""Helper to create a rectangular tetrahedral FEM grid
|
|
4123
4164
|
|
|
@@ -4144,6 +4185,11 @@ class ModelBuilder:
|
|
|
4144
4185
|
fix_top: Make the top-most edge of particles kinematic
|
|
4145
4186
|
fix_bottom: Make the bottom-most edge of particles kinematic
|
|
4146
4187
|
"""
|
|
4188
|
+
tri_ke = tri_ke if tri_ke is not None else self.default_tri_ke
|
|
4189
|
+
tri_ka = tri_ka if tri_ka is not None else self.default_tri_ka
|
|
4190
|
+
tri_kd = tri_kd if tri_kd is not None else self.default_tri_kd
|
|
4191
|
+
tri_drag = tri_drag if tri_drag is not None else self.default_tri_drag
|
|
4192
|
+
tri_lift = tri_lift if tri_lift is not None else self.default_tri_lift
|
|
4147
4193
|
|
|
4148
4194
|
start_vertex = len(self.particle_q)
|
|
4149
4195
|
|
|
@@ -4235,11 +4281,11 @@ class ModelBuilder:
|
|
|
4235
4281
|
k_mu: float,
|
|
4236
4282
|
k_lambda: float,
|
|
4237
4283
|
k_damp: float,
|
|
4238
|
-
tri_ke: float =
|
|
4239
|
-
tri_ka: float =
|
|
4240
|
-
tri_kd: float =
|
|
4241
|
-
tri_drag: float =
|
|
4242
|
-
tri_lift: float =
|
|
4284
|
+
tri_ke: float = None,
|
|
4285
|
+
tri_ka: float = None,
|
|
4286
|
+
tri_kd: float = None,
|
|
4287
|
+
tri_drag: float = None,
|
|
4288
|
+
tri_lift: float = None,
|
|
4243
4289
|
):
|
|
4244
4290
|
"""Helper to create a tetrahedral model from an input tetrahedral mesh
|
|
4245
4291
|
|
|
@@ -4254,6 +4300,12 @@ class ModelBuilder:
|
|
|
4254
4300
|
k_lambda: The second elastic Lame parameter
|
|
4255
4301
|
k_damp: The damping stiffness
|
|
4256
4302
|
"""
|
|
4303
|
+
tri_ke = tri_ke if tri_ke is not None else self.default_tri_ke
|
|
4304
|
+
tri_ka = tri_ka if tri_ka is not None else self.default_tri_ka
|
|
4305
|
+
tri_kd = tri_kd if tri_kd is not None else self.default_tri_kd
|
|
4306
|
+
tri_drag = tri_drag if tri_drag is not None else self.default_tri_drag
|
|
4307
|
+
tri_lift = tri_lift if tri_lift is not None else self.default_tri_lift
|
|
4308
|
+
|
|
4257
4309
|
num_tets = int(len(indices) / 4)
|
|
4258
4310
|
|
|
4259
4311
|
start_vertex = len(self.particle_q)
|
|
@@ -4344,16 +4396,22 @@ class ModelBuilder:
|
|
|
4344
4396
|
self,
|
|
4345
4397
|
normal=None,
|
|
4346
4398
|
offset=0.0,
|
|
4347
|
-
ke: float =
|
|
4348
|
-
kd: float =
|
|
4349
|
-
kf: float =
|
|
4350
|
-
mu: float =
|
|
4351
|
-
restitution: float =
|
|
4399
|
+
ke: float = None,
|
|
4400
|
+
kd: float = None,
|
|
4401
|
+
kf: float = None,
|
|
4402
|
+
mu: float = None,
|
|
4403
|
+
restitution: float = None,
|
|
4352
4404
|
):
|
|
4353
4405
|
"""
|
|
4354
4406
|
Creates a ground plane for the world. If the normal is not specified,
|
|
4355
4407
|
the up_vector of the ModelBuilder is used.
|
|
4356
4408
|
"""
|
|
4409
|
+
ke = ke if ke is not None else self.default_shape_ke
|
|
4410
|
+
kd = kd if kd is not None else self.default_shape_kd
|
|
4411
|
+
kf = kf if kf is not None else self.default_shape_kf
|
|
4412
|
+
mu = mu if mu is not None else self.default_shape_mu
|
|
4413
|
+
restitution = restitution if restitution is not None else self.default_shape_restitution
|
|
4414
|
+
|
|
4357
4415
|
if normal is None:
|
|
4358
4416
|
normal = self.up_vector
|
|
4359
4417
|
self._ground_params = {
|