pub enum Subblocks {
Regular {
count: [u32; 3],
subblocks: Array<RegularSubblock>,
mode: Option<SubblockMode>,
},
Freeform {
subblocks: Array<FreeformSubblock>,
},
}
Expand description
Stores sub-blocks of a block model.
Variants§
Regular
Divide each parent block into a regular grid of count
cells. Sub-blocks each covers
a non-overlapping cuboid subset of that grid.
Sub-blocks are described by the parents
and corners
arrays. Those arrays must be the
same length and matching rows in each describe the same sub-block. Each row in parents
is an IJK index on the block model grid. Each row of
corners
is $(i_{min}, j_{min}, k_{min}, i_{max}, j_{max}, k_{max})$, all integers, that
refer to the vertices of the sub-block grid within the parent block. For example:
-
A block with minimum size in the corner of the parent block would be (0, 0, 0, 1, 1, 1).
-
If the
subblock_count
is (5, 5, 3) then a sub-block covering the whole parent would be (0, 0, 0, 5, 5, 3).
Sub-blocks must stay within their parent, must have a non-zero size in all directions, and
should not overlap. Further restrictions can be applied by the mode
field, see
SubblockMode
for details.
Fields
count: [u32; 3]
The sub-block grid size.
Must be greater than zero in all directions. If mode
is octree then these must also
be powers of two but they don’t have to be equal.
subblocks: Array<RegularSubblock>
Array with RegularSubblock
type storing the sub-block parent indices and corners
relative to the sub-block grid within the parent.
mode: Option<SubblockMode>
If present this further restricts the sub-block layout.
Freeform
Divide each parent block into any number and arrangement of non-overlapping cuboid regions.
Sub-blocks are described by the parents
and corners
arrays. Each row in parents
is
an IJK index on the block model grid. Each row of corners
is
$(i_{min}, j_{min}, k_{min}, i_{max}, j_{max}, k_{max})$ in floating-point and relative
to the parent block, running from 0.0 to 1.0 across the parent. For example:
-
A sub-block covering the whole parent will be (0.0, 0.0, 0.0, 1.0, 1.0, 1.0) no matter the size of the parent.
-
A sub-block covering the bottom third of the parent block would be (0.0, 0.0, 0.0, 1.0, 1.0, 0.3333) and one covering the top two-thirds would be (0.0, 0.0, 0.3333, 1.0, 1.0, 1.0), again no matter the size of the parent.
Sub-blocks must stay within their parent, must have a non-zero size in all directions, and shouldn’t overlap.
Fields
subblocks: Array<FreeformSubblock>
Array with FreeformSubblock
type storing the sub-block parent indices and corners
relative to the parent.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Subblocks
impl<'de> Deserialize<'de> for Subblocks
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Subblocks
impl JsonSchema for Subblocks
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read more