You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
mckay 8940f83fcc Add FeatureSampleConfig class for command line configuration parsing 10 months ago
..
FeatureSample Add FeatureSampleConfig class for command line configuration parsing 10 months ago
ParametricSample init 11 months ago
abc_data init 11 months ago
cmake init 11 months ago
raw_input init 11 months ago
yaml-cpp init 11 months ago
.gitignore Enhance idea.md with new research points and implementation suggestions; add Dockerfile and .gitignore for pre-processing setup 10 months ago
CMakeLists.txt init 11 months ago
Dockerfile Enhance idea.md with new research points and implementation suggestions; add Dockerfile and .gitignore for pre-processing setup 10 months ago
README.md Enhance idea.md with new research points and implementation suggestions; add Dockerfile and .gitignore for pre-processing setup 10 months ago
gen_training_data_mesh.py init 11 months ago
gen_training_data_yaml.py init 11 months ago
load_obj.py init 11 months ago
split_and_gen_fea.py init 11 months ago

README.md

Data pre-processing

Please first download the prepared ABC dataset from BaiduYun or OneDrive, and unzip it under current folder. We split the models with multiple components. There will be 3 items for each model:

*.obj: surface mesh of the model.
*.yml: parametric curve and patch information.
*.fea: curve segments on the mesh. Starts with the number of curve segments n, followed by n lines, where each line contains the two vertex indices of a curve segment. Can be extracted from 'vert_indices' of curves in the *.yml files.

[Optional] If you want to split the models and generate the correponding *.fea files from the raw ABC dataset, please first put the *.yml and *.obj files in folder abc_data (make sure that file in different formats share the same prefix). Install the PyYAML package via:

$ pip install PyYAML

and run:

$ python split_and_gen_fea.py

You will find the split models and *.fea files in raw_input.

Installation

Please first install the Boost and eigen3 library:

$ sudo apt install libboost-all-dev
$ sudo apt install libeigen3-dev

Then run:

$ cd PATH_TO_NH-REP/code/pre_processing
$ mkdir build && cd build
$ cmake ..
$ make

You can generate the training data:

$ cd ..
$ python gen_training_data_yaml.py

The generated training data can be found in training_data folder.

If you do not have a yaml file and want to generate sample points from meshes, you can prepare the *.fea file as sharp feature curves of the meshes, then run:

$ python gen_training_data_mesh.py

Please make sure that you set 'in_path' in gen_training_data_yaml.py and gen_training_data_mesh.py as the path containing the *.fea files.

When patch decomposition is conducted (like model 00007974_5), there will be *fixtree.obj and *fixtree.fea in training_data, which can be used for generating point samples in later round:

$ python gen_training_data_yaml.py -r

or

$ python gen_training_data_mesh.py -r

You can find the generated training data of the decomposed patch in training_data_repair. By default we only decompose one patch and it is enough for most models. But if you find *fixtree.obj and *fixtree.fea in training_data_repair, that means that more patches need to decomposed. There are two ways to achieve this. First, you can copy training_data_repair./*fixtree.obj and training_data_repair./*fixtree.fea to training_data, and re-run 'python gen_training_data_yaml.py -r', until enough patches are decomposed (i.e. *.conf files can be found in training_data_repair). Another way is to decompose all patches at once, to achieve this, simple uncomment the following line in FeatureSample/helper.cpp:

42ae22bf8f/code/pre_processing/FeatureSample/helper.cpp (L722)

After that, rebuild the executable files, and re-run 'python gen_training_data_yaml.py' and 'python gen_training_data_yaml.py -r'. There will be generated training data in training_data_repair.

docker run -it --name brep_processor -v ~/NH-Rep/code/pre_processing:/app brep_pre_processing:v1