metafold 0.13.2.dev0__py3-none-any.whl → 0.14.dev0__py3-none-any.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.
@@ -245,12 +245,21 @@ class ExperimentParallelepiped(ExperimentPrimitive):
245
245
  return pts.min(axis=0), pts.max(axis=0)
246
246
 
247
247
 
248
+ @dataclass
249
+ class ForceLimit:
250
+ face: str
251
+ value: float
252
+
253
+
248
254
  @dataclass
249
255
  class ExperimentPistonBase:
250
256
  velocity: Optional[list] = field(default_factory=lambda: DEFAULT_PISTON_VELOCITY)
251
257
  contact_type: str = "rigid"
252
258
  mu: float = 0.0
253
259
 
260
+ force_limit: ForceLimit | None = None
261
+ """Apply condition to jump to zero velocity when the given force is reached."""
262
+
254
263
 
255
264
  @dataclass
256
265
  class ExperimentPistonMesh(ExperimentMesh, ExperimentPistonBase):
@@ -1287,6 +1296,13 @@ class CompressionSimulation:
1287
1296
  if info.disabled:
1288
1297
  continue
1289
1298
  if isinstance(info.part, (ExperimentPistonBase, ExperimentSupportBase)):
1299
+ kwargs = {}
1300
+ if isinstance(info.part, ExperimentPistonBase) and info.part.force_limit:
1301
+ kwargs.update({
1302
+ "condition": info.part.force_limit.face,
1303
+ "conditionValue": info.part.force_limit.value,
1304
+ "conditionAction": "GoToZeroVelocity",
1305
+ })
1290
1306
  rigid_contacts.append(
1291
1307
  Contact(
1292
1308
  type=info.part.contact_type,
@@ -1295,6 +1311,7 @@ class CompressionSimulation:
1295
1311
  master_material=info.material_index,
1296
1312
  direction=[1, 1, 1],
1297
1313
  materials=deformable_indices,
1314
+ **kwargs
1298
1315
  )
1299
1316
  )
1300
1317
 
@@ -158,6 +158,7 @@ from metafold.simulation.compression_simulation import (
158
158
  ExperimentPistonBox,
159
159
  ExperimentPistonCylinder,
160
160
  ExperimentPistonMesh,
161
+ ForceLimit,
161
162
  SimulationParameters,
162
163
  WorkflowStep,
163
164
  validate_simulation_parts,
@@ -202,6 +203,8 @@ def _build_parts(parts_config: list[dict]) -> list[ExperimentPart]:
202
203
  kwargs["shape_parameters"] = entry["shape_parameters"]
203
204
  if "material" in entry:
204
205
  kwargs["material"] = _resolve_material(entry["material"])
206
+ if "force_limit" in entry:
207
+ kwargs["force_limit"] = ForceLimit(**entry["force_limit"])
205
208
  parts.append(ExperimentPistonCylinder(**kwargs))
206
209
 
207
210
  elif part_type == "piston_box":
@@ -214,6 +217,8 @@ def _build_parts(parts_config: list[dict]) -> list[ExperimentPart]:
214
217
  kwargs["shape_parameters"] = entry["shape_parameters"]
215
218
  if "material" in entry:
216
219
  kwargs["material"] = _resolve_material(entry["material"])
220
+ if "force_limit" in entry:
221
+ kwargs["force_limit"] = ForceLimit(**entry["force_limit"])
217
222
  parts.append(ExperimentPistonBox(**kwargs))
218
223
 
219
224
  elif part_type == "piston_mesh":
@@ -224,6 +229,8 @@ def _build_parts(parts_config: list[dict]) -> list[ExperimentPart]:
224
229
  kwargs["velocity"] = entry["velocity"]
225
230
  if "material" in entry:
226
231
  kwargs["material"] = _resolve_material(entry["material"])
232
+ if "force_limit" in entry:
233
+ kwargs["force_limit"] = ForceLimit(**entry["force_limit"])
227
234
  parts.append(ExperimentPistonMesh(**kwargs))
228
235
 
229
236
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metafold
3
- Version: 0.13.2.dev0
3
+ Version: 0.14.dev0
4
4
  Summary: Metafold SDK for Python
5
5
  Author-email: Metafold 3D <info@metafold3d.com>
6
6
  License: Copyright 2024 Metafold 3D
@@ -11,10 +11,10 @@ metafold/utils.py,sha256=DnsW1Xr9mLpVHBNdPrdxNLLcjxSNMkWVvr7cH7UTAxY,1174
11
11
  metafold/workflows.py,sha256=Mhv3n3ChUHw1Vaj3q8HNDbOgljn03AF6WslZfXzexsI,7802
12
12
  metafold/simulation/__init__.py,sha256=tUW4PfyWnI6UFvIR__JKUD2FjNTM74fSeKuee7Ewjfo,816
13
13
  metafold/simulation/compression_experiment.py,sha256=kLtX6V4vc_v2l-mJqpkE29TWE-fb6fCudOqhxv1Bz9U,18442
14
- metafold/simulation/compression_simulation.py,sha256=ii1sXxs-z9WxQItjFqZWSBQA_SQv4q5Rpc6vUnE7_Ek,120129
15
- metafold/simulation/run_experiment.py,sha256=iFVKd_ESpLrpU9Mlm5RQ-DQf7fbu2XuyPTr-RG2-Z14,17977
16
- metafold-0.13.2.dev0.dist-info/licenses/LICENSE,sha256=LejZXzGwe9t0Ezk6g0bRmWUuFSI9vQSk1wJAc1NrrhE,1059
17
- metafold-0.13.2.dev0.dist-info/METADATA,sha256=TL4I2rp5EGSCvHzIBc3gRB6baKl2EL5ycgImhaQgE9k,3497
18
- metafold-0.13.2.dev0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
19
- metafold-0.13.2.dev0.dist-info/top_level.txt,sha256=0dvwa2N6gvl2x4T9c62V4MbYD2soFedI6hm3-lWgyew,9
20
- metafold-0.13.2.dev0.dist-info/RECORD,,
14
+ metafold/simulation/compression_simulation.py,sha256=IjkF28SWZOb7o6fnN6wGM_yGly8GabdogoGyOP7WV_w,120727
15
+ metafold/simulation/run_experiment.py,sha256=0afoaFoD9jAZJKQb-cqSaQdgHlRbIbeDMtXWVG0wiY0,18335
16
+ metafold-0.14.dev0.dist-info/licenses/LICENSE,sha256=LejZXzGwe9t0Ezk6g0bRmWUuFSI9vQSk1wJAc1NrrhE,1059
17
+ metafold-0.14.dev0.dist-info/METADATA,sha256=PgN95Z1L9r1vTJzwTyqlGYBPHgFAhkZSfsIziHs6z7E,3495
18
+ metafold-0.14.dev0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
19
+ metafold-0.14.dev0.dist-info/top_level.txt,sha256=0dvwa2N6gvl2x4T9c62V4MbYD2soFedI6hm3-lWgyew,9
20
+ metafold-0.14.dev0.dist-info/RECORD,,