-
Notifications
You must be signed in to change notification settings - Fork 17
Hdf5 improvements #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
3b718ee
60f309d
daf138f
f559f0c
6b3baf5
bac0607
dbe4e00
60d8a6e
a1ba1c1
4e8868a
d27df88
426cbee
9ff08b9
e83e84a
35298b1
85e9820
5433a71
e8537f5
290fc67
162fd65
8ea1951
e7a3c45
5db0d4e
413febf
273444d
d4c996b
39889c0
55e002a
99e967b
e5602bb
952c57e
c4e64e0
367f4ba
e018ef7
7a41f0f
95d7c0d
b17dd73
237ddb7
1a6c326
7bb7411
47ed3ad
a24873d
c7143b9
475fa6c
d447d40
86bfbf4
7e54760
5794a4d
b8eeb33
562fa5a
98e1712
9ad66d4
c0b773d
9d08e2c
758b9e5
20fdc74
7d0b1cf
8269dd4
c6fc6fa
acba092
abe3c74
a9d47d1
a641a43
d96acbf
e5863c7
7fc4a33
8507748
9e5e7d3
cbfa656
292b870
914aefc
ba17a9d
3cda43d
69a4f1c
1343f77
7a15675
c76b91d
18957a4
e9df48a
f0cef42
12438d1
c2dea44
cd33f5f
2640dc3
8120ab4
fae86ec
b34b14a
d462316
7ae6a5f
05793b7
e8d4f67
ac94ad1
d58742b
05dd057
d761235
94d7c0a
80cc06c
866d716
c04b2e4
1f7a652
59281bd
92f1eec
835a060
d4012d0
d196c31
db46840
b387a4c
075e55d
6e81854
3d62d8b
612ced3
b6da6f3
43f2dd1
163d991
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,5 @@ | |
*.out | ||
*.app | ||
build/ | ||
|
||
test |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#include "../voxelizer.h" | ||
#include "../writer.h" | ||
#include "../processor.h" | ||
|
||
#include "H5Cpp.h" | ||
#include <gtest/gtest.h> | ||
|
||
#include <BRepBuilderAPI_MakePolygon.hxx> | ||
#include <BRepBuilderAPI_MakeFace.hxx> | ||
#include <BRepPrimAPI_MakeBox.hxx> | ||
#include <BRepPrimAPI_MakeSphere.hxx> | ||
#include <BRep_Builder.hxx> | ||
#include <BRepBndLib.hxx> | ||
#include <Bnd_Box.hxx> | ||
#include <BRepMesh_IncrementalMesh.hxx> | ||
#include <BRepTools.hxx> | ||
|
||
#ifdef WITH_IFC | ||
#include <ifcparse/IfcFile.h> | ||
#ifdef IFCOPENSHELL_05 | ||
#include <ifcgeom/IfcGeomIterator.h> | ||
using namespace Ifc2x3; | ||
#else | ||
#include <ifcgeom_schema_agnostic/IfcGeomIterator.h> | ||
#endif | ||
#endif | ||
|
||
|
||
#ifdef WIN32 | ||
#define DIRSEP "\\" | ||
#else | ||
#define DIRSEP "/" | ||
#endif | ||
|
||
|
||
TEST(HdfFileName, HDF) { | ||
|
||
|
||
BRepPrimAPI_MakeBox mb(gp_Pnt(0, 0, 0), gp_Pnt(10, 10, 10)); | ||
BRepPrimAPI_MakeSphere s(gp_Pnt(10, 10, 10), 7); | ||
|
||
auto x = s.Solid(); | ||
|
||
auto storage2 = new chunked_voxel_storage<bit_t>( 0, 0, 0, 1, 32, 32, 32, 32); | ||
BRepTools breptools; | ||
|
||
breptools.Write(x, "sphere.brep"); | ||
|
||
BRepMesh_IncrementalMesh(x, 0.001); | ||
auto vox = voxelizer(x, storage2); | ||
vox.Convert(); | ||
|
||
auto storage = new chunked_voxel_storage<bit_t>(0., 0., 0., 0.1, 200, 150, 10, 32); | ||
|
||
{ | ||
BRepBuilderAPI_MakePolygon mp(gp_Pnt(1, 1, 2), gp_Pnt(16, 1, 2), gp_Pnt(16, 9.8, 2), gp_Pnt(1, 9.8, 2), true); | ||
BRepBuilderAPI_MakeFace mf(mp.Wire()); | ||
TopoDS_Face face = mf.Face(); | ||
|
||
auto vox = voxelizer(face, storage); | ||
vox.Convert(); | ||
} | ||
|
||
const double dim = 0.1; | ||
auto storage3 = new chunked_voxel_storage<bit_t>(-dim, -dim, -dim, dim, 100, 100, 100, 16); | ||
BRepPrimAPI_MakeBox make_box(8., 8., 8.); | ||
auto vox3 = voxelizer(make_box.Solid(), storage3); | ||
vox3.Convert(); | ||
|
||
hdf_writer writer; | ||
writer.SetVoxels(storage3); | ||
writer.Write("multi_dim_vox.h5"); | ||
|
||
//std::ofstream fs("voxobj.obj"); | ||
//obj_export_helper oeh{ fs }; | ||
//storage2->obj_export(oeh, false, false); | ||
|
||
// Write a 4D dataset | ||
|
||
const H5std_string FILE_NAME("multidim.h5"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does the remainder of this test do? Should we open multi_dim_vox.h5 with RDONLY and check whether the dimensions and ranks of the datasets make sense? Or even better: let's say we compare |
||
const H5std_string DATASET_NAME("continuous_chunks"); | ||
const int NX = 32; // dataset dimensions | ||
const int NY = 32; | ||
const int NZ = 32; | ||
const int NC = 3; | ||
|
||
const int RANK = 4; | ||
H5::H5File file(FILE_NAME, H5F_ACC_TRUNC); | ||
|
||
hsize_t dimsf[4]; // dataset dimensions | ||
dimsf[0] = NC; | ||
dimsf[1] = NX; | ||
dimsf[2] = NY; | ||
dimsf[3] = NZ; | ||
|
||
H5::DataSpace dataspace(RANK, dimsf); | ||
|
||
H5::IntType datatype(H5::PredType::NATIVE_INT); | ||
datatype.setOrder(H5T_ORDER_LE); | ||
|
||
H5::DataSet dataset = file.createDataSet(DATASET_NAME, datatype, dataspace); | ||
|
||
//std::vector<int> data; | ||
|
||
//for (int i = 0; i < NX*NY*NZ*NC; i++) { | ||
// data.push_back(0); | ||
//} | ||
|
||
//dataset.write(data.data(), H5::PredType::NATIVE_INT); | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the time of the 0.5 build script the dir was still called
deps
not_deps
can you change that back?