differt 0.0.22__tar.gz → 0.0.23__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 (27) hide show
  1. {differt-0.0.22 → differt-0.0.23}/PKG-INFO +2 -2
  2. {differt-0.0.22 → differt-0.0.23}/pyproject.toml +1 -1
  3. {differt-0.0.22 → differt-0.0.23}/src/differt/geometry/triangle_mesh.py +72 -1
  4. {differt-0.0.22 → differt-0.0.23}/src/differt/scene/triangle_scene.py +1 -1
  5. {differt-0.0.22 → differt-0.0.23}/.gitignore +0 -0
  6. {differt-0.0.22 → differt-0.0.23}/LICENSE.md +0 -0
  7. {differt-0.0.22 → differt-0.0.23}/README.md +0 -0
  8. {differt-0.0.22 → differt-0.0.23}/src/differt/__init__.py +0 -0
  9. {differt-0.0.22 → differt-0.0.23}/src/differt/em/__init__.py +0 -0
  10. {differt-0.0.22 → differt-0.0.23}/src/differt/em/constants.py +0 -0
  11. {differt-0.0.22 → differt-0.0.23}/src/differt/em/special.py +0 -0
  12. {differt-0.0.22 → differt-0.0.23}/src/differt/em/utd.py +0 -0
  13. {differt-0.0.22 → differt-0.0.23}/src/differt/em/utils.py +0 -0
  14. {differt-0.0.22 → differt-0.0.23}/src/differt/geometry/__init__.py +0 -0
  15. {differt-0.0.22 → differt-0.0.23}/src/differt/geometry/paths.py +0 -0
  16. {differt-0.0.22 → differt-0.0.23}/src/differt/geometry/utils.py +0 -0
  17. {differt-0.0.22 → differt-0.0.23}/src/differt/plotting/__init__.py +0 -0
  18. {differt-0.0.22 → differt-0.0.23}/src/differt/plotting/_core.py +0 -0
  19. {differt-0.0.22 → differt-0.0.23}/src/differt/plotting/_utils.py +0 -0
  20. {differt-0.0.22 → differt-0.0.23}/src/differt/rt/__init__.py +0 -0
  21. {differt-0.0.22 → differt-0.0.23}/src/differt/rt/fermat.py +0 -0
  22. {differt-0.0.22 → differt-0.0.23}/src/differt/rt/image_method.py +0 -0
  23. {differt-0.0.22 → differt-0.0.23}/src/differt/rt/utils.py +0 -0
  24. {differt-0.0.22 → differt-0.0.23}/src/differt/scene/__init__.py +0 -0
  25. {differt-0.0.22 → differt-0.0.23}/src/differt/scene/sionna.py +0 -0
  26. {differt-0.0.22 → differt-0.0.23}/src/differt/utils.py +0 -0
  27. {differt-0.0.22 → differt-0.0.23}/src/differt/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: DiffeRT
3
- Version: 0.0.22
3
+ Version: 0.0.23
4
4
  Summary: Differentiable Ray Tracing Toolbox for Radio Propagation Simulations
5
5
  Project-URL: Changelog, https://github.com/jeertmans/DiffeRT/releases
6
6
  Project-URL: Documentation, https://eertmans.be/DiffeRT
@@ -21,7 +21,7 @@ Classifier: Topic :: Scientific/Engineering
21
21
  Requires-Python: >=3.10
22
22
  Requires-Dist: beartype>=0.17.2
23
23
  Requires-Dist: chex>=0.1.86
24
- Requires-Dist: differt-core==0.0.22
24
+ Requires-Dist: differt-core==0.0.23
25
25
  Requires-Dist: equinox>=0.11.5
26
26
  Requires-Dist: filelock>=3.15.4
27
27
  Requires-Dist: jax>=0.4.32
