Voxel Configuration
See also
The Voxel configuration is mainly developed in Rust and as such has its own documentation.
Voxel configuration tries to minimize the information needed to represent a world with RoFI modules.
For this reason there are some limitations in expresivity of Voxel configuration, which allows for a more space efficient representation and for more efficient algorithms when using this representation:
All modules have to be a Universal module.
All joint values have to be a multiple of 90 degrees.
Modules are not distinguishable.
Shoes of modules and rotations are not distinguishable if they can be mapped to each other.
The configuration is not fixed in space.
These limitations imply that symmetries are baked into the representation.
Contents
Note
The name Voxel comes from the original idea representing the world as a 3D grid of values that are either empty or contain a shoe of a RoFI module.
Since then the representation of the voxel world has shifted and it is no longer stored as a 3D vector of values, but the meaning and name Voxel stayed the same.
Explicit Connections
Voxel world allows specifying explicit connections, but this is not yet reflected in cpp code.
Voxel Configuration in Cpp
The class representing Voxel configuration in cpp
is rofi::voxel::VoxelWorld
.
rofi::voxel::VoxelWorld
can be easily converted to and from
rofi::configuration::RofiWorld
by rofi::voxel::VoxelWorld::toRofiWorld()
and rofi::voxel::VoxelWorld::fromRofiWorld()
respectively.
Note
When converting from rofi::voxel::VoxelWorld
to rofi::configuration::RofiWorld
,
rofi::voxel::VoxelWorld::toRofiWorld()
expects
that the rofi::voxel::VoxelWorld
is connected.
If you want to convert rofi::voxel::VoxelWorld
that
isn’t connected, you can set parameter fixateModulesByOne.
Types, Constants and Support Classes
-
using rofi::voxel::Position = std::array<int, 3>
Classes
-
struct Voxel
This documentation is copy from Rust
voxel::Voxel
Canonized representation:
when
body_dir.is_dir_to_plus
is true, the Voxel is assumed a BodyA otherwise it’s assumed BodyBwhen
shoe_rotated
isfalse
, X-connectors are in the next axisbody_dir.axis
isAxis::X
=> X-connectors are in Y axisbody_dir.axis
isAxis::Y
=> X-connectors are in Z axisbody_dir.axis
isAxis::Z
=> X-connectors are in X axis otherwise X-connectors are in the previous axisbody_dir.axis
isAxis::X
=> X-connectors are in Z axisbody_dir.axis
isAxis::Y
=> X-connectors are in X axisbody_dir.axis
isAxis::Z
=> X-connectors are in Y axis
when
joint_pos
isZero
, the shoe joint is in the zero position whenjoint_pos
isPlus90
the Z-connector is towards the plus axis otherwise the Z-connector is towards the minus axis
Public Functions
-
inline auto getXPlusConnMatrixRotation() const -> rofi::configuration::matrices::Matrix
Public Static Functions
-
static inline auto fromRofiModule(const rofi::configuration::UniversalModule &rofiModule) -> atoms::Result<std::array<Voxel, 2>>
-
static inline auto getConnOrientation(Direction connDirection, Direction connOrientationVector, Direction otherOrientationVector) -> rofi::configuration::roficom::Orientation
-
static inline auto toRofiModule(Voxel shoeA, Voxel shoeB, rofi::configuration::ModuleId moduleId) -> rofi::configuration::UniversalModule
-
struct Connector
-
struct VoxelWorld
Public Functions
-
inline auto toRofiWorld(bool fixateModulesByOne = false) const -> atoms::Result<rofi::configuration::RofiWorld>
Converts
VoxelWorld
torofi::configuration::RofiWorld
.VoxelWorld
should be connected and the resulting RofiWorld will be fixed on one component to the world at the according position.If you want to convert
VoxelWorld
that isn’t connected, you can set fixateModulesByOne.- Parameters
fixateModulesByOne – specifies whether to connect each module to the world separately by a
rofi::configuration::RigidJoint
instead of connecting modules together byrofi::configuration::RoficomJoint
s
-
bool operator==(const VoxelWorld&) const = default
Public Static Functions
-
static inline auto fromRofiWorld(const rofi::configuration::RofiWorld &rofiWorld) -> atoms::Result<VoxelWorld>
Converts
rofi::configuration::RofiWorld
toVoxelWorld
.Requires that:
all the modules are
rofi::configuration::UniversalModule
,all joint values are multiple of 90 degrees,
all positions have to be whole integers.
Note
Does not check if the resulting
VoxelWorld
is connected.
-
inline auto toRofiWorld(bool fixateModulesByOne = false) const -> atoms::Result<rofi::configuration::RofiWorld>