metafold 0.15.dev2__tar.gz → 0.16.1__tar.gz

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.
Files changed (35) hide show
  1. {metafold-0.15.dev2 → metafold-0.16.1}/PKG-INFO +1 -1
  2. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/simulation/compression_simulation.py +7 -0
  3. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/simulation/run_experiment.py +6 -0
  4. {metafold-0.15.dev2 → metafold-0.16.1}/metafold.egg-info/PKG-INFO +1 -1
  5. {metafold-0.15.dev2 → metafold-0.16.1}/pyproject.toml +1 -1
  6. {metafold-0.15.dev2 → metafold-0.16.1}/tests/test_compression_simulation.py +14 -0
  7. {metafold-0.15.dev2 → metafold-0.16.1}/LICENSE +0 -0
  8. {metafold-0.15.dev2 → metafold-0.16.1}/README.md +0 -0
  9. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/__init__.py +0 -0
  10. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/api.py +0 -0
  11. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/assets.py +0 -0
  12. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/auth.py +0 -0
  13. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/client.py +0 -0
  14. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/exceptions.py +0 -0
  15. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/jobs.py +0 -0
  16. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/materials.py +0 -0
  17. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/projects.py +0 -0
  18. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/simulation/__init__.py +0 -0
  19. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/simulation/compression_experiment.py +0 -0
  20. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/utils.py +0 -0
  21. {metafold-0.15.dev2 → metafold-0.16.1}/metafold/workflows.py +0 -0
  22. {metafold-0.15.dev2 → metafold-0.16.1}/metafold.egg-info/SOURCES.txt +0 -0
  23. {metafold-0.15.dev2 → metafold-0.16.1}/metafold.egg-info/dependency_links.txt +0 -0
  24. {metafold-0.15.dev2 → metafold-0.16.1}/metafold.egg-info/requires.txt +0 -0
  25. {metafold-0.15.dev2 → metafold-0.16.1}/metafold.egg-info/top_level.txt +0 -0
  26. {metafold-0.15.dev2 → metafold-0.16.1}/setup.cfg +0 -0
  27. {metafold-0.15.dev2 → metafold-0.16.1}/tests/test_assets.py +0 -0
  28. {metafold-0.15.dev2 → metafold-0.16.1}/tests/test_compession_experiment.py +0 -0
  29. {metafold-0.15.dev2 → metafold-0.16.1}/tests/test_jobs.py +0 -0
  30. {metafold-0.15.dev2 → metafold-0.16.1}/tests/test_materials.py +0 -0
  31. {metafold-0.15.dev2 → metafold-0.16.1}/tests/test_projects.py +0 -0
  32. {metafold-0.15.dev2 → metafold-0.16.1}/tests/test_run_experiment.py +0 -0
  33. {metafold-0.15.dev2 → metafold-0.16.1}/tests/test_shear_simulation.py +0 -0
  34. {metafold-0.15.dev2 → metafold-0.16.1}/tests/test_utils.py +0 -0
  35. {metafold-0.15.dev2 → metafold-0.16.1}/tests/test_workflows.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metafold
3
- Version: 0.15.dev2
3
+ Version: 0.16.1
4
4
  Summary: Metafold SDK for Python
5
5
  Author-email: Metafold 3D <info@metafold3d.com>
6
6
  License: Copyright 2024 Metafold 3D
@@ -260,6 +260,9 @@ class ExperimentPistonBase:
260
260
  force_limit: ForceLimit | None = None
261
261
  """Apply condition to jump to zero velocity when the given force is reached."""
262
262
 
263
+ releasable: bool = False
264
+ """Only constrain contact in normal direction if releasable is True."""
265
+
263
266
 
264
267
  @dataclass
265
268
  class ExperimentPistonMesh(ExperimentMesh, ExperimentPistonBase):
@@ -1308,6 +1311,10 @@ class CompressionSimulation:
1308
1311
  "conditionValue": info.part.force_limit.value,
1309
1312
  "conditionAction": "GoToZeroVelocity",
1310
1313
  })
1314
+ if isinstance(info.part, ExperimentPistonBase) and info.part.releasable:
1315
+ kwargs.update({
1316
+ "normal_only": True,
1317
+ })
1311
1318
  rigid_contacts.append(
1312
1319
  Contact(
1313
1320
  type=info.part.contact_type,
@@ -205,6 +205,8 @@ def _build_parts(parts_config: list[dict]) -> list[ExperimentPart]:
205
205
  kwargs["material"] = _resolve_material(entry["material"])
206
206
  if "force_limit" in entry:
207
207
  kwargs["force_limit"] = ForceLimit(**entry["force_limit"])
208
+ if "releasable" in entry:
209
+ kwargs["releasable"] = entry["releasable"]
208
210
  parts.append(ExperimentPistonCylinder(**kwargs))
209
211
 
210
212
  elif part_type == "piston_box":
@@ -219,6 +221,8 @@ def _build_parts(parts_config: list[dict]) -> list[ExperimentPart]:
219
221
  kwargs["material"] = _resolve_material(entry["material"])
220
222
  if "force_limit" in entry:
221
223
  kwargs["force_limit"] = ForceLimit(**entry["force_limit"])
224
+ if "releasable" in entry:
225
+ kwargs["releasable"] = entry["releasable"]
222
226
  parts.append(ExperimentPistonBox(**kwargs))
223
227
 
224
228
  elif part_type == "piston_mesh":
@@ -231,6 +235,8 @@ def _build_parts(parts_config: list[dict]) -> list[ExperimentPart]:
231
235
  kwargs["material"] = _resolve_material(entry["material"])
232
236
  if "force_limit" in entry:
233
237
  kwargs["force_limit"] = ForceLimit(**entry["force_limit"])
238
+ if "releasable" in entry:
239
+ kwargs["releasable"] = entry["releasable"]
234
240
  parts.append(ExperimentPistonMesh(**kwargs))
235
241
 
236
242
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metafold
3
- Version: 0.15.dev2
3
+ Version: 0.16.1
4
4
  Summary: Metafold SDK for Python
5
5
  Author-email: Metafold 3D <info@metafold3d.com>
6
6
  License: Copyright 2024 Metafold 3D
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "metafold"
7
- version = "0.15.dev2"
7
+ version = "0.16.1"
8
8
  authors = [
9
9
  {name = "Metafold 3D", email = "info@metafold3d.com"},
10
10
  ]
@@ -748,6 +748,20 @@ class TestSimConfig:
748
748
  assert contact.find(tag) is not None
749
749
  assert contact.find(tag).text == value
750
750
 
751
+ def test_releasable_contact(self, ply_folder, basic_parts, tmp_path):
752
+ parts = deepcopy(basic_parts)
753
+ parts[0].releasable = True
754
+ sim = CompressionSimulation(
755
+ parts=parts,
756
+ simulation_name="test_sim",
757
+ stl_folder_path=str(ply_folder),
758
+ output_path=str(tmp_path / "out"),
759
+ client=MagicMock(),
760
+ )
761
+ sim.create_sim_config()
762
+ contact = sim.ups.findall("./MaterialProperties/MPM/contact")[0]
763
+ contact.find("normal_only").text == "true"
764
+
751
765
 
752
766
  class TestStressStrainPerPart:
753
767
  """stress-strain runs once per deformable part (not one representative).
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes