raytraverse.mapper¶
SpaceMapper¶
-
class
raytraverse.mapper.
SpaceMapper
(dfile, ptres=1.0, rotation=0.0, tolerance=1.0)[source]¶ Bases:
object
translate between world coordinates and normalized UV space
-
rotation
= None¶ ccw rotation (in degrees) for point grid on plane
- Type
float
-
tolerance
= None¶ tolerance for point search when using point list for area
- Type
float
-
ptres
= None¶ point resolution for area
- Type
float
-
property
pt_kd
¶ point kdtree for spatial queries built at first use
-
property
sf
¶ bbox scale factor
-
property
ptshape
¶ shape of point grid
-
property
npts
¶ number of points
-
property
bbox
¶ boundary frame for translating between coordinates [[xmin ymin zmin] [xmax ymax zmax]]
- Type
np.array
-
_ro_pts
(points, rdir=- 1)[source]¶ rotate points
- Parameters
points (np.ndarray) – world coordinate points of shape (N, 3)
rdir (-1 or 1) –
- rotation direction:
-1 to rotate from uv space 1 to rotate to uvspace
-
uv2pt
(uv)[source]¶ convert UV –> world
- Parameters
uv (np.array) – normalized UV coordinates of shape (N, 2)
- Returns
pt – world xyz coordinates of shape (N, 3)
- Return type
np.array
-
pt2uv
(xyz)[source]¶ convert world –> UV
- Parameters
xyz (np.array) – world xyz coordinates, shape (N, 3)
- Returns
uv – normalized UV coordinates of shape (N, 2)
- Return type
np.array
-
SpaceMapperPt¶
-
class
raytraverse.mapper.
SpaceMapperPt
(dfile, ptres=1.0, rotation=0.0, tolerance=1.0)[source]¶ Bases:
raytraverse.mapper.spacemapper.SpaceMapper
translate between world coordinates and normalized UV space
-
property
sf
¶ bbox scale factor
-
property
ptshape
¶ shape of point grid
-
property
bbox
¶ bounding box
- Type
np.array of shape (3,2)
-
uv2pt
(uv)[source]¶ convert UV –> world
- Parameters
uv (np.array) – normalized UV coordinates of shape (N, 2)
- Returns
pt – world xyz coordinates of shape (N, 3)
- Return type
np.array
-
property
ViewMapper¶
-
class
raytraverse.mapper.
ViewMapper
(dxyz=0.0, 1.0, 0.0, viewangle=360.0, name='view', mtxs=None, imtxs=None)[source]¶ Bases:
object
translate between world and normalized UV space based on direction and view angle
- Parameters
dxyz (tuple, optional) – central view direction
viewangle (float, optional) – if < 180, the horizontal and vertical view angle, if greater, view becomes 360,180
-
property
viewangle
¶ view angle
-
property
ymtx
¶ yaw rotation matrix (to standard z-direction y-up)
-
property
pmtx
¶ pitch rotation matrix (to standard z-direction y-up)
-
property
bbox
¶ bounding box of view
- Type
np.array of shape (2,2)
-
property
sf
¶ bbox scale factor
-
property
ivm
¶ viewmapper for opposite view direction (in case of 360 degree view
-
property
dxyz
¶ (float, float, float) central view direction