From 0fa6be0a7bc8bdae466b79edbd67fc15152b1150 Mon Sep 17 00:00:00 2001 From: Lucas Dower Date: Tue, 22 Mar 2022 21:35:13 +0000 Subject: [PATCH] Fixed voxeliser choice being ignored --- tools/headless-config.ts | 4 ++-- tools/headless.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/headless-config.ts b/tools/headless-config.ts index 98fe4f7..88d4631 100644 --- a/tools/headless-config.ts +++ b/tools/headless-config.ts @@ -3,9 +3,9 @@ export const headlessConfig = { absoluteFilePathLoad: 'C:/Users//Desktop/MyModel.obj', // Must be an absolute path to the file (can be anywhere) }, voxelise: { - voxeliser: 'rb', // 'raybased' / 'ncrb' + voxeliser: 'raybased', // 'raybased' / 'ncrb' voxelMeshParams: { - desiredHeight: 105, // 5-320 inclusive + desiredHeight: 80, // 5-320 inclusive useMultisampleColouring: false, textureFiltering: 'linear', // 'linear' / 'nearest' }, diff --git a/tools/headless.ts b/tools/headless.ts index b93ffa2..7b974ff 100644 --- a/tools/headless.ts +++ b/tools/headless.ts @@ -4,6 +4,7 @@ import { IVoxeliser } from '../src/voxelisers/base-voxeliser'; import { VoxelMesh, VoxelMeshParams } from '../src/voxel_mesh'; import { BlockMesh, BlockMeshParams } from '../src/block_mesh'; import { Exporter, Litematic, Schematic } from '../src/schematic'; +import { RayVoxeliser } from '../src/voxelisers/ray-voxeliser'; import { NormalCorrectedRayVoxeliser } from '../src/voxelisers/normal-corrected-ray-voxeliser'; import { TextureFiltering } from '../src/texture'; import { ColourSpace } from '../src/util'; @@ -15,7 +16,7 @@ void async function main() { absoluteFilePathLoad: headlessConfig.import.absoluteFilePathLoad, }); const voxelMesh = _voxelise(mesh, { - voxeliser: new NormalCorrectedRayVoxeliser(), + voxeliser: headlessConfig.voxelise.voxeliser === 'raybased' ? new RayVoxeliser() : new NormalCorrectedRayVoxeliser(), voxelMeshParams: { desiredHeight: headlessConfig.voxelise.voxelMeshParams.desiredHeight, useMultisampleColouring: headlessConfig.voxelise.voxelMeshParams.useMultisampleColouring,