From 35b317bf65d868086b92c014127ee4ad7154e533 Mon Sep 17 00:00:00 2001 From: Vamsi Subraveti Date: Mon, 16 Mar 2026 12:42:17 -0500 Subject: [PATCH 1/9] added morphology writing to api. renamed scan path file in cli --- .gitignore | 2 ++ examples/api_example/rve.py | 13 ++++++++++--- examples/cli_example/input.yaml | 2 +- .../{scanPath_ULI => ULI_simple_scanpath} | 0 4 files changed, 13 insertions(+), 4 deletions(-) rename examples/data/scanPathData/{scanPath_ULI => ULI_simple_scanpath} (100%) diff --git a/.gitignore b/.gitignore index 239b377..63342b5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,7 @@ build # other typical case file names *.vti +*morphology.csv + # vscode settings cache .vscode diff --git a/examples/api_example/rve.py b/examples/api_example/rve.py index 1cc6da8..f35f4ee 100644 --- a/examples/api_example/rve.py +++ b/examples/api_example/rve.py @@ -17,6 +17,8 @@ create_grid, compute_porosity, write_vtk, + compute_morphology, + write_morphology ) from raptor.utilities import ScanPathBuilder @@ -31,8 +33,8 @@ # 2. Create path vectors through the representative volume element (RVE) power = 370 velocity = 1.7 -hatch_spacing = 130e-6 -layer_height = 50e-6 +hatch_spacing = 140e-6 +layer_height = 30e-6 rotation = 67 scan_extension = max(max_point - min_point) extra_layers = 0 @@ -80,5 +82,10 @@ # 4. Compute porosity using conic section / superellipse curves for melt pool mask porosity = compute_porosity(grid, path_vectors, melt_pool, jit_warmup=True) -# 5. Write porosity field to .VTI +# 5. Compute morphology +morphology = compute_morphology(porosity, voxel_resolution, ['area', 'equivalent_diameter_area']) +write_morphology(morphology, "rve_morphology.csv") + + +# 6. Write porosity field to .VTI write_vtk(grid.origin, grid.resolution, porosity, "rve.vti") diff --git a/examples/cli_example/input.yaml b/examples/cli_example/input.yaml index 7fa09fb..dcc9d5f 100644 --- a/examples/cli_example/input.yaml +++ b/examples/cli_example/input.yaml @@ -1,5 +1,5 @@ scan_paths: - - "../data/scanPathData/scanPath_ULI" + - "../data/scanPathData/ULI_simple_scanpath" parameters: layer_height: 50.0e-6 # (meters) diff --git a/examples/data/scanPathData/scanPath_ULI b/examples/data/scanPathData/ULI_simple_scanpath similarity index 100% rename from examples/data/scanPathData/scanPath_ULI rename to examples/data/scanPathData/ULI_simple_scanpath From e21eb57a6917c47632b7f5c76973e47d4ccf2b0c Mon Sep 17 00:00:00 2001 From: Vamsi Subraveti Date: Mon, 16 Mar 2026 14:45:47 -0500 Subject: [PATCH 2/9] added complex cli example. --- examples/cli_example/input_multilayer.yaml | 49 +++++++++++++++++++ .../{input.yaml => input_singletrack.yaml} | 4 +- .../data/scanPathData/ULI_layered_scanpath | 49 +++++++++++++++++++ ...LI_simple_scanpath => ULI_single_scanpath} | 2 +- src/raptor/utilities.py | 30 ++++++++++-- 5 files changed, 127 insertions(+), 7 deletions(-) create mode 100644 examples/cli_example/input_multilayer.yaml rename examples/cli_example/{input.yaml => input_singletrack.yaml} (92%) create mode 100644 examples/data/scanPathData/ULI_layered_scanpath rename examples/data/scanPathData/{ULI_simple_scanpath => ULI_single_scanpath} (71%) diff --git a/examples/cli_example/input_multilayer.yaml b/examples/cli_example/input_multilayer.yaml new file mode 100644 index 0000000..3e833c3 --- /dev/null +++ b/examples/cli_example/input_multilayer.yaml @@ -0,0 +1,49 @@ +scan_paths: + - "../data/scanPathData/ULI_layered_scanpath" + +parameters: + layer_height: 50.0e-6 # (meters) + voxel_resolution: 5.0e-6 # (meters) + enable_random_segment_phase: true # Default: true + +melt_pool_data: + width: + type: "time_series" + file_name: "../data/meltPoolData/ULI_v1700_theta0_widths.txt" + nmodes: 50. + scale: 1.0 + + depth: + type: "time_series" + file_name: "../data/meltPoolData/ULI_v1700_theta0_widths.txt" + nmodes: 50. + scale: 0.71 + shape: 1.0 # parabola + + height: + type: "time_series" + file_name: "../data/meltPoolData/ULI_v1700_theta0_widths.txt" + nmodes: 5. + scale: 0.45 + shape: 2.0 # ellipse + + +rve: + min_point: [-750.0e-6, -750.0e-6, -100.0e-6] + max_point: [1250.0e-6, 1250.0e-6, 200.0e-6] + +output: + vtk: + file_name: "ULI_porosity.vti" + morphology: + file_name: "ULI_morphology.csv" + fields: + # - "label" + # - "bbox" + # - "area" + # - "area_bbox" + # - "area_filled" + # - "centroid" + # - "equivalent_diameter_area" + # - "euler_number" + # - "extent" diff --git a/examples/cli_example/input.yaml b/examples/cli_example/input_singletrack.yaml similarity index 92% rename from examples/cli_example/input.yaml rename to examples/cli_example/input_singletrack.yaml index dcc9d5f..9196d69 100644 --- a/examples/cli_example/input.yaml +++ b/examples/cli_example/input_singletrack.yaml @@ -1,5 +1,5 @@ scan_paths: - - "../data/scanPathData/ULI_simple_scanpath" + - "../data/scanPathData/ULI_single_scanpath" parameters: layer_height: 50.0e-6 # (meters) @@ -34,7 +34,7 @@ rve: output: vtk: - file_name: "ULI_porosity.vti" + file_name: "ULI_singletrack.vti" morphology: file_name: "ULI_morphology.csv" fields: diff --git a/examples/data/scanPathData/ULI_layered_scanpath b/examples/data/scanPathData/ULI_layered_scanpath new file mode 100644 index 0000000..1565a7a --- /dev/null +++ b/examples/data/scanPathData/ULI_layered_scanpath @@ -0,0 +1,49 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 -0.000250 -0.000250 0.000000 0.000000 0.000000 +0.000000 0.000750 -0.000250 0.000000 370.000000 1.700000 +1.000000 -0.000250 -0.000110 0.000000 0.000000 0.000000 +0.000000 0.000750 -0.000110 0.000000 370.000000 1.700000 +1.000000 -0.000250 0.000030 0.000000 0.000000 0.000000 +0.000000 0.000750 0.000030 0.000000 370.000000 1.700000 +1.000000 -0.000250 0.000170 0.000000 0.000000 0.000000 +0.000000 0.000750 0.000170 0.000000 370.000000 1.700000 +1.000000 -0.000250 0.000310 0.000000 0.000000 0.000000 +0.000000 0.000750 0.000310 0.000000 370.000000 1.700000 +1.000000 -0.000250 0.000450 0.000000 0.000000 0.000000 +0.000000 0.000750 0.000450 0.000000 370.000000 1.700000 +1.000000 -0.000250 0.000590 0.000000 0.000000 0.000000 +0.000000 0.000750 0.000590 0.000000 370.000000 1.700000 +1.000000 -0.000250 0.000730 0.000000 0.000000 0.000000 +0.000000 0.000750 0.000730 0.000000 370.000000 1.700000 +1.000000 0.000515 -0.000406 0.000050 0.000000 0.000000 +0.000000 0.000906 0.000515 0.000050 370.000000 1.700000 +1.000000 0.000386 -0.000351 0.000050 0.000000 0.000000 +0.000000 0.000777 0.000570 0.000050 370.000000 1.700000 +1.000000 0.000257 -0.000296 0.000050 0.000000 0.000000 +0.000000 0.000648 0.000624 0.000050 370.000000 1.700000 +1.000000 0.000128 -0.000242 0.000050 0.000000 0.000000 +0.000000 0.000519 0.000679 0.000050 370.000000 1.700000 +1.000000 -0.000001 -0.000187 0.000050 0.000000 0.000000 +0.000000 0.000390 0.000734 0.000050 370.000000 1.700000 +1.000000 -0.000129 -0.000132 0.000050 0.000000 0.000000 +0.000000 0.000261 0.000788 0.000050 370.000000 1.700000 +1.000000 -0.000258 -0.000077 0.000050 0.000000 0.000000 +0.000000 0.000132 0.000843 0.000050 370.000000 1.700000 +1.000000 -0.000387 -0.000023 0.000050 0.000000 0.000000 +0.000000 0.000004 0.000898 0.000050 370.000000 1.700000 +1.000000 0.000957 0.000238 0.000100 0.000000 0.000000 +0.000000 0.000262 0.000957 0.000100 370.000000 1.700000 +1.000000 0.000856 0.000140 0.000100 0.000000 0.000000 +0.000000 0.000162 0.000860 0.000100 370.000000 1.700000 +1.000000 0.000756 0.000043 0.000100 0.000000 0.000000 +0.000000 0.000061 0.000762 0.000100 370.000000 1.700000 +1.000000 0.000655 -0.000054 0.000100 0.000000 0.000000 +0.000000 -0.000040 0.000665 0.000100 370.000000 1.700000 +1.000000 0.000554 -0.000151 0.000100 0.000000 0.000000 +0.000000 -0.000140 0.000568 0.000100 370.000000 1.700000 +1.000000 0.000453 -0.000249 0.000100 0.000000 0.000000 +0.000000 -0.000241 0.000471 0.000100 370.000000 1.700000 +1.000000 0.000353 -0.000346 0.000100 0.000000 0.000000 +0.000000 -0.000342 0.000373 0.000100 370.000000 1.700000 +1.000000 0.000252 -0.000443 0.000100 0.000000 0.000000 +0.000000 -0.000443 0.000276 0.000100 370.000000 1.700000 diff --git a/examples/data/scanPathData/ULI_simple_scanpath b/examples/data/scanPathData/ULI_single_scanpath similarity index 71% rename from examples/data/scanPathData/ULI_simple_scanpath rename to examples/data/scanPathData/ULI_single_scanpath index 086960b..407d413 100644 --- a/examples/data/scanPathData/ULI_simple_scanpath +++ b/examples/data/scanPathData/ULI_single_scanpath @@ -1,3 +1,3 @@ Mode X(m) Y(m) Z(m) Power(W) tParam 1 0 0 0 200 0 -0 0.008 0 0 200 1.7 +0 0.008 0 0 200 1.7 \ No newline at end of file diff --git a/src/raptor/utilities.py b/src/raptor/utilities.py index 29d9260..a2e2cc7 100644 --- a/src/raptor/utilities.py +++ b/src/raptor/utilities.py @@ -154,11 +154,16 @@ def process_vectors(self): all_vectors.append(vec) return all_vectors - def write_layers(self, ouput_name): + def write_layers(self, output_name, mode="layers"): """ Writes the generated raw scan paths to text files. - """ + Args: + output_name: Base name for the output files. + mode: "layers" to write separate files for each layer, "all" to write a single file with all layers. + """ + if mode == "all": + all_layers = [] for l_key, (l_start, l_end) in self.layers.items(): if l_start.size == 0: continue @@ -181,13 +186,30 @@ def write_layers(self, ouput_name): for s, e in zip(l_start, l_end) ] - allpaths = np.vstack(se_pairs) + all_paths = np.vstack(se_pairs) + if mode == "all": + all_layers.append(all_paths) + continue header_str = "Mode X(m) Y(m) Z(m) Power(W) tParam" filename = f"{output_name}_layer_{l_key}.txt" np.savetxt( filename, - allpaths, + all_paths, + fmt="%.6f", + delimiter=" ", + header=header_str, + comments="", + ) + print(f"Wrote file {filename}") + + if mode == "all" and all_layers: + all_layers = np.vstack(all_layers) + header_str = "Mode X(m) Y(m) Z(m) Power(W) tParam" + filename = f"{output_name}.txt" + np.savetxt( + filename, + all_layers, fmt="%.6f", delimiter=" ", header=header_str, From bdb4e81801c26fd46d70fa5aed8bdc83c46cfcd7 Mon Sep 17 00:00:00 2001 From: Vamsi Subraveti Date: Mon, 16 Mar 2026 15:29:31 -0500 Subject: [PATCH 3/9] updated some examples and readme. --- README.md | 16 ++++++++++++++-- examples/api_example/rve.py | 11 +++++------ examples/cli_example/input_multilayer.yaml | 11 ++--------- examples/cli_example/input_singletrack.yaml | 11 +---------- 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index b67ff36..0afdfb2 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ The CLI is the simplest way to run a simulation. It is controlled by a single YA 3. **Check Outputs**: * Progress will be printed to the console. * The 3D porosity map is saved to the `.vti` file specified in the config. - * The pore morphology data is saved to the `.csv` file (if configured). + * The pore morphology data is saved to the `.csv` file (if configured -- the CLI examples are set to not output morphology due to large domain bounding boxes). #### CLI Input: The `config.yaml` File @@ -252,7 +252,7 @@ porosity = compute_porosity( ``` #### Step 5: Write Results to a VTK File -Finally, use the write_vtk helper function to save the resulting porosity NumPy array to a .vti file for visualization in tools like ParaView. +Use the write_vtk helper function to save the resulting porosity NumPy array to a .vti file for visualization in tools like ParaView. Note that this .vti will contain 0 for the voxels that are melted, and 1 for unmelted voxels. Paraview's contour feature can be used to isolate the defects within the RVE. ```python from raptor.api import write_vtk @@ -260,6 +260,18 @@ from raptor.api import write_vtk # 5. Write porosity field to .VTI write_vtk(grid.origin, grid.resolution, porosity, "rve.vti") ``` + +#### Step 6: Compute and Write Morphology Descriptors +Finally, optionally use the compute_morphology and write_morphology functions to compute global descriptors such as volume, equivalent diameter, etc. For a full list of possible descriptors, see https://scikit-image.org/docs/stable/api/skimage.measure.html#skimage.measure.regionprops. + +```python +from raptor.api import compute_morphology, write_morphology + +# 6. Compute morphology +morphology = compute_morphology(porosity, voxel_resolution, ['area', 'equivalent_diameter_area']) +write_morphology(morphology, "rve_morphology.csv") +``` + ## References The melt pool measurements in the examples are scans performed in Ti6Al4V from the following study: * Miner, Justin; Narra, Sneha Prabha (2024). Dataset of Melt Pool Variability Measurements for Powder Bed Fusion - Laser Beam of Ti-6Al-4V. Carnegie Mellon University. Dataset. https://doi.org/10.1184/R1/25696293.v1 diff --git a/examples/api_example/rve.py b/examples/api_example/rve.py index f35f4ee..1df607e 100644 --- a/examples/api_example/rve.py +++ b/examples/api_example/rve.py @@ -82,10 +82,9 @@ # 4. Compute porosity using conic section / superellipse curves for melt pool mask porosity = compute_porosity(grid, path_vectors, melt_pool, jit_warmup=True) -# 5. Compute morphology -morphology = compute_morphology(porosity, voxel_resolution, ['area', 'equivalent_diameter_area']) -write_morphology(morphology, "rve_morphology.csv") - - -# 6. Write porosity field to .VTI +# 5. Write porosity field to .VTI write_vtk(grid.origin, grid.resolution, porosity, "rve.vti") + +# 6. Compute morphology +morphology = compute_morphology(porosity, voxel_resolution, ['area', 'equivalent_diameter_area']) +write_morphology(morphology, "rve_morphology.csv") \ No newline at end of file diff --git a/examples/cli_example/input_multilayer.yaml b/examples/cli_example/input_multilayer.yaml index 3e833c3..2f2d209 100644 --- a/examples/cli_example/input_multilayer.yaml +++ b/examples/cli_example/input_multilayer.yaml @@ -38,12 +38,5 @@ output: morphology: file_name: "ULI_morphology.csv" fields: - # - "label" - # - "bbox" - # - "area" - # - "area_bbox" - # - "area_filled" - # - "centroid" - # - "equivalent_diameter_area" - # - "euler_number" - # - "extent" + - "area" + - "equivalent_diameter_area" \ No newline at end of file diff --git a/examples/cli_example/input_singletrack.yaml b/examples/cli_example/input_singletrack.yaml index 9196d69..1ddbbb9 100644 --- a/examples/cli_example/input_singletrack.yaml +++ b/examples/cli_example/input_singletrack.yaml @@ -36,14 +36,5 @@ output: vtk: file_name: "ULI_singletrack.vti" morphology: - file_name: "ULI_morphology.csv" + file_name: fields: - # - "label" - # - "bbox" - # - "area" - # - "area_bbox" - # - "area_filled" - # - "centroid" - # - "equivalent_diameter_area" - # - "euler_number" - # - "extent" From cd9536d32ba15101fd04c8215486977b5ab78c3f Mon Sep 17 00:00:00 2001 From: Vamsi Subraveti Date: Mon, 16 Mar 2026 16:08:26 -0500 Subject: [PATCH 4/9] new rve example and updated readme. --- README.md | 13 ++--- examples/api_example/rve.py | 8 ++- examples/cli_example/input_multilayer.yaml | 2 +- examples/cli_example/input_rve.yaml | 55 +++++++++++++++++++ examples/cli_example/input_singletrack.yaml | 2 +- .../data/scanPathData/ULI_single_scanpath | 2 +- .../rve_layers/ULI_rve_layer_0.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_1.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_10.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_11.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_12.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_13.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_14.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_15.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_16.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_17.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_2.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_3.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_4.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_5.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_6.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_7.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_8.txt | 17 ++++++ .../rve_layers/ULI_rve_layer_9.txt | 17 ++++++ pyproject.toml | 3 +- src/raptor/api.py | 13 ++--- src/raptor/cli.py | 7 +-- 27 files changed, 385 insertions(+), 26 deletions(-) create mode 100644 examples/cli_example/input_rve.yaml create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_0.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_1.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_10.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_11.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_12.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_13.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_14.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_15.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_16.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_17.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_2.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_3.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_4.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_5.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_6.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_7.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_8.txt create mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_9.txt diff --git a/README.md b/README.md index 0afdfb2..253aff4 100644 --- a/README.md +++ b/README.md @@ -34,11 +34,11 @@ RAPTOR requires requires Python 3 (tested with Python 3.8+). The following Pytho ``` * **NumPy**: For numerical operations and array manipulation. - * **Numba**: For JIT compilation and performance acceleration. * **PyYAML**: For reading and parsing YAML configuration files * **VTK**: For writing the output porosity map in `.vti` format * **scikit-image**: For calculating pore morphologies. +* **pandas**: For writing morphology information to .csv You can install all dependencies and Raptor itself by running ```pip install .``` in the cloned Raptor directory. @@ -71,7 +71,7 @@ The CLI is the simplest way to run a simulation. It is controlled by a single YA 3. **Check Outputs**: * Progress will be printed to the console. * The 3D porosity map is saved to the `.vti` file specified in the config. - * The pore morphology data is saved to the `.csv` file (if configured -- the CLI examples are set to not output morphology due to large domain bounding boxes). + * The pore morphology data is saved to the `.csv` file (if configured -- some CLI examples are set to not output morphology due to large domain bounding boxes). #### CLI Input: The `config.yaml` File @@ -126,7 +126,6 @@ output: - "label" - "area" - "equivalent_diameter_area" - - "extent" ``` #### Configuration Details: @@ -153,7 +152,7 @@ output: ### 2. Python Library (API) -For advanced use cases, RAPTOR's core functions can be imported directly into your Python scripts. This allows for programmatic parameter studies, custom workflows, and integration with other tools. An example is provided in examples/api_example/rve.py. +For advanced use cases, RAPTOR's core functions can be imported directly into your Python scripts. This allows for programmatic parameter studies, custom workflows, and integration with other tools. An example is provided in `examples/api_example/rve.py`. The following is a breakdown of the main steps for running a simulation programmatically. @@ -181,8 +180,8 @@ from raptor.utilities import ScanPathBuilder # 2. Create path vectors through the representative volume element (RVE) power = 370 velocity = 1.7 -hatch_spacing = 130e-6 -layer_height = 50e-6 +hatch_spacing = 140e-6 +layer_height = 30e-6 rotation = 67 scan_extension = max(max_point - min_point) extra_layers = 0 @@ -252,7 +251,7 @@ porosity = compute_porosity( ``` #### Step 5: Write Results to a VTK File -Use the write_vtk helper function to save the resulting porosity NumPy array to a .vti file for visualization in tools like ParaView. Note that this .vti will contain 0 for the voxels that are melted, and 1 for unmelted voxels. Paraview's contour feature can be used to isolate the defects within the RVE. +Use the write_vtk helper function to save the resulting porosity NumPy array to a `.vti` file for visualization in tools like ParaView. Note that this `.vti` will contain 0 for the voxels that are melted, and 1 for unmelted voxels. Paraview's contour feature can be used to isolate the defects within the RVE. ```python from raptor.api import write_vtk diff --git a/examples/api_example/rve.py b/examples/api_example/rve.py index 1df607e..27ac603 100644 --- a/examples/api_example/rve.py +++ b/examples/api_example/rve.py @@ -18,7 +18,7 @@ compute_porosity, write_vtk, compute_morphology, - write_morphology + write_morphology, ) from raptor.utilities import ScanPathBuilder @@ -86,5 +86,7 @@ write_vtk(grid.origin, grid.resolution, porosity, "rve.vti") # 6. Compute morphology -morphology = compute_morphology(porosity, voxel_resolution, ['area', 'equivalent_diameter_area']) -write_morphology(morphology, "rve_morphology.csv") \ No newline at end of file +morphology = compute_morphology( + porosity, voxel_resolution, ["area", "equivalent_diameter_area"] +) +write_morphology(morphology, "rve_morphology.csv") diff --git a/examples/cli_example/input_multilayer.yaml b/examples/cli_example/input_multilayer.yaml index 2f2d209..95516ed 100644 --- a/examples/cli_example/input_multilayer.yaml +++ b/examples/cli_example/input_multilayer.yaml @@ -39,4 +39,4 @@ output: file_name: "ULI_morphology.csv" fields: - "area" - - "equivalent_diameter_area" \ No newline at end of file + - "equivalent_diameter_area" diff --git a/examples/cli_example/input_rve.yaml b/examples/cli_example/input_rve.yaml new file mode 100644 index 0000000..8643c07 --- /dev/null +++ b/examples/cli_example/input_rve.yaml @@ -0,0 +1,55 @@ +scan_paths: + - "../data/scanPathData/rve_layers/ULI_rve_layer_0.txt" + - "../data/scanPathData/rve_layers/ULI_rve_layer_1.txt" + - "../data/scanPathData/rve_layers/ULI_rve_layer_2.txt" + - "../data/scanPathData/rve_layers/ULI_rve_layer_3.txt" + - "../data/scanPathData/rve_layers/ULI_rve_layer_4.txt" + - "../data/scanPathData/rve_layers/ULI_rve_layer_5.txt" + - "../data/scanPathData/rve_layers/ULI_rve_layer_6.txt" + - "../data/scanPathData/rve_layers/ULI_rve_layer_7.txt" + - "../data/scanPathData/rve_layers/ULI_rve_layer_8.txt" + - "../data/scanPathData/rve_layers/ULI_rve_layer_9.txt" + - "../data/scanPathData/rve_layers/ULI_rve_layer_10.txt" + - "../data/scanPathData/rve_layers/ULI_rve_layer_11.txt" + - "../data/scanPathData/rve_layers/ULI_rve_layer_12.txt" + - "../data/scanPathData/rve_layers/ULI_rve_layer_13.txt" + +parameters: + layer_height: 50.0e-6 # (meters) + voxel_resolution: 5.0e-6 # (meters) + enable_random_segment_phase: true # Default: true + +melt_pool_data: + width: + type: "time_series" + file_name: "../data/meltPoolData/ULI_v1700_theta0_widths.txt" + nmodes: 50. + scale: 1.0 + + depth: + type: "time_series" + file_name: "../data/meltPoolData/ULI_v1700_theta0_widths.txt" + nmodes: 50. + scale: 0.71 + shape: 1.0 # parabola + + height: + type: "time_series" + file_name: "../data/meltPoolData/ULI_v1700_theta0_widths.txt" + nmodes: 5. + scale: 0.45 + shape: 2.0 # ellipse + + +rve: + min_point: [0.0, 0.0, 0.0] + max_point: [500.0e-6, 500.0e-6, 500.0e-6] + +output: + vtk: + file_name: "ULI_porosity.vti" + morphology: + file_name: "ULI_morphology.csv" + fields: + - "area" + - "equivalent_diameter_area" diff --git a/examples/cli_example/input_singletrack.yaml b/examples/cli_example/input_singletrack.yaml index 1ddbbb9..63c7645 100644 --- a/examples/cli_example/input_singletrack.yaml +++ b/examples/cli_example/input_singletrack.yaml @@ -36,5 +36,5 @@ output: vtk: file_name: "ULI_singletrack.vti" morphology: - file_name: + file_name: fields: diff --git a/examples/data/scanPathData/ULI_single_scanpath b/examples/data/scanPathData/ULI_single_scanpath index 407d413..086960b 100644 --- a/examples/data/scanPathData/ULI_single_scanpath +++ b/examples/data/scanPathData/ULI_single_scanpath @@ -1,3 +1,3 @@ Mode X(m) Y(m) Z(m) Power(W) tParam 1 0 0 0 200 0 -0 0.008 0 0 200 1.7 \ No newline at end of file +0 0.008 0 0 200 1.7 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_0.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_0.txt new file mode 100644 index 0000000..ec9b55c --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_0.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 -0.000250 -0.000250 0.000000 0.000000 0.000000 +0.000000 0.000750 -0.000250 0.000000 370.000000 1.700000 +1.000000 -0.000250 -0.000110 0.000000 0.000000 0.000000 +0.000000 0.000750 -0.000110 0.000000 370.000000 1.700000 +1.000000 -0.000250 0.000030 0.000000 0.000000 0.000000 +0.000000 0.000750 0.000030 0.000000 370.000000 1.700000 +1.000000 -0.000250 0.000170 0.000000 0.000000 0.000000 +0.000000 0.000750 0.000170 0.000000 370.000000 1.700000 +1.000000 -0.000250 0.000310 0.000000 0.000000 0.000000 +0.000000 0.000750 0.000310 0.000000 370.000000 1.700000 +1.000000 -0.000250 0.000450 0.000000 0.000000 0.000000 +0.000000 0.000750 0.000450 0.000000 370.000000 1.700000 +1.000000 -0.000250 0.000590 0.000000 0.000000 0.000000 +0.000000 0.000750 0.000590 0.000000 370.000000 1.700000 +1.000000 -0.000250 0.000730 0.000000 0.000000 0.000000 +0.000000 0.000750 0.000730 0.000000 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_1.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_1.txt new file mode 100644 index 0000000..e8e618f --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_1.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 0.000515 -0.000406 0.000040 0.000000 0.000000 +0.000000 0.000906 0.000515 0.000040 370.000000 1.700000 +1.000000 0.000386 -0.000351 0.000040 0.000000 0.000000 +0.000000 0.000777 0.000570 0.000040 370.000000 1.700000 +1.000000 0.000257 -0.000296 0.000040 0.000000 0.000000 +0.000000 0.000648 0.000624 0.000040 370.000000 1.700000 +1.000000 0.000128 -0.000242 0.000040 0.000000 0.000000 +0.000000 0.000519 0.000679 0.000040 370.000000 1.700000 +1.000000 -0.000001 -0.000187 0.000040 0.000000 0.000000 +0.000000 0.000390 0.000734 0.000040 370.000000 1.700000 +1.000000 -0.000129 -0.000132 0.000040 0.000000 0.000000 +0.000000 0.000261 0.000788 0.000040 370.000000 1.700000 +1.000000 -0.000258 -0.000077 0.000040 0.000000 0.000000 +0.000000 0.000132 0.000843 0.000040 370.000000 1.700000 +1.000000 -0.000387 -0.000023 0.000040 0.000000 0.000000 +0.000000 0.000004 0.000898 0.000040 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_10.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_10.txt new file mode 100644 index 0000000..15da457 --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_10.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 -0.000454 0.000312 0.000400 0.000000 0.000000 +0.000000 0.000188 -0.000454 0.000400 370.000000 1.700000 +1.000000 -0.000347 0.000402 0.000400 0.000000 0.000000 +0.000000 0.000296 -0.000364 0.000400 370.000000 1.700000 +1.000000 -0.000240 0.000492 0.000400 0.000000 0.000000 +0.000000 0.000403 -0.000274 0.000400 370.000000 1.700000 +1.000000 -0.000133 0.000582 0.000400 0.000000 0.000000 +0.000000 0.000510 -0.000184 0.000400 370.000000 1.700000 +1.000000 -0.000025 0.000672 0.000400 0.000000 0.000000 +0.000000 0.000617 -0.000094 0.000400 370.000000 1.700000 +1.000000 0.000082 0.000762 0.000400 0.000000 0.000000 +0.000000 0.000725 -0.000004 0.000400 370.000000 1.700000 +1.000000 0.000189 0.000852 0.000400 0.000000 0.000000 +0.000000 0.000832 0.000086 0.000400 370.000000 1.700000 +1.000000 0.000296 0.000942 0.000400 0.000000 0.000000 +0.000000 0.000939 0.000176 0.000400 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_11.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_11.txt new file mode 100644 index 0000000..4501ee5 --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_11.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 -0.000082 -0.000374 0.000440 0.000000 0.000000 +0.000000 0.000874 -0.000082 0.000440 370.000000 1.700000 +1.000000 -0.000123 -0.000240 0.000440 0.000000 0.000000 +0.000000 0.000833 0.000052 0.000440 370.000000 1.700000 +1.000000 -0.000164 -0.000107 0.000440 0.000000 0.000000 +0.000000 0.000792 0.000186 0.000440 370.000000 1.700000 +1.000000 -0.000205 0.000027 0.000440 0.000000 0.000000 +0.000000 0.000752 0.000320 0.000440 370.000000 1.700000 +1.000000 -0.000246 0.000161 0.000440 0.000000 0.000000 +0.000000 0.000711 0.000454 0.000440 370.000000 1.700000 +1.000000 -0.000287 0.000295 0.000440 0.000000 0.000000 +0.000000 0.000670 0.000587 0.000440 370.000000 1.700000 +1.000000 -0.000328 0.000429 0.000440 0.000000 0.000000 +0.000000 0.000629 0.000721 0.000440 370.000000 1.700000 +1.000000 -0.000368 0.000563 0.000440 0.000000 0.000000 +0.000000 0.000588 0.000855 0.000440 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_12.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_12.txt new file mode 100644 index 0000000..b8025bb --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_12.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 0.000695 -0.000300 0.000480 0.000000 0.000000 +0.000000 0.000800 0.000695 0.000480 370.000000 1.700000 +1.000000 0.000556 -0.000285 0.000480 0.000000 0.000000 +0.000000 0.000660 0.000710 0.000480 370.000000 1.700000 +1.000000 0.000417 -0.000270 0.000480 0.000000 0.000000 +0.000000 0.000521 0.000724 0.000480 370.000000 1.700000 +1.000000 0.000277 -0.000256 0.000480 0.000000 0.000000 +0.000000 0.000382 0.000739 0.000480 370.000000 1.700000 +1.000000 0.000138 -0.000241 0.000480 0.000000 0.000000 +0.000000 0.000243 0.000754 0.000480 370.000000 1.700000 +1.000000 -0.000001 -0.000226 0.000480 0.000000 0.000000 +0.000000 0.000103 0.000768 0.000480 370.000000 1.700000 +1.000000 -0.000140 -0.000212 0.000480 0.000000 0.000000 +0.000000 -0.000036 0.000783 0.000480 370.000000 1.700000 +1.000000 -0.000280 -0.000197 0.000480 0.000000 0.000000 +0.000000 -0.000175 0.000797 0.000480 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_13.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_13.txt new file mode 100644 index 0000000..6d2d2b0 --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_13.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 0.000930 0.000445 0.000520 0.000000 0.000000 +0.000000 0.000055 0.000930 0.000520 370.000000 1.700000 +1.000000 0.000862 0.000322 0.000520 0.000000 0.000000 +0.000000 -0.000013 0.000807 0.000520 370.000000 1.700000 +1.000000 0.000794 0.000200 0.000520 0.000000 0.000000 +0.000000 -0.000081 0.000685 0.000520 370.000000 1.700000 +1.000000 0.000726 0.000078 0.000520 0.000000 0.000000 +0.000000 -0.000149 0.000562 0.000520 370.000000 1.700000 +1.000000 0.000658 -0.000045 0.000520 0.000000 0.000000 +0.000000 -0.000216 0.000440 0.000520 370.000000 1.700000 +1.000000 0.000590 -0.000167 0.000520 0.000000 0.000000 +0.000000 -0.000284 0.000317 0.000520 370.000000 1.700000 +1.000000 0.000522 -0.000290 0.000520 0.000000 0.000000 +0.000000 -0.000352 0.000195 0.000520 370.000000 1.700000 +1.000000 0.000455 -0.000412 0.000520 0.000000 0.000000 +0.000000 -0.000420 0.000073 0.000520 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_14.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_14.txt new file mode 100644 index 0000000..0b02138 --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_14.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 0.000336 0.000952 0.000420 0.000000 0.000000 +0.000000 -0.000452 0.000336 0.000420 370.000000 1.700000 +1.000000 0.000422 0.000842 0.000420 0.000000 0.000000 +0.000000 -0.000366 0.000226 0.000420 370.000000 1.700000 +1.000000 0.000509 0.000731 0.000420 0.000000 0.000000 +0.000000 -0.000279 0.000116 0.000420 370.000000 1.700000 +1.000000 0.000595 0.000621 0.000420 0.000000 0.000000 +0.000000 -0.000193 0.000005 0.000420 370.000000 1.700000 +1.000000 0.000681 0.000511 0.000420 0.000000 0.000000 +0.000000 -0.000107 -0.000105 0.000420 370.000000 1.700000 +1.000000 0.000767 0.000400 0.000420 0.000000 0.000000 +0.000000 -0.000021 -0.000215 0.000420 370.000000 1.700000 +1.000000 0.000853 0.000290 0.000420 0.000000 0.000000 +0.000000 0.000065 -0.000326 0.000420 370.000000 1.700000 +1.000000 0.000940 0.000180 0.000420 0.000000 0.000000 +0.000000 0.000152 -0.000436 0.000420 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_15.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_15.txt new file mode 100644 index 0000000..eb5d14c --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_15.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 -0.000362 0.000604 0.000450 0.000000 0.000000 +0.000000 -0.000104 -0.000362 0.000450 370.000000 1.700000 +1.000000 -0.000227 0.000640 0.000450 0.000000 0.000000 +0.000000 0.000032 -0.000326 0.000450 370.000000 1.700000 +1.000000 -0.000092 0.000676 0.000450 0.000000 0.000000 +0.000000 0.000167 -0.000290 0.000450 370.000000 1.700000 +1.000000 0.000043 0.000712 0.000450 0.000000 0.000000 +0.000000 0.000302 -0.000254 0.000450 370.000000 1.700000 +1.000000 0.000179 0.000748 0.000450 0.000000 0.000000 +0.000000 0.000437 -0.000217 0.000450 370.000000 1.700000 +1.000000 0.000314 0.000785 0.000450 0.000000 0.000000 +0.000000 0.000573 -0.000181 0.000450 370.000000 1.700000 +1.000000 0.000449 0.000821 0.000450 0.000000 0.000000 +0.000000 0.000708 -0.000145 0.000450 370.000000 1.700000 +1.000000 0.000584 0.000857 0.000450 0.000000 0.000000 +0.000000 0.000843 -0.000109 0.000450 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_16.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_16.txt new file mode 100644 index 0000000..47ec9cb --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_16.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 -0.000315 -0.000176 0.000480 0.000000 0.000000 +0.000000 0.000676 -0.000315 0.000480 370.000000 1.700000 +1.000000 -0.000295 -0.000037 0.000480 0.000000 0.000000 +0.000000 0.000695 -0.000176 0.000480 370.000000 1.700000 +1.000000 -0.000276 0.000102 0.000480 0.000000 0.000000 +0.000000 0.000715 -0.000037 0.000480 370.000000 1.700000 +1.000000 -0.000256 0.000240 0.000480 0.000000 0.000000 +0.000000 0.000734 0.000101 0.000480 370.000000 1.700000 +1.000000 -0.000237 0.000379 0.000480 0.000000 0.000000 +0.000000 0.000753 0.000240 0.000480 370.000000 1.700000 +1.000000 -0.000217 0.000518 0.000480 0.000000 0.000000 +0.000000 0.000773 0.000378 0.000480 370.000000 1.700000 +1.000000 -0.000198 0.000656 0.000480 0.000000 0.000000 +0.000000 0.000792 0.000517 0.000480 370.000000 1.700000 +1.000000 -0.000178 0.000795 0.000480 0.000000 0.000000 +0.000000 0.000812 0.000656 0.000480 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_17.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_17.txt new file mode 100644 index 0000000..9445588 --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_17.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 0.000421 -0.000436 0.000510 0.000000 0.000000 +0.000000 0.000936 0.000421 0.000510 370.000000 1.700000 +1.000000 0.000301 -0.000364 0.000510 0.000000 0.000000 +0.000000 0.000816 0.000493 0.000510 370.000000 1.700000 +1.000000 0.000181 -0.000292 0.000510 0.000000 0.000000 +0.000000 0.000696 0.000565 0.000510 370.000000 1.700000 +1.000000 0.000061 -0.000220 0.000510 0.000000 0.000000 +0.000000 0.000576 0.000637 0.000510 370.000000 1.700000 +1.000000 -0.000059 -0.000148 0.000510 0.000000 0.000000 +0.000000 0.000456 0.000709 0.000510 370.000000 1.700000 +1.000000 -0.000179 -0.000076 0.000510 0.000000 0.000000 +0.000000 0.000336 0.000782 0.000510 370.000000 1.700000 +1.000000 -0.000299 -0.000003 0.000510 0.000000 0.000000 +0.000000 0.000216 0.000854 0.000510 370.000000 1.700000 +1.000000 -0.000419 0.000069 0.000510 0.000000 0.000000 +0.000000 0.000096 0.000926 0.000510 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_2.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_2.txt new file mode 100644 index 0000000..f6bfa90 --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_2.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 0.000957 0.000238 0.000080 0.000000 0.000000 +0.000000 0.000262 0.000957 0.000080 370.000000 1.700000 +1.000000 0.000856 0.000140 0.000080 0.000000 0.000000 +0.000000 0.000162 0.000860 0.000080 370.000000 1.700000 +1.000000 0.000756 0.000043 0.000080 0.000000 0.000000 +0.000000 0.000061 0.000762 0.000080 370.000000 1.700000 +1.000000 0.000655 -0.000054 0.000080 0.000000 0.000000 +0.000000 -0.000040 0.000665 0.000080 370.000000 1.700000 +1.000000 0.000554 -0.000151 0.000080 0.000000 0.000000 +0.000000 -0.000140 0.000568 0.000080 370.000000 1.700000 +1.000000 0.000453 -0.000249 0.000080 0.000000 0.000000 +0.000000 -0.000241 0.000471 0.000080 370.000000 1.700000 +1.000000 0.000353 -0.000346 0.000080 0.000000 0.000000 +0.000000 -0.000342 0.000373 0.000080 370.000000 1.700000 +1.000000 0.000252 -0.000443 0.000080 0.000000 0.000000 +0.000000 -0.000443 0.000276 0.000080 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_3.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_3.txt new file mode 100644 index 0000000..75d6a64 --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_3.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 0.000538 0.000896 0.000120 0.000000 0.000000 +0.000000 -0.000396 0.000538 0.000120 370.000000 1.700000 +1.000000 0.000588 0.000765 0.000120 0.000000 0.000000 +0.000000 -0.000346 0.000407 0.000120 370.000000 1.700000 +1.000000 0.000638 0.000635 0.000120 0.000000 0.000000 +0.000000 -0.000296 0.000276 0.000120 370.000000 1.700000 +1.000000 0.000688 0.000504 0.000120 0.000000 0.000000 +0.000000 -0.000245 0.000146 0.000120 370.000000 1.700000 +1.000000 0.000738 0.000373 0.000120 0.000000 0.000000 +0.000000 -0.000195 0.000015 0.000120 370.000000 1.700000 +1.000000 0.000788 0.000242 0.000120 0.000000 0.000000 +0.000000 -0.000145 -0.000116 0.000120 370.000000 1.700000 +1.000000 0.000839 0.000112 0.000120 0.000000 0.000000 +0.000000 -0.000095 -0.000247 0.000120 370.000000 1.700000 +1.000000 0.000889 -0.000019 0.000120 0.000000 0.000000 +0.000000 -0.000045 -0.000377 0.000120 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_4.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_4.txt new file mode 100644 index 0000000..63efd0f --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_4.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 -0.000232 0.000767 0.000160 0.000000 0.000000 +0.000000 -0.000267 -0.000232 0.000160 370.000000 1.700000 +1.000000 -0.000092 0.000762 0.000160 0.000000 0.000000 +0.000000 -0.000127 -0.000237 0.000160 370.000000 1.700000 +1.000000 0.000048 0.000757 0.000160 0.000000 0.000000 +0.000000 0.000013 -0.000242 0.000160 370.000000 1.700000 +1.000000 0.000187 0.000752 0.000160 0.000000 0.000000 +0.000000 0.000153 -0.000247 0.000160 370.000000 1.700000 +1.000000 0.000327 0.000748 0.000160 0.000000 0.000000 +0.000000 0.000293 -0.000252 0.000160 370.000000 1.700000 +1.000000 0.000467 0.000743 0.000160 0.000000 0.000000 +0.000000 0.000432 -0.000257 0.000160 370.000000 1.700000 +1.000000 0.000607 0.000738 0.000160 0.000000 0.000000 +0.000000 0.000572 -0.000262 0.000160 370.000000 1.700000 +1.000000 0.000747 0.000733 0.000160 0.000000 0.000000 +0.000000 0.000712 -0.000266 0.000160 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_5.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_5.txt new file mode 100644 index 0000000..c7deefe --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_5.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 -0.000414 0.000008 0.000200 0.000000 0.000000 +0.000000 0.000492 -0.000414 0.000200 370.000000 1.700000 +1.000000 -0.000355 0.000135 0.000200 0.000000 0.000000 +0.000000 0.000551 -0.000288 0.000200 370.000000 1.700000 +1.000000 -0.000296 0.000262 0.000200 0.000000 0.000000 +0.000000 0.000610 -0.000161 0.000200 370.000000 1.700000 +1.000000 -0.000237 0.000389 0.000200 0.000000 0.000000 +0.000000 0.000669 -0.000034 0.000200 370.000000 1.700000 +1.000000 -0.000178 0.000516 0.000200 0.000000 0.000000 +0.000000 0.000729 0.000093 0.000200 370.000000 1.700000 +1.000000 -0.000119 0.000643 0.000200 0.000000 0.000000 +0.000000 0.000788 0.000220 0.000200 370.000000 1.700000 +1.000000 -0.000059 0.000769 0.000200 0.000000 0.000000 +0.000000 0.000847 0.000347 0.000200 370.000000 1.700000 +1.000000 -0.000000 0.000896 0.000200 0.000000 0.000000 +0.000000 0.000906 0.000474 0.000200 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_6.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_6.txt new file mode 100644 index 0000000..87c4788 --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_6.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 0.000213 -0.000456 0.000240 0.000000 0.000000 +0.000000 0.000956 0.000213 0.000240 370.000000 1.700000 +1.000000 0.000119 -0.000352 0.000240 0.000000 0.000000 +0.000000 0.000862 0.000317 0.000240 370.000000 1.700000 +1.000000 0.000026 -0.000248 0.000240 0.000000 0.000000 +0.000000 0.000769 0.000421 0.000240 370.000000 1.700000 +1.000000 -0.000068 -0.000144 0.000240 0.000000 0.000000 +0.000000 0.000675 0.000525 0.000240 370.000000 1.700000 +1.000000 -0.000162 -0.000040 0.000240 0.000000 0.000000 +0.000000 0.000581 0.000629 0.000240 370.000000 1.700000 +1.000000 -0.000255 0.000064 0.000240 0.000000 0.000000 +0.000000 0.000488 0.000733 0.000240 370.000000 1.700000 +1.000000 -0.000349 0.000168 0.000240 0.000000 0.000000 +0.000000 0.000394 0.000837 0.000240 370.000000 1.700000 +1.000000 -0.000443 0.000272 0.000240 0.000000 0.000000 +0.000000 0.000300 0.000941 0.000240 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_7.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_7.txt new file mode 100644 index 0000000..e6704c1 --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_7.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 0.000886 -0.000060 0.000280 0.000000 0.000000 +0.000000 0.000560 0.000886 0.000280 370.000000 1.700000 +1.000000 0.000753 -0.000106 0.000280 0.000000 0.000000 +0.000000 0.000428 0.000840 0.000280 370.000000 1.700000 +1.000000 0.000621 -0.000151 0.000280 0.000000 0.000000 +0.000000 0.000295 0.000794 0.000280 370.000000 1.700000 +1.000000 0.000488 -0.000197 0.000280 0.000000 0.000000 +0.000000 0.000163 0.000749 0.000280 370.000000 1.700000 +1.000000 0.000356 -0.000242 0.000280 0.000000 0.000000 +0.000000 0.000030 0.000703 0.000280 370.000000 1.700000 +1.000000 0.000224 -0.000288 0.000280 0.000000 0.000000 +0.000000 -0.000102 0.000658 0.000280 370.000000 1.700000 +1.000000 0.000091 -0.000333 0.000280 0.000000 0.000000 +0.000000 -0.000234 0.000612 0.000280 370.000000 1.700000 +1.000000 -0.000041 -0.000379 0.000280 0.000000 0.000000 +0.000000 -0.000367 0.000566 0.000280 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_8.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_8.txt new file mode 100644 index 0000000..15d09bf --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_8.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 0.000784 0.000714 0.000320 0.000000 0.000000 +0.000000 -0.000214 0.000784 0.000320 370.000000 1.700000 +1.000000 0.000774 0.000574 0.000320 0.000000 0.000000 +0.000000 -0.000224 0.000644 0.000320 370.000000 1.700000 +1.000000 0.000764 0.000435 0.000320 0.000000 0.000000 +0.000000 -0.000233 0.000504 0.000320 370.000000 1.700000 +1.000000 0.000754 0.000295 0.000320 0.000000 0.000000 +0.000000 -0.000243 0.000365 0.000320 370.000000 1.700000 +1.000000 0.000745 0.000155 0.000320 0.000000 0.000000 +0.000000 -0.000253 0.000225 0.000320 370.000000 1.700000 +1.000000 0.000735 0.000016 0.000320 0.000000 0.000000 +0.000000 -0.000263 0.000085 0.000320 370.000000 1.700000 +1.000000 0.000725 -0.000124 0.000320 0.000000 0.000000 +0.000000 -0.000272 -0.000054 0.000320 370.000000 1.700000 +1.000000 0.000715 -0.000264 0.000320 0.000000 0.000000 +0.000000 -0.000282 -0.000194 0.000320 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_9.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_9.txt new file mode 100644 index 0000000..2f96f40 --- /dev/null +++ b/examples/data/scanPathData/rve_layers/ULI_rve_layer_9.txt @@ -0,0 +1,17 @@ +Mode X(m) Y(m) Z(m) Power(W) tParam +1.000000 0.000031 0.000922 0.000360 0.000000 0.000000 +0.000000 -0.000422 0.000031 0.000360 370.000000 1.700000 +1.000000 0.000156 0.000859 0.000360 0.000000 0.000000 +0.000000 -0.000298 -0.000032 0.000360 370.000000 1.700000 +1.000000 0.000281 0.000795 0.000360 0.000000 0.000000 +0.000000 -0.000173 -0.000096 0.000360 370.000000 1.700000 +1.000000 0.000406 0.000732 0.000360 0.000000 0.000000 +0.000000 -0.000048 -0.000159 0.000360 370.000000 1.700000 +1.000000 0.000530 0.000668 0.000360 0.000000 0.000000 +0.000000 0.000076 -0.000223 0.000360 370.000000 1.700000 +1.000000 0.000655 0.000605 0.000360 0.000000 0.000000 +0.000000 0.000201 -0.000286 0.000360 370.000000 1.700000 +1.000000 0.000780 0.000541 0.000360 0.000000 0.000000 +0.000000 0.000326 -0.000350 0.000360 370.000000 1.700000 +1.000000 0.000905 0.000478 0.000360 0.000000 0.000000 +0.000000 0.000451 -0.000413 0.000360 370.000000 1.700000 diff --git a/pyproject.toml b/pyproject.toml index 20caf4e..6f959fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,8 @@ dependencies = [ "PyYAML", "vtk", "scikit-image", - "pytest" + "pytest", + "pandas" ] [project.scripts] diff --git a/src/raptor/api.py b/src/raptor/api.py index 6436607..f2f53a5 100644 --- a/src/raptor/api.py +++ b/src/raptor/api.py @@ -11,6 +11,7 @@ import time from typing import List, Tuple, Optional, Dict, Any import numpy as np +import pandas as pd import vtk from vtk.util import numpy_support from skimage import measure @@ -251,7 +252,7 @@ def compute_morphology( filtered_defects = remove_small_objects(labeled_defects, minsize) return measure.regionprops_table( - filtered_defects, spacing=voxel_resolution, properties=morphology_fields + labeled_defects, spacing=voxel_resolution, properties=morphology_fields ) @@ -259,15 +260,11 @@ def write_morphology(properties: dict, morphology_output_path: str) -> None: """ Writes morphology output as a .csv. """ - columns = ",".join([key for key in properties.keys()]) - morphology = np.vstack([properties[key] for key in properties.keys()]).transpose() - - np.savetxt( - morphology_output_path, morphology, header=columns, delimiter=",", comments="" - ) + morphology_df = pd.DataFrame(properties, index=None) + morphology_df.to_csv(morphology_output_path, index=False) print( - f"Morphology features of {morphology.shape[0]} " + f"Morphology features of {len(morphology_df)} " f"defects written to: {morphology_output_path}" ) diff --git a/src/raptor/cli.py b/src/raptor/cli.py index dbbf1b2..43642b8 100644 --- a/src/raptor/cli.py +++ b/src/raptor/cli.py @@ -201,11 +201,10 @@ def main() -> int: # write morphology metrics (optional) if morphology_fields: - write_morphology - ( - compute_morphology(porosity, voxel_resolution, morphology_fields), - morphology_file, + defect_morphologies = compute_morphology( + porosity, voxel_resolution, morphology_fields ) + write_morphology(defect_morphologies, morphology_file) except FileNotFoundError as e: print(f"Error: {e}") From 0122390c7990d5d51610f18e594d1fe4f4491136 Mon Sep 17 00:00:00 2001 From: Vamsi Subraveti Date: Mon, 16 Mar 2026 16:10:24 -0500 Subject: [PATCH 5/9] readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 253aff4..079a80d 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ This project is licensed under the BSD 3-Clause [License](LICENSE). RAPTOR requires requires Python 3 (tested with Python 3.8+). The following Python packages are necessary: ```bash - numpy, numba, pyyaml, vtk, scikit-image + numpy, numba, pyyaml, vtk, scikit-image, pandas ``` * **NumPy**: For numerical operations and array manipulation. From 8d254f878c4959d3df9fcd3783a4df9d1f5e5bc3 Mon Sep 17 00:00:00 2001 From: Vamsi Subraveti Date: Tue, 17 Mar 2026 14:26:37 -0500 Subject: [PATCH 6/9] cleaned up revisions --- README.md | 35 ++++++++---- examples/api_example/rve.py | 4 ++ .../{input_singletrack.yaml => input.yaml} | 0 examples/cli_example/input_multilayer.yaml | 42 -------------- examples/cli_example/input_rve.yaml | 55 ------------------- .../data/scanPathData/ULI_layered_scanpath | 49 ----------------- .../rve_layers/ULI_rve_layer_0.txt | 17 ------ .../rve_layers/ULI_rve_layer_1.txt | 17 ------ .../rve_layers/ULI_rve_layer_10.txt | 17 ------ .../rve_layers/ULI_rve_layer_11.txt | 17 ------ .../rve_layers/ULI_rve_layer_12.txt | 17 ------ .../rve_layers/ULI_rve_layer_13.txt | 17 ------ .../rve_layers/ULI_rve_layer_14.txt | 17 ------ .../rve_layers/ULI_rve_layer_15.txt | 17 ------ .../rve_layers/ULI_rve_layer_16.txt | 17 ------ .../rve_layers/ULI_rve_layer_17.txt | 17 ------ .../rve_layers/ULI_rve_layer_2.txt | 17 ------ .../rve_layers/ULI_rve_layer_3.txt | 17 ------ .../rve_layers/ULI_rve_layer_4.txt | 17 ------ .../rve_layers/ULI_rve_layer_5.txt | 17 ------ .../rve_layers/ULI_rve_layer_6.txt | 17 ------ .../rve_layers/ULI_rve_layer_7.txt | 17 ------ .../rve_layers/ULI_rve_layer_8.txt | 17 ------ .../rve_layers/ULI_rve_layer_9.txt | 17 ------ pyproject.toml | 3 +- src/raptor/api.py | 35 ++++++++++++ 26 files changed, 65 insertions(+), 464 deletions(-) rename examples/cli_example/{input_singletrack.yaml => input.yaml} (100%) delete mode 100644 examples/cli_example/input_multilayer.yaml delete mode 100644 examples/cli_example/input_rve.yaml delete mode 100644 examples/data/scanPathData/ULI_layered_scanpath delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_0.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_1.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_10.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_11.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_12.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_13.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_14.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_15.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_16.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_17.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_2.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_3.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_4.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_5.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_6.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_7.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_8.txt delete mode 100644 examples/data/scanPathData/rve_layers/ULI_rve_layer_9.txt diff --git a/README.md b/README.md index 079a80d..8b57002 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ This project is licensed under the BSD 3-Clause [License](LICENSE). RAPTOR requires requires Python 3 (tested with Python 3.8+). The following Python packages are necessary: ```bash - numpy, numba, pyyaml, vtk, scikit-image, pandas + numpy, numba, pyyaml, vtk, scikit-image, pandas, pyvista ``` * **NumPy**: For numerical operations and array manipulation. @@ -39,6 +39,7 @@ RAPTOR requires requires Python 3 (tested with Python 3.8+). The following Pytho * **VTK**: For writing the output porosity map in `.vti` format * **scikit-image**: For calculating pore morphologies. * **pandas**: For writing morphology information to .csv +* **pyvista**: For visualization of `.vti` results. You can install all dependencies and Raptor itself by running ```pip install .``` in the cloned Raptor directory. @@ -55,29 +56,29 @@ The project is organized into several modules: * `io.py`: Contains functions for reading and parsing input files (scan paths, melt pool data). * `utilities.py`: Includes helper classes, such as the `ScanPathBuilder` for generating scan strategies. -RAPTOR can be used in two primary ways: through its Command-Line Interface (CLI) for quick, configuration-driven simulations, or as a Python Library (API) for integration into custom scripts and more complex workflows. +RAPTOR can be used in two primary ways: through its Command-Line Interface (CLI) for quick, configuration-driven simulations, or as a Python Library (API) for integration into custom scripts and simulation workflows. ### 1. Command-Line Interface (CLI) -The CLI is the simplest way to run a simulation. It is controlled by a single YAML configuration file that defines all inputs, parameters, and outputs. +The CLI usage requires scan path files corresponding to build information. These scan path files can be generated with the `ScanPathBuilder` class in `raptor.utilities`. The CLI is controlled by a single YAML input file that defines all inputs, parameters, and outputs. The CLI example contains a single scan path to show functionality and observe the fluctuations of the simulated melt pool. The API example is recommended for a more descriptive simulation of undermelting-induced defects. **How to Run (CLI):** -1. **Prepare Inputs**: Create scan path files, melt pool data files, and a `config.yaml` file (detailed below). +1. **Prepare Inputs**: Create scan path files, melt pool data files, and a `input.yaml` file (detailed below). 2. **Execute Script**: Run the following command from your terminal, providing the path to your configuration file: ```bash - raptor path/to/your/config.yaml + raptor path/to/your/input.yaml ``` 3. **Check Outputs**: * Progress will be printed to the console. * The 3D porosity map is saved to the `.vti` file specified in the config. - * The pore morphology data is saved to the `.csv` file (if configured -- some CLI examples are set to not output morphology due to large domain bounding boxes). + * The pore morphology data is saved to the `.csv` file (if configured -- the example does not save the morphology information.). -#### CLI Input: The `config.yaml` File +#### CLI Input: The `input.yaml` File -Running RAPTOR from the CLI requires a YAML configuration file to specify all parameters. +Running RAPTOR from the CLI requires a YAML input file to specify all parameters. -**Example `config.yaml`:** +**Example `input.yaml`:** ```yaml # List of scan path files (relative to this config file's location) scan_paths: @@ -146,13 +147,15 @@ output: 0 0.001 0.0001 0.000 200 0.8 ``` + * The RVE min and max points *filter the scan paths for those that are near* the box defined by `min_point` and `max_point`; a large number of scan path files (such as from a part-scale build) can be downselected using this parameter setting. + * **Melt Pool Data Files**: These files provide the data for the `melt_pool_data` section of the config. * If `type: "time_series"`, the file should be a two-column text or CSV file: `[time, value]`. * If `type: "spectral_components"`, the file should be a three-column text or CSV file: `[amplitude, frequency, phase]`. ### 2. Python Library (API) -For advanced use cases, RAPTOR's core functions can be imported directly into your Python scripts. This allows for programmatic parameter studies, custom workflows, and integration with other tools. An example is provided in `examples/api_example/rve.py`. +The API allows for programmatic parameter studies, custom workflows, and integration with other tools. The core functionality of RAPTOR can be called by scripting with the API library. An example is provided in `examples/api_example/rve.py`, which is an RVE simulation of defects in 500µm edge length cube. The following is a breakdown of the main steps for running a simulation programmatically. @@ -261,7 +264,7 @@ write_vtk(grid.origin, grid.resolution, porosity, "rve.vti") ``` #### Step 6: Compute and Write Morphology Descriptors -Finally, optionally use the compute_morphology and write_morphology functions to compute global descriptors such as volume, equivalent diameter, etc. For a full list of possible descriptors, see https://scikit-image.org/docs/stable/api/skimage.measure.html#skimage.measure.regionprops. +Optionally use the `compute_morphology` and `write_morphology` functions to compute global descriptors such as volume, equivalent diameter, etc. For a full list of possible descriptors, see https://scikit-image.org/docs/stable/api/skimage.measure.html#skimage.measure.regionprops. ```python from raptor.api import compute_morphology, write_morphology @@ -270,6 +273,16 @@ from raptor.api import compute_morphology, write_morphology morphology = compute_morphology(porosity, voxel_resolution, ['area', 'equivalent_diameter_area']) write_morphology(morphology, "rve_morphology.csv") ``` +#### Step 7: Visualize the Output +Optionally use the `visualize` function to open an interactive window via `pyvista`. To perform more advanced visualizations, the output `.vti` file needs to be contoured to isolate the unmelted voxels (value 1) from the melted voxels (value 0). This contouring is automatically performed in `visualize`. The default scaling converts meters to microns for cleaner labeling in the interactive plot, but the scaling argument can be user-assigned. + +```python +from raptor.api import visualize + +#7. Visualize using PyVista +visualize("./rve.vti") +``` + ## References The melt pool measurements in the examples are scans performed in Ti6Al4V from the following study: diff --git a/examples/api_example/rve.py b/examples/api_example/rve.py index 27ac603..8f5cb2a 100644 --- a/examples/api_example/rve.py +++ b/examples/api_example/rve.py @@ -19,6 +19,7 @@ write_vtk, compute_morphology, write_morphology, + visualize, ) from raptor.utilities import ScanPathBuilder @@ -90,3 +91,6 @@ porosity, voxel_resolution, ["area", "equivalent_diameter_area"] ) write_morphology(morphology, "rve_morphology.csv") + +# 7. Visualize using PyVista +visualize("./rve.vti") diff --git a/examples/cli_example/input_singletrack.yaml b/examples/cli_example/input.yaml similarity index 100% rename from examples/cli_example/input_singletrack.yaml rename to examples/cli_example/input.yaml diff --git a/examples/cli_example/input_multilayer.yaml b/examples/cli_example/input_multilayer.yaml deleted file mode 100644 index 95516ed..0000000 --- a/examples/cli_example/input_multilayer.yaml +++ /dev/null @@ -1,42 +0,0 @@ -scan_paths: - - "../data/scanPathData/ULI_layered_scanpath" - -parameters: - layer_height: 50.0e-6 # (meters) - voxel_resolution: 5.0e-6 # (meters) - enable_random_segment_phase: true # Default: true - -melt_pool_data: - width: - type: "time_series" - file_name: "../data/meltPoolData/ULI_v1700_theta0_widths.txt" - nmodes: 50. - scale: 1.0 - - depth: - type: "time_series" - file_name: "../data/meltPoolData/ULI_v1700_theta0_widths.txt" - nmodes: 50. - scale: 0.71 - shape: 1.0 # parabola - - height: - type: "time_series" - file_name: "../data/meltPoolData/ULI_v1700_theta0_widths.txt" - nmodes: 5. - scale: 0.45 - shape: 2.0 # ellipse - - -rve: - min_point: [-750.0e-6, -750.0e-6, -100.0e-6] - max_point: [1250.0e-6, 1250.0e-6, 200.0e-6] - -output: - vtk: - file_name: "ULI_porosity.vti" - morphology: - file_name: "ULI_morphology.csv" - fields: - - "area" - - "equivalent_diameter_area" diff --git a/examples/cli_example/input_rve.yaml b/examples/cli_example/input_rve.yaml deleted file mode 100644 index 8643c07..0000000 --- a/examples/cli_example/input_rve.yaml +++ /dev/null @@ -1,55 +0,0 @@ -scan_paths: - - "../data/scanPathData/rve_layers/ULI_rve_layer_0.txt" - - "../data/scanPathData/rve_layers/ULI_rve_layer_1.txt" - - "../data/scanPathData/rve_layers/ULI_rve_layer_2.txt" - - "../data/scanPathData/rve_layers/ULI_rve_layer_3.txt" - - "../data/scanPathData/rve_layers/ULI_rve_layer_4.txt" - - "../data/scanPathData/rve_layers/ULI_rve_layer_5.txt" - - "../data/scanPathData/rve_layers/ULI_rve_layer_6.txt" - - "../data/scanPathData/rve_layers/ULI_rve_layer_7.txt" - - "../data/scanPathData/rve_layers/ULI_rve_layer_8.txt" - - "../data/scanPathData/rve_layers/ULI_rve_layer_9.txt" - - "../data/scanPathData/rve_layers/ULI_rve_layer_10.txt" - - "../data/scanPathData/rve_layers/ULI_rve_layer_11.txt" - - "../data/scanPathData/rve_layers/ULI_rve_layer_12.txt" - - "../data/scanPathData/rve_layers/ULI_rve_layer_13.txt" - -parameters: - layer_height: 50.0e-6 # (meters) - voxel_resolution: 5.0e-6 # (meters) - enable_random_segment_phase: true # Default: true - -melt_pool_data: - width: - type: "time_series" - file_name: "../data/meltPoolData/ULI_v1700_theta0_widths.txt" - nmodes: 50. - scale: 1.0 - - depth: - type: "time_series" - file_name: "../data/meltPoolData/ULI_v1700_theta0_widths.txt" - nmodes: 50. - scale: 0.71 - shape: 1.0 # parabola - - height: - type: "time_series" - file_name: "../data/meltPoolData/ULI_v1700_theta0_widths.txt" - nmodes: 5. - scale: 0.45 - shape: 2.0 # ellipse - - -rve: - min_point: [0.0, 0.0, 0.0] - max_point: [500.0e-6, 500.0e-6, 500.0e-6] - -output: - vtk: - file_name: "ULI_porosity.vti" - morphology: - file_name: "ULI_morphology.csv" - fields: - - "area" - - "equivalent_diameter_area" diff --git a/examples/data/scanPathData/ULI_layered_scanpath b/examples/data/scanPathData/ULI_layered_scanpath deleted file mode 100644 index 1565a7a..0000000 --- a/examples/data/scanPathData/ULI_layered_scanpath +++ /dev/null @@ -1,49 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 -0.000250 -0.000250 0.000000 0.000000 0.000000 -0.000000 0.000750 -0.000250 0.000000 370.000000 1.700000 -1.000000 -0.000250 -0.000110 0.000000 0.000000 0.000000 -0.000000 0.000750 -0.000110 0.000000 370.000000 1.700000 -1.000000 -0.000250 0.000030 0.000000 0.000000 0.000000 -0.000000 0.000750 0.000030 0.000000 370.000000 1.700000 -1.000000 -0.000250 0.000170 0.000000 0.000000 0.000000 -0.000000 0.000750 0.000170 0.000000 370.000000 1.700000 -1.000000 -0.000250 0.000310 0.000000 0.000000 0.000000 -0.000000 0.000750 0.000310 0.000000 370.000000 1.700000 -1.000000 -0.000250 0.000450 0.000000 0.000000 0.000000 -0.000000 0.000750 0.000450 0.000000 370.000000 1.700000 -1.000000 -0.000250 0.000590 0.000000 0.000000 0.000000 -0.000000 0.000750 0.000590 0.000000 370.000000 1.700000 -1.000000 -0.000250 0.000730 0.000000 0.000000 0.000000 -0.000000 0.000750 0.000730 0.000000 370.000000 1.700000 -1.000000 0.000515 -0.000406 0.000050 0.000000 0.000000 -0.000000 0.000906 0.000515 0.000050 370.000000 1.700000 -1.000000 0.000386 -0.000351 0.000050 0.000000 0.000000 -0.000000 0.000777 0.000570 0.000050 370.000000 1.700000 -1.000000 0.000257 -0.000296 0.000050 0.000000 0.000000 -0.000000 0.000648 0.000624 0.000050 370.000000 1.700000 -1.000000 0.000128 -0.000242 0.000050 0.000000 0.000000 -0.000000 0.000519 0.000679 0.000050 370.000000 1.700000 -1.000000 -0.000001 -0.000187 0.000050 0.000000 0.000000 -0.000000 0.000390 0.000734 0.000050 370.000000 1.700000 -1.000000 -0.000129 -0.000132 0.000050 0.000000 0.000000 -0.000000 0.000261 0.000788 0.000050 370.000000 1.700000 -1.000000 -0.000258 -0.000077 0.000050 0.000000 0.000000 -0.000000 0.000132 0.000843 0.000050 370.000000 1.700000 -1.000000 -0.000387 -0.000023 0.000050 0.000000 0.000000 -0.000000 0.000004 0.000898 0.000050 370.000000 1.700000 -1.000000 0.000957 0.000238 0.000100 0.000000 0.000000 -0.000000 0.000262 0.000957 0.000100 370.000000 1.700000 -1.000000 0.000856 0.000140 0.000100 0.000000 0.000000 -0.000000 0.000162 0.000860 0.000100 370.000000 1.700000 -1.000000 0.000756 0.000043 0.000100 0.000000 0.000000 -0.000000 0.000061 0.000762 0.000100 370.000000 1.700000 -1.000000 0.000655 -0.000054 0.000100 0.000000 0.000000 -0.000000 -0.000040 0.000665 0.000100 370.000000 1.700000 -1.000000 0.000554 -0.000151 0.000100 0.000000 0.000000 -0.000000 -0.000140 0.000568 0.000100 370.000000 1.700000 -1.000000 0.000453 -0.000249 0.000100 0.000000 0.000000 -0.000000 -0.000241 0.000471 0.000100 370.000000 1.700000 -1.000000 0.000353 -0.000346 0.000100 0.000000 0.000000 -0.000000 -0.000342 0.000373 0.000100 370.000000 1.700000 -1.000000 0.000252 -0.000443 0.000100 0.000000 0.000000 -0.000000 -0.000443 0.000276 0.000100 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_0.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_0.txt deleted file mode 100644 index ec9b55c..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_0.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 -0.000250 -0.000250 0.000000 0.000000 0.000000 -0.000000 0.000750 -0.000250 0.000000 370.000000 1.700000 -1.000000 -0.000250 -0.000110 0.000000 0.000000 0.000000 -0.000000 0.000750 -0.000110 0.000000 370.000000 1.700000 -1.000000 -0.000250 0.000030 0.000000 0.000000 0.000000 -0.000000 0.000750 0.000030 0.000000 370.000000 1.700000 -1.000000 -0.000250 0.000170 0.000000 0.000000 0.000000 -0.000000 0.000750 0.000170 0.000000 370.000000 1.700000 -1.000000 -0.000250 0.000310 0.000000 0.000000 0.000000 -0.000000 0.000750 0.000310 0.000000 370.000000 1.700000 -1.000000 -0.000250 0.000450 0.000000 0.000000 0.000000 -0.000000 0.000750 0.000450 0.000000 370.000000 1.700000 -1.000000 -0.000250 0.000590 0.000000 0.000000 0.000000 -0.000000 0.000750 0.000590 0.000000 370.000000 1.700000 -1.000000 -0.000250 0.000730 0.000000 0.000000 0.000000 -0.000000 0.000750 0.000730 0.000000 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_1.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_1.txt deleted file mode 100644 index e8e618f..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_1.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 0.000515 -0.000406 0.000040 0.000000 0.000000 -0.000000 0.000906 0.000515 0.000040 370.000000 1.700000 -1.000000 0.000386 -0.000351 0.000040 0.000000 0.000000 -0.000000 0.000777 0.000570 0.000040 370.000000 1.700000 -1.000000 0.000257 -0.000296 0.000040 0.000000 0.000000 -0.000000 0.000648 0.000624 0.000040 370.000000 1.700000 -1.000000 0.000128 -0.000242 0.000040 0.000000 0.000000 -0.000000 0.000519 0.000679 0.000040 370.000000 1.700000 -1.000000 -0.000001 -0.000187 0.000040 0.000000 0.000000 -0.000000 0.000390 0.000734 0.000040 370.000000 1.700000 -1.000000 -0.000129 -0.000132 0.000040 0.000000 0.000000 -0.000000 0.000261 0.000788 0.000040 370.000000 1.700000 -1.000000 -0.000258 -0.000077 0.000040 0.000000 0.000000 -0.000000 0.000132 0.000843 0.000040 370.000000 1.700000 -1.000000 -0.000387 -0.000023 0.000040 0.000000 0.000000 -0.000000 0.000004 0.000898 0.000040 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_10.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_10.txt deleted file mode 100644 index 15da457..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_10.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 -0.000454 0.000312 0.000400 0.000000 0.000000 -0.000000 0.000188 -0.000454 0.000400 370.000000 1.700000 -1.000000 -0.000347 0.000402 0.000400 0.000000 0.000000 -0.000000 0.000296 -0.000364 0.000400 370.000000 1.700000 -1.000000 -0.000240 0.000492 0.000400 0.000000 0.000000 -0.000000 0.000403 -0.000274 0.000400 370.000000 1.700000 -1.000000 -0.000133 0.000582 0.000400 0.000000 0.000000 -0.000000 0.000510 -0.000184 0.000400 370.000000 1.700000 -1.000000 -0.000025 0.000672 0.000400 0.000000 0.000000 -0.000000 0.000617 -0.000094 0.000400 370.000000 1.700000 -1.000000 0.000082 0.000762 0.000400 0.000000 0.000000 -0.000000 0.000725 -0.000004 0.000400 370.000000 1.700000 -1.000000 0.000189 0.000852 0.000400 0.000000 0.000000 -0.000000 0.000832 0.000086 0.000400 370.000000 1.700000 -1.000000 0.000296 0.000942 0.000400 0.000000 0.000000 -0.000000 0.000939 0.000176 0.000400 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_11.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_11.txt deleted file mode 100644 index 4501ee5..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_11.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 -0.000082 -0.000374 0.000440 0.000000 0.000000 -0.000000 0.000874 -0.000082 0.000440 370.000000 1.700000 -1.000000 -0.000123 -0.000240 0.000440 0.000000 0.000000 -0.000000 0.000833 0.000052 0.000440 370.000000 1.700000 -1.000000 -0.000164 -0.000107 0.000440 0.000000 0.000000 -0.000000 0.000792 0.000186 0.000440 370.000000 1.700000 -1.000000 -0.000205 0.000027 0.000440 0.000000 0.000000 -0.000000 0.000752 0.000320 0.000440 370.000000 1.700000 -1.000000 -0.000246 0.000161 0.000440 0.000000 0.000000 -0.000000 0.000711 0.000454 0.000440 370.000000 1.700000 -1.000000 -0.000287 0.000295 0.000440 0.000000 0.000000 -0.000000 0.000670 0.000587 0.000440 370.000000 1.700000 -1.000000 -0.000328 0.000429 0.000440 0.000000 0.000000 -0.000000 0.000629 0.000721 0.000440 370.000000 1.700000 -1.000000 -0.000368 0.000563 0.000440 0.000000 0.000000 -0.000000 0.000588 0.000855 0.000440 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_12.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_12.txt deleted file mode 100644 index b8025bb..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_12.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 0.000695 -0.000300 0.000480 0.000000 0.000000 -0.000000 0.000800 0.000695 0.000480 370.000000 1.700000 -1.000000 0.000556 -0.000285 0.000480 0.000000 0.000000 -0.000000 0.000660 0.000710 0.000480 370.000000 1.700000 -1.000000 0.000417 -0.000270 0.000480 0.000000 0.000000 -0.000000 0.000521 0.000724 0.000480 370.000000 1.700000 -1.000000 0.000277 -0.000256 0.000480 0.000000 0.000000 -0.000000 0.000382 0.000739 0.000480 370.000000 1.700000 -1.000000 0.000138 -0.000241 0.000480 0.000000 0.000000 -0.000000 0.000243 0.000754 0.000480 370.000000 1.700000 -1.000000 -0.000001 -0.000226 0.000480 0.000000 0.000000 -0.000000 0.000103 0.000768 0.000480 370.000000 1.700000 -1.000000 -0.000140 -0.000212 0.000480 0.000000 0.000000 -0.000000 -0.000036 0.000783 0.000480 370.000000 1.700000 -1.000000 -0.000280 -0.000197 0.000480 0.000000 0.000000 -0.000000 -0.000175 0.000797 0.000480 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_13.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_13.txt deleted file mode 100644 index 6d2d2b0..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_13.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 0.000930 0.000445 0.000520 0.000000 0.000000 -0.000000 0.000055 0.000930 0.000520 370.000000 1.700000 -1.000000 0.000862 0.000322 0.000520 0.000000 0.000000 -0.000000 -0.000013 0.000807 0.000520 370.000000 1.700000 -1.000000 0.000794 0.000200 0.000520 0.000000 0.000000 -0.000000 -0.000081 0.000685 0.000520 370.000000 1.700000 -1.000000 0.000726 0.000078 0.000520 0.000000 0.000000 -0.000000 -0.000149 0.000562 0.000520 370.000000 1.700000 -1.000000 0.000658 -0.000045 0.000520 0.000000 0.000000 -0.000000 -0.000216 0.000440 0.000520 370.000000 1.700000 -1.000000 0.000590 -0.000167 0.000520 0.000000 0.000000 -0.000000 -0.000284 0.000317 0.000520 370.000000 1.700000 -1.000000 0.000522 -0.000290 0.000520 0.000000 0.000000 -0.000000 -0.000352 0.000195 0.000520 370.000000 1.700000 -1.000000 0.000455 -0.000412 0.000520 0.000000 0.000000 -0.000000 -0.000420 0.000073 0.000520 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_14.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_14.txt deleted file mode 100644 index 0b02138..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_14.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 0.000336 0.000952 0.000420 0.000000 0.000000 -0.000000 -0.000452 0.000336 0.000420 370.000000 1.700000 -1.000000 0.000422 0.000842 0.000420 0.000000 0.000000 -0.000000 -0.000366 0.000226 0.000420 370.000000 1.700000 -1.000000 0.000509 0.000731 0.000420 0.000000 0.000000 -0.000000 -0.000279 0.000116 0.000420 370.000000 1.700000 -1.000000 0.000595 0.000621 0.000420 0.000000 0.000000 -0.000000 -0.000193 0.000005 0.000420 370.000000 1.700000 -1.000000 0.000681 0.000511 0.000420 0.000000 0.000000 -0.000000 -0.000107 -0.000105 0.000420 370.000000 1.700000 -1.000000 0.000767 0.000400 0.000420 0.000000 0.000000 -0.000000 -0.000021 -0.000215 0.000420 370.000000 1.700000 -1.000000 0.000853 0.000290 0.000420 0.000000 0.000000 -0.000000 0.000065 -0.000326 0.000420 370.000000 1.700000 -1.000000 0.000940 0.000180 0.000420 0.000000 0.000000 -0.000000 0.000152 -0.000436 0.000420 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_15.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_15.txt deleted file mode 100644 index eb5d14c..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_15.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 -0.000362 0.000604 0.000450 0.000000 0.000000 -0.000000 -0.000104 -0.000362 0.000450 370.000000 1.700000 -1.000000 -0.000227 0.000640 0.000450 0.000000 0.000000 -0.000000 0.000032 -0.000326 0.000450 370.000000 1.700000 -1.000000 -0.000092 0.000676 0.000450 0.000000 0.000000 -0.000000 0.000167 -0.000290 0.000450 370.000000 1.700000 -1.000000 0.000043 0.000712 0.000450 0.000000 0.000000 -0.000000 0.000302 -0.000254 0.000450 370.000000 1.700000 -1.000000 0.000179 0.000748 0.000450 0.000000 0.000000 -0.000000 0.000437 -0.000217 0.000450 370.000000 1.700000 -1.000000 0.000314 0.000785 0.000450 0.000000 0.000000 -0.000000 0.000573 -0.000181 0.000450 370.000000 1.700000 -1.000000 0.000449 0.000821 0.000450 0.000000 0.000000 -0.000000 0.000708 -0.000145 0.000450 370.000000 1.700000 -1.000000 0.000584 0.000857 0.000450 0.000000 0.000000 -0.000000 0.000843 -0.000109 0.000450 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_16.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_16.txt deleted file mode 100644 index 47ec9cb..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_16.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 -0.000315 -0.000176 0.000480 0.000000 0.000000 -0.000000 0.000676 -0.000315 0.000480 370.000000 1.700000 -1.000000 -0.000295 -0.000037 0.000480 0.000000 0.000000 -0.000000 0.000695 -0.000176 0.000480 370.000000 1.700000 -1.000000 -0.000276 0.000102 0.000480 0.000000 0.000000 -0.000000 0.000715 -0.000037 0.000480 370.000000 1.700000 -1.000000 -0.000256 0.000240 0.000480 0.000000 0.000000 -0.000000 0.000734 0.000101 0.000480 370.000000 1.700000 -1.000000 -0.000237 0.000379 0.000480 0.000000 0.000000 -0.000000 0.000753 0.000240 0.000480 370.000000 1.700000 -1.000000 -0.000217 0.000518 0.000480 0.000000 0.000000 -0.000000 0.000773 0.000378 0.000480 370.000000 1.700000 -1.000000 -0.000198 0.000656 0.000480 0.000000 0.000000 -0.000000 0.000792 0.000517 0.000480 370.000000 1.700000 -1.000000 -0.000178 0.000795 0.000480 0.000000 0.000000 -0.000000 0.000812 0.000656 0.000480 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_17.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_17.txt deleted file mode 100644 index 9445588..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_17.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 0.000421 -0.000436 0.000510 0.000000 0.000000 -0.000000 0.000936 0.000421 0.000510 370.000000 1.700000 -1.000000 0.000301 -0.000364 0.000510 0.000000 0.000000 -0.000000 0.000816 0.000493 0.000510 370.000000 1.700000 -1.000000 0.000181 -0.000292 0.000510 0.000000 0.000000 -0.000000 0.000696 0.000565 0.000510 370.000000 1.700000 -1.000000 0.000061 -0.000220 0.000510 0.000000 0.000000 -0.000000 0.000576 0.000637 0.000510 370.000000 1.700000 -1.000000 -0.000059 -0.000148 0.000510 0.000000 0.000000 -0.000000 0.000456 0.000709 0.000510 370.000000 1.700000 -1.000000 -0.000179 -0.000076 0.000510 0.000000 0.000000 -0.000000 0.000336 0.000782 0.000510 370.000000 1.700000 -1.000000 -0.000299 -0.000003 0.000510 0.000000 0.000000 -0.000000 0.000216 0.000854 0.000510 370.000000 1.700000 -1.000000 -0.000419 0.000069 0.000510 0.000000 0.000000 -0.000000 0.000096 0.000926 0.000510 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_2.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_2.txt deleted file mode 100644 index f6bfa90..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_2.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 0.000957 0.000238 0.000080 0.000000 0.000000 -0.000000 0.000262 0.000957 0.000080 370.000000 1.700000 -1.000000 0.000856 0.000140 0.000080 0.000000 0.000000 -0.000000 0.000162 0.000860 0.000080 370.000000 1.700000 -1.000000 0.000756 0.000043 0.000080 0.000000 0.000000 -0.000000 0.000061 0.000762 0.000080 370.000000 1.700000 -1.000000 0.000655 -0.000054 0.000080 0.000000 0.000000 -0.000000 -0.000040 0.000665 0.000080 370.000000 1.700000 -1.000000 0.000554 -0.000151 0.000080 0.000000 0.000000 -0.000000 -0.000140 0.000568 0.000080 370.000000 1.700000 -1.000000 0.000453 -0.000249 0.000080 0.000000 0.000000 -0.000000 -0.000241 0.000471 0.000080 370.000000 1.700000 -1.000000 0.000353 -0.000346 0.000080 0.000000 0.000000 -0.000000 -0.000342 0.000373 0.000080 370.000000 1.700000 -1.000000 0.000252 -0.000443 0.000080 0.000000 0.000000 -0.000000 -0.000443 0.000276 0.000080 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_3.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_3.txt deleted file mode 100644 index 75d6a64..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_3.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 0.000538 0.000896 0.000120 0.000000 0.000000 -0.000000 -0.000396 0.000538 0.000120 370.000000 1.700000 -1.000000 0.000588 0.000765 0.000120 0.000000 0.000000 -0.000000 -0.000346 0.000407 0.000120 370.000000 1.700000 -1.000000 0.000638 0.000635 0.000120 0.000000 0.000000 -0.000000 -0.000296 0.000276 0.000120 370.000000 1.700000 -1.000000 0.000688 0.000504 0.000120 0.000000 0.000000 -0.000000 -0.000245 0.000146 0.000120 370.000000 1.700000 -1.000000 0.000738 0.000373 0.000120 0.000000 0.000000 -0.000000 -0.000195 0.000015 0.000120 370.000000 1.700000 -1.000000 0.000788 0.000242 0.000120 0.000000 0.000000 -0.000000 -0.000145 -0.000116 0.000120 370.000000 1.700000 -1.000000 0.000839 0.000112 0.000120 0.000000 0.000000 -0.000000 -0.000095 -0.000247 0.000120 370.000000 1.700000 -1.000000 0.000889 -0.000019 0.000120 0.000000 0.000000 -0.000000 -0.000045 -0.000377 0.000120 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_4.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_4.txt deleted file mode 100644 index 63efd0f..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_4.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 -0.000232 0.000767 0.000160 0.000000 0.000000 -0.000000 -0.000267 -0.000232 0.000160 370.000000 1.700000 -1.000000 -0.000092 0.000762 0.000160 0.000000 0.000000 -0.000000 -0.000127 -0.000237 0.000160 370.000000 1.700000 -1.000000 0.000048 0.000757 0.000160 0.000000 0.000000 -0.000000 0.000013 -0.000242 0.000160 370.000000 1.700000 -1.000000 0.000187 0.000752 0.000160 0.000000 0.000000 -0.000000 0.000153 -0.000247 0.000160 370.000000 1.700000 -1.000000 0.000327 0.000748 0.000160 0.000000 0.000000 -0.000000 0.000293 -0.000252 0.000160 370.000000 1.700000 -1.000000 0.000467 0.000743 0.000160 0.000000 0.000000 -0.000000 0.000432 -0.000257 0.000160 370.000000 1.700000 -1.000000 0.000607 0.000738 0.000160 0.000000 0.000000 -0.000000 0.000572 -0.000262 0.000160 370.000000 1.700000 -1.000000 0.000747 0.000733 0.000160 0.000000 0.000000 -0.000000 0.000712 -0.000266 0.000160 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_5.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_5.txt deleted file mode 100644 index c7deefe..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_5.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 -0.000414 0.000008 0.000200 0.000000 0.000000 -0.000000 0.000492 -0.000414 0.000200 370.000000 1.700000 -1.000000 -0.000355 0.000135 0.000200 0.000000 0.000000 -0.000000 0.000551 -0.000288 0.000200 370.000000 1.700000 -1.000000 -0.000296 0.000262 0.000200 0.000000 0.000000 -0.000000 0.000610 -0.000161 0.000200 370.000000 1.700000 -1.000000 -0.000237 0.000389 0.000200 0.000000 0.000000 -0.000000 0.000669 -0.000034 0.000200 370.000000 1.700000 -1.000000 -0.000178 0.000516 0.000200 0.000000 0.000000 -0.000000 0.000729 0.000093 0.000200 370.000000 1.700000 -1.000000 -0.000119 0.000643 0.000200 0.000000 0.000000 -0.000000 0.000788 0.000220 0.000200 370.000000 1.700000 -1.000000 -0.000059 0.000769 0.000200 0.000000 0.000000 -0.000000 0.000847 0.000347 0.000200 370.000000 1.700000 -1.000000 -0.000000 0.000896 0.000200 0.000000 0.000000 -0.000000 0.000906 0.000474 0.000200 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_6.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_6.txt deleted file mode 100644 index 87c4788..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_6.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 0.000213 -0.000456 0.000240 0.000000 0.000000 -0.000000 0.000956 0.000213 0.000240 370.000000 1.700000 -1.000000 0.000119 -0.000352 0.000240 0.000000 0.000000 -0.000000 0.000862 0.000317 0.000240 370.000000 1.700000 -1.000000 0.000026 -0.000248 0.000240 0.000000 0.000000 -0.000000 0.000769 0.000421 0.000240 370.000000 1.700000 -1.000000 -0.000068 -0.000144 0.000240 0.000000 0.000000 -0.000000 0.000675 0.000525 0.000240 370.000000 1.700000 -1.000000 -0.000162 -0.000040 0.000240 0.000000 0.000000 -0.000000 0.000581 0.000629 0.000240 370.000000 1.700000 -1.000000 -0.000255 0.000064 0.000240 0.000000 0.000000 -0.000000 0.000488 0.000733 0.000240 370.000000 1.700000 -1.000000 -0.000349 0.000168 0.000240 0.000000 0.000000 -0.000000 0.000394 0.000837 0.000240 370.000000 1.700000 -1.000000 -0.000443 0.000272 0.000240 0.000000 0.000000 -0.000000 0.000300 0.000941 0.000240 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_7.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_7.txt deleted file mode 100644 index e6704c1..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_7.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 0.000886 -0.000060 0.000280 0.000000 0.000000 -0.000000 0.000560 0.000886 0.000280 370.000000 1.700000 -1.000000 0.000753 -0.000106 0.000280 0.000000 0.000000 -0.000000 0.000428 0.000840 0.000280 370.000000 1.700000 -1.000000 0.000621 -0.000151 0.000280 0.000000 0.000000 -0.000000 0.000295 0.000794 0.000280 370.000000 1.700000 -1.000000 0.000488 -0.000197 0.000280 0.000000 0.000000 -0.000000 0.000163 0.000749 0.000280 370.000000 1.700000 -1.000000 0.000356 -0.000242 0.000280 0.000000 0.000000 -0.000000 0.000030 0.000703 0.000280 370.000000 1.700000 -1.000000 0.000224 -0.000288 0.000280 0.000000 0.000000 -0.000000 -0.000102 0.000658 0.000280 370.000000 1.700000 -1.000000 0.000091 -0.000333 0.000280 0.000000 0.000000 -0.000000 -0.000234 0.000612 0.000280 370.000000 1.700000 -1.000000 -0.000041 -0.000379 0.000280 0.000000 0.000000 -0.000000 -0.000367 0.000566 0.000280 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_8.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_8.txt deleted file mode 100644 index 15d09bf..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_8.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 0.000784 0.000714 0.000320 0.000000 0.000000 -0.000000 -0.000214 0.000784 0.000320 370.000000 1.700000 -1.000000 0.000774 0.000574 0.000320 0.000000 0.000000 -0.000000 -0.000224 0.000644 0.000320 370.000000 1.700000 -1.000000 0.000764 0.000435 0.000320 0.000000 0.000000 -0.000000 -0.000233 0.000504 0.000320 370.000000 1.700000 -1.000000 0.000754 0.000295 0.000320 0.000000 0.000000 -0.000000 -0.000243 0.000365 0.000320 370.000000 1.700000 -1.000000 0.000745 0.000155 0.000320 0.000000 0.000000 -0.000000 -0.000253 0.000225 0.000320 370.000000 1.700000 -1.000000 0.000735 0.000016 0.000320 0.000000 0.000000 -0.000000 -0.000263 0.000085 0.000320 370.000000 1.700000 -1.000000 0.000725 -0.000124 0.000320 0.000000 0.000000 -0.000000 -0.000272 -0.000054 0.000320 370.000000 1.700000 -1.000000 0.000715 -0.000264 0.000320 0.000000 0.000000 -0.000000 -0.000282 -0.000194 0.000320 370.000000 1.700000 diff --git a/examples/data/scanPathData/rve_layers/ULI_rve_layer_9.txt b/examples/data/scanPathData/rve_layers/ULI_rve_layer_9.txt deleted file mode 100644 index 2f96f40..0000000 --- a/examples/data/scanPathData/rve_layers/ULI_rve_layer_9.txt +++ /dev/null @@ -1,17 +0,0 @@ -Mode X(m) Y(m) Z(m) Power(W) tParam -1.000000 0.000031 0.000922 0.000360 0.000000 0.000000 -0.000000 -0.000422 0.000031 0.000360 370.000000 1.700000 -1.000000 0.000156 0.000859 0.000360 0.000000 0.000000 -0.000000 -0.000298 -0.000032 0.000360 370.000000 1.700000 -1.000000 0.000281 0.000795 0.000360 0.000000 0.000000 -0.000000 -0.000173 -0.000096 0.000360 370.000000 1.700000 -1.000000 0.000406 0.000732 0.000360 0.000000 0.000000 -0.000000 -0.000048 -0.000159 0.000360 370.000000 1.700000 -1.000000 0.000530 0.000668 0.000360 0.000000 0.000000 -0.000000 0.000076 -0.000223 0.000360 370.000000 1.700000 -1.000000 0.000655 0.000605 0.000360 0.000000 0.000000 -0.000000 0.000201 -0.000286 0.000360 370.000000 1.700000 -1.000000 0.000780 0.000541 0.000360 0.000000 0.000000 -0.000000 0.000326 -0.000350 0.000360 370.000000 1.700000 -1.000000 0.000905 0.000478 0.000360 0.000000 0.000000 -0.000000 0.000451 -0.000413 0.000360 370.000000 1.700000 diff --git a/pyproject.toml b/pyproject.toml index 6f959fa..c8cff2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,8 @@ dependencies = [ "vtk", "scikit-image", "pytest", - "pandas" + "pandas", + "pyvista" ] [project.scripts] diff --git a/src/raptor/api.py b/src/raptor/api.py index f2f53a5..35bab8e 100644 --- a/src/raptor/api.py +++ b/src/raptor/api.py @@ -14,6 +14,7 @@ import pandas as pd import vtk from vtk.util import numpy_support +import pyvista as pv from skimage import measure from skimage.morphology import remove_small_objects @@ -268,3 +269,37 @@ def write_morphology(properties: dict, morphology_output_path: str) -> None: f"Morphology features of {len(morphology_df)} " f"defects written to: {morphology_output_path}" ) + + +def visualize(vtk_output_path: str, scaling=1e6) -> None: + """ + Visualizes porosity field using PyVista. Defaults to scaling from meters to microns for better labeling. + """ + rve = pv.read(vtk_output_path) + rve.scale( + [scaling, scaling, scaling], inplace=True + ) # Scale for better visualization + isosurface = rve.contour(isosurfaces=5) + + # Outline of the original domain + outline = rve.outline() + + # Set up the plotter + pl = pv.Plotter() + pl.add_mesh(isosurface, color="red", opacity=0.8) + pl.add_mesh(outline, color="black", line_width=1) + label_args = { + "font_size": 12, + "color": "black", + "font_family": "arial", + "fmt": "%.0f", + } + pl.show_grid( + xtitle="X (um)", + ytitle="Y (um)", + ztitle="Z (um)", + grid=False, + location="outer", + **label_args, + ) + pl.show() From 93b6c2772b1a43e022989542222faaa3202168d2 Mon Sep 17 00:00:00 2001 From: Vamsi Subraveti Date: Tue, 17 Mar 2026 14:47:37 -0500 Subject: [PATCH 7/9] cleaned readme and added contributor instructions. --- CONTRIBUTING.md | 5 +++++ README.md | 17 +++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e83be34 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,5 @@ +Contributing to Raptor is easy: just open a pull request. Make main the destination branch on the Raptor repository and allow edits from maintainers. + +Your pull request must work with all current Raptor tutorial examples and be reviewed by at least one of the main developers. + +We use `pre-commit` to fix formatting into a consistent style. You can install `pre-commit` through `pip`. diff --git a/README.md b/README.md index 8b57002..84e2b41 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ --- -RAPTOR is a Python-based simulation tool for estimating porosity-related defects in Laser Powder Bed Fusion (LPBF) additive manufacturing processes. It uses a computationally efficient geometric approach to model the dynamic melt pool and identify regions of unmelted material, which correspond to lack-of-fusion pores. The core of RAPTOR is a geometric model of the melt pool cross-section whose dimensions (width, depth, and height) oscillate over time. By analyzing the volume swept by this dynamic melt pool along the laser scan paths, RAPTOR generates a 3D map of the final part's porosity. +Raptor is a Python-based simulation tool for estimating porosity-related defects in Laser Powder Bed Fusion (LPBF) additive manufacturing processes. It uses a computationally efficient geometric approach to model the dynamic melt pool and identify regions of unmelted material, which correspond to lack-of-fusion pores. The core of Raptor is a geometric model of the melt pool cross-section whose dimensions (width, depth, and height) oscillate over time. By analyzing the volume swept by this dynamic melt pool along the laser scan paths, Raptor generates a 3D map of the final part's porosity. ## License @@ -17,7 +17,7 @@ This project is licensed under the BSD 3-Clause [License](LICENSE). ## How It Works -**RAPTOR predicts porosity by following a multi-step process:** +**Raptor predicts porosity by following a multi-step process:** * **Domain Voxelization**: A 3D bounding box, or Representative Volume Element (RVE), is defined and discretized into a uniform grid of voxels. * **Scan Path Ingestion**: Scan path data is used to calculating the timing and trajectory for each laser vector. @@ -26,9 +26,14 @@ This project is licensed under the BSD 3-Clause [License](LICENSE). * **Porosity Prediction**: Any voxel that is not melted by the end of the simulation is flagged as porosity. * **Analysis and Output**: The final 3D porosity field is saved in the binary VTK ImageData (`.vti`) format. The morphological characteristics (e.g., volume, surface area, equivalent diameter) of contiguous pore structures can be quantified using the `scikit-image` library, and saved to a `.csv` file. +
+ example figure +
Stochastic undermelting defects occurring between tracks due to melt pool fluctuations.
+
+ ## Installation -RAPTOR requires requires Python 3 (tested with Python 3.8+). The following Python packages are necessary: +Raptor requires requires Python 3 (tested with Python 3.8+). The following Python packages are necessary: ```bash numpy, numba, pyyaml, vtk, scikit-image, pandas, pyvista ``` @@ -56,7 +61,7 @@ The project is organized into several modules: * `io.py`: Contains functions for reading and parsing input files (scan paths, melt pool data). * `utilities.py`: Includes helper classes, such as the `ScanPathBuilder` for generating scan strategies. -RAPTOR can be used in two primary ways: through its Command-Line Interface (CLI) for quick, configuration-driven simulations, or as a Python Library (API) for integration into custom scripts and simulation workflows. +Raptor can be used in two primary ways: through its Command-Line Interface (CLI) for quick, configuration-driven simulations, or as a Python Library (API) for integration into custom scripts and simulation workflows. ### 1. Command-Line Interface (CLI) @@ -76,7 +81,7 @@ The CLI usage requires scan path files corresponding to build information. These #### CLI Input: The `input.yaml` File -Running RAPTOR from the CLI requires a YAML input file to specify all parameters. +Running Raptor from the CLI requires a YAML input file to specify all parameters. **Example `input.yaml`:** ```yaml @@ -155,7 +160,7 @@ output: ### 2. Python Library (API) -The API allows for programmatic parameter studies, custom workflows, and integration with other tools. The core functionality of RAPTOR can be called by scripting with the API library. An example is provided in `examples/api_example/rve.py`, which is an RVE simulation of defects in 500µm edge length cube. +The API allows for programmatic parameter studies, custom workflows, and integration with other tools. The core functionality of Raptor can be called by scripting with the API library. An example is provided in `examples/api_example/rve.py`, which is an RVE simulation of defects in 500µm edge length cube. The following is a breakdown of the main steps for running a simulation programmatically. From 023d079f57a26b80cef8070dee5b1209f9768025 Mon Sep 17 00:00:00 2001 From: Vamsi Subraveti Date: Tue, 17 Mar 2026 14:59:19 -0500 Subject: [PATCH 8/9] updated integrated tests --- tests/test_api.py | 57 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 11 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index 7885c3a..dd9a0dd 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -116,6 +116,12 @@ def sample_melt_pool_dict(sample_time_series_data): } +@pytest.fixture +def sample_morphology_fields(): + """Fixture providing sample morphology fields.""" + return ["area", "centroid"] + + @pytest.fixture def temp_output_dir(): """Fixture providing a temporary directory for output files.""" @@ -532,17 +538,46 @@ def test_write_morphology_column_headers(self, temp_output_dir): class TestApiIntegration: """Integration tests combining multiple API functions.""" - def test_full_workflow_basic(self, temp_output_dir): + def test_full_workflow_basic( + self, + sample_voxel_resolution, + sample_bound_box, + sample_process_parameters, + sample_melt_pool_dict, + temp_output_dir, + ): """Test complete workflow from grid creation to VTK output.""" - # TODO: Create end-to-end test - pass + grid = create_grid(sample_voxel_resolution, bound_box=sample_bound_box) + path_vectors = create_path_vectors( + sample_bound_box, **sample_process_parameters + ) + melt_pool = create_melt_pool(sample_melt_pool_dict, enable_random_phases=False) + porosity = compute_porosity(grid, path_vectors, melt_pool, jit_warmup=True) + output_path = temp_output_dir / "full_workflow.vti" + write_vtk(grid.origin, grid.resolution, porosity, str(output_path)) + assert output_path.exists() + assert output_path.stat().st_size > 0 - def test_full_workflow_with_morphology(self, temp_output_dir): + def test_full_workflow_with_morphology( + self, + sample_voxel_resolution, + sample_bound_box, + sample_process_parameters, + sample_melt_pool_dict, + sample_morphology_fields, + temp_output_dir, + ): """Test complete workflow including morphology analysis.""" - # TODO: Create end-to-end test with morphology - pass - - def test_grid_to_porosity_pipeline(self): - """Test pipeline from grid creation through porosity computation.""" - # TODO: Test combined workflow - pass + grid = create_grid(sample_voxel_resolution, bound_box=sample_bound_box) + path_vectors = create_path_vectors( + sample_bound_box, **sample_process_parameters + ) + melt_pool = create_melt_pool(sample_melt_pool_dict, enable_random_phases=False) + porosity = compute_porosity(grid, path_vectors, melt_pool, jit_warmup=True) + morphology = compute_morphology( + porosity, sample_voxel_resolution, sample_morphology_fields + ) + morphology_output_path = temp_output_dir / "morphology.csv" + write_morphology(morphology, str(morphology_output_path)) + assert morphology_output_path.exists() + assert morphology_output_path.stat().st_size > 0 From b015126a29fd131e3ec24a2bfd5b0f00c41c5ce3 Mon Sep 17 00:00:00 2001 From: Vamsi Subraveti Date: Tue, 17 Mar 2026 15:07:37 -0500 Subject: [PATCH 9/9] fixed input.yaml --- examples/cli_example/input.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/cli_example/input.yaml b/examples/cli_example/input.yaml index 63c7645..4533f73 100644 --- a/examples/cli_example/input.yaml +++ b/examples/cli_example/input.yaml @@ -36,5 +36,5 @@ output: vtk: file_name: "ULI_singletrack.vti" morphology: - file_name: + file_name: "ULI_singletrack_morphology.txt" fields: