@@ -378,7 +378,8 @@ def _update_from_bounds(self, bounds: tuple[float, float], axis: Axis) -> Cylind
378
378
379
379
@verify_packages_import (["trimesh" ])
380
380
def _do_intersections_tilted_plane (
381
- self , normal : Coordinate , origin : Coordinate , to_2D : MatrixReal4x4
381
+ self , normal : Coordinate , origin : Coordinate , to_2D : MatrixReal4x4 ,
382
+ transpose : bool = False ,
382
383
) -> list [Shapely ]:
383
384
"""Return a list of shapely geometries at the plane specified by normal and origin.
384
385
@@ -390,6 +391,8 @@ def _do_intersections_tilted_plane(
390
391
Vector defining the plane origin.
391
392
to_2D : MatrixReal4x4
392
393
Transformation matrix to apply to resulting shapes.
394
+ transpose : bool = False
395
+ Optional: Swap coordinates in the plane perpendicular to the normal vector?
393
396
394
397
Returns
395
398
-------
@@ -400,7 +403,7 @@ def _do_intersections_tilted_plane(
400
403
"""
401
404
import trimesh
402
405
403
- z0 , (x0 , y0 ) = self .pop_axis (self .center , self .axis )
406
+ z0 , (x0 , y0 ) = self .pop_axis (self .center , self .axis , transpose = transpose )
404
407
half_length = self .finite_length_axis / 2
405
408
406
409
z_top = z0 + half_length
@@ -442,7 +445,7 @@ def _do_intersections_tilted_plane(
442
445
x = np .hstack ((x_bot , x_top ))
443
446
y = np .hstack ((y_bot , y_top ))
444
447
z = np .hstack ((np .full_like (x_bot , z_bot ), np .full_like (x_top , z_top )))
445
- vertices = np .vstack (self .unpop_axis (z , (x , y ), self .axis )).T
448
+ vertices = np .vstack (self .unpop_axis (z , (x , y ), self .axis , transpose = transpose )).T
446
449
447
450
if x_bot .shape [0 ] == 1 :
448
451
m = 1
0 commit comments