From dcef947ea986f4ad4633189652abccebdd7aa3f6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 6 Jan 2024 13:03:42 +0000 Subject: Helper to create a cubiod from dimensions --- lib/basicShapes.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lib/basicShapes.h (limited to 'lib/basicShapes.h') diff --git a/lib/basicShapes.h b/lib/basicShapes.h new file mode 100644 index 0000000..183863e --- /dev/null +++ b/lib/basicShapes.h @@ -0,0 +1,19 @@ +#pragma once +#include +#include + +template +constexpr std::array, 8> +cuboidCorners(T lx, T ux, T ly, T uy, T lz, T uz) +{ + return {{ + {lx, uy, lz}, // LFB + {ux, uy, lz}, // RFB + {lx, uy, uz}, // LFT + {ux, uy, uz}, // RFT + {lx, ly, lz}, // LBB + {ux, ly, lz}, // RBB + {lx, ly, uz}, // LBT + {ux, ly, uz}, // RBT + }}; +} -- cgit v1.2.3