@@ -16,7 +16,7 @@ classifiers = [
16
16
  dependencies = [
17
17
  "beartype>=0.17.2",
18
18
  "chex>=0.1.86",
19
- "differt-core==0.0.22",
19
+ "differt-core==0.0.23",
20
20
  "equinox>=0.11.5",
21
21
  "filelock>=3.15.4",
22
22
  "jax>=0.4.32",
@@ -413,7 +413,12 @@ class TriangleMesh(eqx.Module):
413
413
  rotate: Float[ArrayLike, " "] | None = None,
414
414
  ) -> Self:
415
415
  """
416
- Create an plane mesh, made of two triangles.
416
+ Create a plane mesh, made of two triangles.
417
+
418
+ Note:
419
+ The mesh satisfies the guarantees
420
+ expected when setting
421
+ :attr:`assume_quads` to :data:`True`.
417
422
 
418
423
  Args:
419
424
  vertex_a: The center of the plane.
@@ -470,6 +475,72 @@ class TriangleMesh(eqx.Module):
470
475
  triangles = jnp.array([[0, 1, 2], [0, 2, 3]], dtype=int)
471
476
  return cls(vertices=vertices, triangles=triangles)
472
477
 
478
+ @classmethod
479
+ @jaxtyped(
480
+ typechecker=None
481
+ ) # typing.Self is (currently) not compatible with jaxtyping and beartype
482
+ def box(
483
+ cls,
484
+ length: Float[ArrayLike, " "] = 1.0,
485
+ width: Float[ArrayLike, " "] = 1.0,
486
+ height: Float[ArrayLike, " "] = 1.0,
487
+ *,
488
+ with_top: bool = False,
489
+ ) -> Self:
490
+ """
491
+ Create a box mesh, with an optional opening on the top.
492
+
493
+ Note:
494
+ The mesh satisfies the guarantees
495
+ expected when setting
496
+ :attr:`assume_quads` to :data:`True`.
497
+
498
+ Args:
499
+ length: The length of the box (along x-axis).
500
+ width: The width of the box (along y-axis).
501
+ height: The height of the box (along z-axis).
502
+ with_top: Whether the top of part
503
+ of the box is included or not.
504
+
505
+ Returns:
506
+ A new box mesh.
507
+ """
508
+ dx = jnp.array([length * 0.5, 0.0, 0.0])
509
+ dy = jnp.array([0.0, width * 0.5, 0.0])
510
+ dz = jnp.array([0.0, 0.0, height * 0.5])
511
+
512
+ vertices = jnp.stack((
513
+ +dx + dy + dz,
514
+ +dx + dy - dz,
515
+ -dx + dy - dz,
516
+ -dx + dy + dz,
517
+ -dx - dy - dz,
518
+ -dx - dy + dz,
519
+ +dx - dy - dz,
520
+ +dx - dy + dz,
521
+ ))
522
+ triangles = jnp.array(
523
+ [
524
+ [0, 1, 2],
525
+ [0, 2, 3],
526
+ [3, 2, 4],
527
+ [3, 4, 5],
528
+ [5, 4, 6],
529
+ [5, 6, 7],
530
+ [7, 6, 1],
531
+ [7, 1, 0],
532
+ [1, 4, 2], # Bottom
533
+ [1, 6, 4],
534
+ ],
535
+ dtype=int,
536
+ )
537
+ if with_top:
538
+ triangles = jnp.concatenate(
539
+ (triangles, jnp.asarray([[0, 3, 5], [0, 5, 7]])),
540
+ axis=0,
541
+ )
542
+ return cls(vertices=vertices, triangles=triangles)
543
+
473
544
  @property
474
545
  def is_empty(self) -> bool:
475
546
  """Whether this scene has no triangle."""
@@ -544,7 +544,7 @@ class TriangleScene(eqx.Module):
544
544
  candidates, and yield the result as an iterator over paths chunks.
545
545
 
546
546
  Unused if ``path_candidates`` is provided.
547
- path_candidates: An option array of path candidates, see :ref:`path_candidates`.
547
+ path_candidates: An optional array of path candidates, see :ref:`path_candidates`.
548
548
 
549
549
  This is helpful to only generate paths on a subset of the scene.
550
550
 
File without changes
File without changes
File without changes
File without changes
File without changes