From 6ba5a468d2b40f2c8997f4396ab166d9193aec1d Mon Sep 17 00:00:00 2001 From: Saurabh Mogre Date: Wed, 10 Jan 2024 14:03:57 -0800 Subject: [PATCH] Updates for variable count and size experiments (#215) * set `grid_file_out` even if file does not exist * * calculate seed before updating base name * return count as integer * allow specifying seed list in the recipe * set default value for randomness seed in recipe * * automatically specify seeds for multiple packings * add sphere mesh objects for tests * add recipe for nested mesh testing * refactor seed list processing --------- Co-authored-by: meganrm --- cellpack/autopack/Analysis.py | 4 +- cellpack/autopack/Environment.py | 6 +- cellpack/autopack/utils.py | 23 + cellpack/bin/pack.py | 6 +- cellpack/tests/geometry/sphere_2.obj | 483 ++++++++++++++++++ cellpack/tests/geometry/sphere_4.obj | 483 ++++++++++++++++++ .../recipes/v2/test_nested_mesh_gradient.json | 104 ++++ .../tests/recipes/v2/test_variable_count.json | 3 +- 8 files changed, 1105 insertions(+), 7 deletions(-) create mode 100644 cellpack/tests/geometry/sphere_2.obj create mode 100644 cellpack/tests/geometry/sphere_4.obj create mode 100644 cellpack/tests/recipes/v2/test_nested_mesh_gradient.json diff --git a/cellpack/autopack/Analysis.py b/cellpack/autopack/Analysis.py index 66d66d34a..59db980df 100644 --- a/cellpack/autopack/Analysis.py +++ b/cellpack/autopack/Analysis.py @@ -2173,8 +2173,8 @@ def pack_one_seed( """ Packs one seed of a recipe and returns the recipe object """ - seed_basename = self.env.add_seed_number_to_base_name(seed_index) - seed = seed_list[seed_index] + seed = int(seed_list[seed_index]) + seed_basename = self.env.add_seed_number_to_base_name(seed) # Clear if self.afviewer: self.afviewer.clearFill("Test_Spheres2D") diff --git a/cellpack/autopack/Environment.py b/cellpack/autopack/Environment.py index 0ca92c806..a61cb22bb 100644 --- a/cellpack/autopack/Environment.py +++ b/cellpack/autopack/Environment.py @@ -157,8 +157,7 @@ def __init__(self, config=None, recipe=None): f"{self.out_folder}/{self.name}_{config['name']}_{self.version}_grid.dat" ) if recipe.get("grid_file_path") is not None: - if os.path.isfile(recipe["grid_file_path"]): - self.grid_file_out = recipe["grid_file_path"] + self.grid_file_out = recipe["grid_file_path"] should_load_grid_file = ( os.path.isfile(self.grid_file_out) and self.load_from_grid_file @@ -1832,7 +1831,8 @@ def update_variable_ingredient_attributes(self, allIngredients): if hasattr(ingr, "count_options") and ingr.count_options is not None: count = get_value_from_distribution( - distribution_options=ingr.count_options + distribution_options=ingr.count_options, + return_int=True, ) if count is not None: ingr.count = count diff --git a/cellpack/autopack/utils.py b/cellpack/autopack/utils.py index 1f720d006..01d856ce0 100644 --- a/cellpack/autopack/utils.py +++ b/cellpack/autopack/utils.py @@ -257,3 +257,26 @@ def get_value_from_distribution(distribution_options, return_int=False): value = int(numpy.rint(value)) return value + + +def get_seed_list(packing_config_data, recipe_data): + # Returns a list of seeds to use for packing + if packing_config_data["randomness_seed"] is not None: + seed_list = packing_config_data["randomness_seed"] + elif recipe_data.get("randomness_seed") is not None: + seed_list = recipe_data["randomness_seed"] + else: + seed_list = None + + if isinstance(seed_list, int): + seed_list = [seed_list] + + if (seed_list is not None) and ( + len(seed_list) != packing_config_data["number_of_packings"] + ): + base_seed = int(seed_list[0]) + seed_list = [ + base_seed + i for i in range(packing_config_data["number_of_packings"]) + ] + + return seed_list diff --git a/cellpack/bin/pack.py b/cellpack/bin/pack.py index 3c420e2e3..6e8b92c13 100644 --- a/cellpack/bin/pack.py +++ b/cellpack/bin/pack.py @@ -12,6 +12,7 @@ from cellpack.autopack.loaders.config_loader import ConfigLoader from cellpack.autopack.loaders.recipe_loader import RecipeLoader from cellpack.autopack.loaders.analysis_config_loader import AnalysisConfigLoader +from cellpack.autopack.utils import get_seed_list ############################################################################### log_file_path = path.abspath(path.join(__file__, "../../logging.conf")) @@ -56,12 +57,15 @@ def pack(recipe, config_path=None, analysis_config_path=None): result_file=None, ) log.info(f"saving to {env.out_folder}") + + seed_list = get_seed_list(packing_config_data, recipe_data) + analyze.doloop( packing_config_data["number_of_packings"], env.boundingBox, plot_figures=packing_config_data.get("save_plot_figures", True), show_grid=packing_config_data["show_grid_plot"], - seed_list=packing_config_data["randomness_seed"], + seed_list=seed_list, config_name=packing_config_data["name"], recipe_version=recipe_data["version"], image_export_options=packing_config_data.get("image_export_options"), diff --git a/cellpack/tests/geometry/sphere_2.obj b/cellpack/tests/geometry/sphere_2.obj new file mode 100644 index 000000000..1862cf481 --- /dev/null +++ b/cellpack/tests/geometry/sphere_2.obj @@ -0,0 +1,483 @@ +# https://github.com/mikedh/trimesh +v -1.05146222 1.70130162 0.00000000 0.00000000 1.00000000 1.00000000 +v 1.05146222 1.70130162 0.00000000 0.00000000 1.00000000 1.00000000 +v -1.05146222 -1.70130162 0.00000000 0.00000000 1.00000000 1.00000000 +v 1.05146222 -1.70130162 0.00000000 0.00000000 1.00000000 1.00000000 +v 0.00000000 -1.05146222 1.70130162 0.00000000 1.00000000 1.00000000 +v 0.00000000 1.05146222 1.70130162 0.00000000 1.00000000 1.00000000 +v 0.00000000 -1.05146222 -1.70130162 0.00000000 1.00000000 1.00000000 +v 0.00000000 1.05146222 -1.70130162 0.00000000 1.00000000 1.00000000 +v 1.70130162 0.00000000 -1.05146222 0.00000000 1.00000000 1.00000000 +v 1.70130162 0.00000000 1.05146222 0.00000000 1.00000000 1.00000000 +v -1.70130162 0.00000000 -1.05146222 0.00000000 1.00000000 1.00000000 +v -1.70130162 0.00000000 1.05146222 0.00000000 1.00000000 1.00000000 +v 0.00000000 2.00000000 0.00000000 0.00000000 1.00000000 1.00000000 +v 0.00000000 -2.00000000 0.00000000 0.00000000 1.00000000 1.00000000 +v -0.61803399 -1.61803399 1.00000000 0.00000000 1.00000000 1.00000000 +v 0.61803399 -1.61803399 1.00000000 0.00000000 1.00000000 1.00000000 +v -0.61803399 1.61803399 1.00000000 0.00000000 1.00000000 1.00000000 +v 0.61803399 1.61803399 1.00000000 0.00000000 1.00000000 1.00000000 +v 0.00000000 0.00000000 2.00000000 0.00000000 1.00000000 1.00000000 +v -0.61803399 -1.61803399 -1.00000000 0.00000000 1.00000000 1.00000000 +v 0.61803399 -1.61803399 -1.00000000 0.00000000 1.00000000 1.00000000 +v -0.61803399 1.61803399 -1.00000000 0.00000000 1.00000000 1.00000000 +v 0.61803399 1.61803399 -1.00000000 0.00000000 1.00000000 1.00000000 +v 0.00000000 0.00000000 -2.00000000 0.00000000 1.00000000 1.00000000 +v 1.61803399 1.00000000 -0.61803399 0.00000000 1.00000000 1.00000000 +v 1.61803399 -1.00000000 -0.61803399 0.00000000 1.00000000 1.00000000 +v 1.00000000 -0.61803399 -1.61803399 0.00000000 1.00000000 1.00000000 +v 1.00000000 0.61803399 -1.61803399 0.00000000 1.00000000 1.00000000 +v 1.61803399 1.00000000 0.61803399 0.00000000 1.00000000 1.00000000 +v 1.61803399 -1.00000000 0.61803399 0.00000000 1.00000000 1.00000000 +v 1.00000000 -0.61803399 1.61803399 0.00000000 1.00000000 1.00000000 +v 1.00000000 0.61803399 1.61803399 0.00000000 1.00000000 1.00000000 +v 2.00000000 0.00000000 0.00000000 0.00000000 1.00000000 1.00000000 +v -1.61803399 1.00000000 -0.61803399 0.00000000 1.00000000 1.00000000 +v -1.61803399 -1.00000000 -0.61803399 0.00000000 1.00000000 1.00000000 +v -1.00000000 -0.61803399 -1.61803399 0.00000000 1.00000000 1.00000000 +v -1.00000000 0.61803399 -1.61803399 0.00000000 1.00000000 1.00000000 +v -1.61803399 1.00000000 0.61803399 0.00000000 1.00000000 1.00000000 +v -1.61803399 -1.00000000 0.61803399 0.00000000 1.00000000 1.00000000 +v -1.00000000 -0.61803399 1.61803399 0.00000000 1.00000000 1.00000000 +v -1.00000000 0.61803399 1.61803399 0.00000000 1.00000000 1.00000000 +v -2.00000000 0.00000000 0.00000000 0.00000000 1.00000000 1.00000000 +v -0.54653306 1.92387672 0.00000000 0.00000000 1.00000000 1.00000000 +v 0.54653306 1.92387672 0.00000000 0.00000000 1.00000000 1.00000000 +v -0.54653306 -1.92387672 0.00000000 0.00000000 1.00000000 1.00000000 +v 0.54653306 -1.92387672 0.00000000 0.00000000 1.00000000 1.00000000 +v -0.86777713 -1.72533696 0.51978383 0.00000000 1.00000000 1.00000000 +v -0.32124407 -1.38756096 1.40409289 0.00000000 1.00000000 1.00000000 +v -0.32491970 -1.90211303 0.52573111 0.00000000 1.00000000 1.00000000 +v 0.86777713 -1.72533696 0.51978383 0.00000000 1.00000000 1.00000000 +v 0.32124407 -1.38756096 1.40409289 0.00000000 1.00000000 1.00000000 +v 0.32491970 -1.90211303 0.52573111 0.00000000 1.00000000 1.00000000 +v 0.00000000 -1.70130162 1.05146222 0.00000000 1.00000000 1.00000000 +v -0.86777713 1.72533696 0.51978383 0.00000000 1.00000000 1.00000000 +v -0.32124407 1.38756096 1.40409289 0.00000000 1.00000000 1.00000000 +v -0.32491970 1.90211303 0.52573111 0.00000000 1.00000000 1.00000000 +v 0.86777713 1.72533696 0.51978383 0.00000000 1.00000000 1.00000000 +v 0.32124407 1.38756096 1.40409289 0.00000000 1.00000000 1.00000000 +v 0.32491970 1.90211303 0.52573111 0.00000000 1.00000000 1.00000000 +v 0.00000000 1.70130162 1.05146222 0.00000000 1.00000000 1.00000000 +v 0.00000000 -0.54653306 1.92387672 0.00000000 1.00000000 1.00000000 +v 0.00000000 0.54653306 1.92387672 0.00000000 1.00000000 1.00000000 +v -0.86777713 -1.72533696 -0.51978383 0.00000000 1.00000000 1.00000000 +v -0.32124407 -1.38756096 -1.40409289 0.00000000 1.00000000 1.00000000 +v -0.32491970 -1.90211303 -0.52573111 0.00000000 1.00000000 1.00000000 +v 0.86777713 -1.72533696 -0.51978383 0.00000000 1.00000000 1.00000000 +v 0.32124407 -1.38756096 -1.40409289 0.00000000 1.00000000 1.00000000 +v 0.32491970 -1.90211303 -0.52573111 0.00000000 1.00000000 1.00000000 +v 0.00000000 -1.70130162 -1.05146222 0.00000000 1.00000000 1.00000000 +v -0.86777713 1.72533696 -0.51978383 0.00000000 1.00000000 1.00000000 +v -0.32124407 1.38756096 -1.40409289 0.00000000 1.00000000 1.00000000 +v -0.32491970 1.90211303 -0.52573111 0.00000000 1.00000000 1.00000000 +v 0.86777713 1.72533696 -0.51978383 0.00000000 1.00000000 1.00000000 +v 0.32124407 1.38756096 -1.40409289 0.00000000 1.00000000 1.00000000 +v 0.32491970 1.90211303 -0.52573111 0.00000000 1.00000000 1.00000000 +v 0.00000000 1.70130162 -1.05146222 0.00000000 1.00000000 1.00000000 +v 0.00000000 -0.54653306 -1.92387672 0.00000000 1.00000000 1.00000000 +v 0.00000000 0.54653306 -1.92387672 0.00000000 1.00000000 1.00000000 +v 1.38756096 1.40409289 -0.32124407 0.00000000 1.00000000 1.00000000 +v 1.72533696 0.51978383 -0.86777713 0.00000000 1.00000000 1.00000000 +v 1.17557050 1.37638192 -0.85065081 0.00000000 1.00000000 1.00000000 +v 1.38756096 -1.40409289 -0.32124407 0.00000000 1.00000000 1.00000000 +v 1.72533696 -0.51978383 -0.86777713 0.00000000 1.00000000 1.00000000 +v 1.17557050 -1.37638192 -0.85065081 0.00000000 1.00000000 1.00000000 +v 0.51978383 -0.86777713 -1.72533696 0.00000000 1.00000000 1.00000000 +v 1.40409289 -0.32124407 -1.38756096 0.00000000 1.00000000 1.00000000 +v 0.85065081 -1.17557050 -1.37638192 0.00000000 1.00000000 1.00000000 +v 0.52573111 -0.32491970 -1.90211303 0.00000000 1.00000000 1.00000000 +v 1.37638192 -0.85065081 -1.17557050 0.00000000 1.00000000 1.00000000 +v 0.51978383 0.86777713 -1.72533696 0.00000000 1.00000000 1.00000000 +v 1.40409289 0.32124407 -1.38756096 0.00000000 1.00000000 1.00000000 +v 0.85065081 1.17557050 -1.37638192 0.00000000 1.00000000 1.00000000 +v 0.52573111 0.32491970 -1.90211303 0.00000000 1.00000000 1.00000000 +v 1.37638192 0.85065081 -1.17557050 0.00000000 1.00000000 1.00000000 +v 1.05146222 0.00000000 -1.70130162 0.00000000 1.00000000 1.00000000 +v 1.38756096 1.40409289 0.32124407 0.00000000 1.00000000 1.00000000 +v 1.72533696 0.51978383 0.86777713 0.00000000 1.00000000 1.00000000 +v 1.17557050 1.37638192 0.85065081 0.00000000 1.00000000 1.00000000 +v 1.70130162 1.05146222 0.00000000 0.00000000 1.00000000 1.00000000 +v 1.38756096 -1.40409289 0.32124407 0.00000000 1.00000000 1.00000000 +v 1.72533696 -0.51978383 0.86777713 0.00000000 1.00000000 1.00000000 +v 1.17557050 -1.37638192 0.85065081 0.00000000 1.00000000 1.00000000 +v 1.70130162 -1.05146222 0.00000000 0.00000000 1.00000000 1.00000000 +v 0.51978383 -0.86777713 1.72533696 0.00000000 1.00000000 1.00000000 +v 1.40409289 -0.32124407 1.38756096 0.00000000 1.00000000 1.00000000 +v 0.85065081 -1.17557050 1.37638192 0.00000000 1.00000000 1.00000000 +v 0.52573111 -0.32491970 1.90211303 0.00000000 1.00000000 1.00000000 +v 1.37638192 -0.85065081 1.17557050 0.00000000 1.00000000 1.00000000 +v 0.51978383 0.86777713 1.72533696 0.00000000 1.00000000 1.00000000 +v 1.40409289 0.32124407 1.38756096 0.00000000 1.00000000 1.00000000 +v 0.85065081 1.17557050 1.37638192 0.00000000 1.00000000 1.00000000 +v 0.52573111 0.32491970 1.90211303 0.00000000 1.00000000 1.00000000 +v 1.37638192 0.85065081 1.17557050 0.00000000 1.00000000 1.00000000 +v 1.05146222 0.00000000 1.70130162 0.00000000 1.00000000 1.00000000 +v 1.92387672 0.00000000 -0.54653306 0.00000000 1.00000000 1.00000000 +v 1.92387672 0.00000000 0.54653306 0.00000000 1.00000000 1.00000000 +v 1.90211303 0.52573111 -0.32491970 0.00000000 1.00000000 1.00000000 +v 1.90211303 -0.52573111 -0.32491970 0.00000000 1.00000000 1.00000000 +v 1.90211303 0.52573111 0.32491970 0.00000000 1.00000000 1.00000000 +v 1.90211303 -0.52573111 0.32491970 0.00000000 1.00000000 1.00000000 +v -1.38756096 1.40409289 -0.32124407 0.00000000 1.00000000 1.00000000 +v -1.72533696 0.51978383 -0.86777713 0.00000000 1.00000000 1.00000000 +v -1.17557050 1.37638192 -0.85065081 0.00000000 1.00000000 1.00000000 +v -1.38756096 -1.40409289 -0.32124407 0.00000000 1.00000000 1.00000000 +v -1.72533696 -0.51978383 -0.86777713 0.00000000 1.00000000 1.00000000 +v -1.17557050 -1.37638192 -0.85065081 0.00000000 1.00000000 1.00000000 +v -0.51978383 -0.86777713 -1.72533696 0.00000000 1.00000000 1.00000000 +v -1.40409289 -0.32124407 -1.38756096 0.00000000 1.00000000 1.00000000 +v -0.85065081 -1.17557050 -1.37638192 0.00000000 1.00000000 1.00000000 +v -0.52573111 -0.32491970 -1.90211303 0.00000000 1.00000000 1.00000000 +v -1.37638192 -0.85065081 -1.17557050 0.00000000 1.00000000 1.00000000 +v -0.51978383 0.86777713 -1.72533696 0.00000000 1.00000000 1.00000000 +v -1.40409289 0.32124407 -1.38756096 0.00000000 1.00000000 1.00000000 +v -0.85065081 1.17557050 -1.37638192 0.00000000 1.00000000 1.00000000 +v -0.52573111 0.32491970 -1.90211303 0.00000000 1.00000000 1.00000000 +v -1.37638192 0.85065081 -1.17557050 0.00000000 1.00000000 1.00000000 +v -1.05146222 0.00000000 -1.70130162 0.00000000 1.00000000 1.00000000 +v -1.38756096 1.40409289 0.32124407 0.00000000 1.00000000 1.00000000 +v -1.72533696 0.51978383 0.86777713 0.00000000 1.00000000 1.00000000 +v -1.17557050 1.37638192 0.85065081 0.00000000 1.00000000 1.00000000 +v -1.70130162 1.05146222 0.00000000 0.00000000 1.00000000 1.00000000 +v -1.38756096 -1.40409289 0.32124407 0.00000000 1.00000000 1.00000000 +v -1.72533696 -0.51978383 0.86777713 0.00000000 1.00000000 1.00000000 +v -1.17557050 -1.37638192 0.85065081 0.00000000 1.00000000 1.00000000 +v -1.70130162 -1.05146222 0.00000000 0.00000000 1.00000000 1.00000000 +v -0.51978383 -0.86777713 1.72533696 0.00000000 1.00000000 1.00000000 +v -1.40409289 -0.32124407 1.38756096 0.00000000 1.00000000 1.00000000 +v -0.85065081 -1.17557050 1.37638192 0.00000000 1.00000000 1.00000000 +v -0.52573111 -0.32491970 1.90211303 0.00000000 1.00000000 1.00000000 +v -1.37638192 -0.85065081 1.17557050 0.00000000 1.00000000 1.00000000 +v -0.51978383 0.86777713 1.72533696 0.00000000 1.00000000 1.00000000 +v -1.40409289 0.32124407 1.38756096 0.00000000 1.00000000 1.00000000 +v -0.85065081 1.17557050 1.37638192 0.00000000 1.00000000 1.00000000 +v -0.52573111 0.32491970 1.90211303 0.00000000 1.00000000 1.00000000 +v -1.37638192 0.85065081 1.17557050 0.00000000 1.00000000 1.00000000 +v -1.05146222 0.00000000 1.70130162 0.00000000 1.00000000 1.00000000 +v -1.92387672 0.00000000 -0.54653306 0.00000000 1.00000000 1.00000000 +v -1.92387672 0.00000000 0.54653306 0.00000000 1.00000000 1.00000000 +v -1.90211303 0.52573111 -0.32491970 0.00000000 1.00000000 1.00000000 +v -1.90211303 -0.52573111 -0.32491970 0.00000000 1.00000000 1.00000000 +v -1.90211303 0.52573111 0.32491970 0.00000000 1.00000000 1.00000000 +v -1.90211303 -0.52573111 0.32491970 0.00000000 1.00000000 1.00000000 +f 1 138 54 +f 138 38 140 +f 54 140 17 +f 138 140 54 +f 38 139 155 +f 139 12 152 +f 155 152 41 +f 139 152 155 +f 17 153 55 +f 153 41 151 +f 55 151 6 +f 153 151 55 +f 38 155 140 +f 155 41 153 +f 140 153 17 +f 155 153 140 +f 1 54 43 +f 54 17 56 +f 43 56 13 +f 54 56 43 +f 17 55 60 +f 55 6 58 +f 60 58 18 +f 55 58 60 +f 13 59 44 +f 59 18 57 +f 44 57 2 +f 59 57 44 +f 17 60 56 +f 60 18 59 +f 56 59 13 +f 60 59 56 +f 1 43 70 +f 43 13 72 +f 70 72 22 +f 43 72 70 +f 13 44 75 +f 44 2 73 +f 75 73 23 +f 44 73 75 +f 22 76 71 +f 76 23 74 +f 71 74 8 +f 76 74 71 +f 13 75 72 +f 75 23 76 +f 72 76 22 +f 75 76 72 +f 1 70 121 +f 70 22 123 +f 121 123 34 +f 70 123 121 +f 22 71 134 +f 71 8 132 +f 134 132 37 +f 71 132 134 +f 34 136 122 +f 136 37 133 +f 122 133 11 +f 136 133 122 +f 22 134 123 +f 134 37 136 +f 123 136 34 +f 134 136 123 +f 1 121 138 +f 121 34 141 +f 138 141 38 +f 121 141 138 +f 34 122 159 +f 122 11 157 +f 159 157 42 +f 122 157 159 +f 38 161 139 +f 161 42 158 +f 139 158 12 +f 161 158 139 +f 34 159 141 +f 159 42 161 +f 141 161 38 +f 159 161 141 +f 2 57 96 +f 57 18 98 +f 96 98 29 +f 57 98 96 +f 18 58 111 +f 58 6 109 +f 111 109 32 +f 58 109 111 +f 29 113 97 +f 113 32 110 +f 97 110 10 +f 113 110 97 +f 18 111 98 +f 111 32 113 +f 98 113 29 +f 111 113 98 +f 6 151 62 +f 151 41 154 +f 62 154 19 +f 151 154 62 +f 41 152 156 +f 152 12 147 +f 156 147 40 +f 152 147 156 +f 19 149 61 +f 149 40 146 +f 61 146 5 +f 149 146 61 +f 41 156 154 +f 156 40 149 +f 154 149 19 +f 156 149 154 +f 12 158 143 +f 158 42 162 +f 143 162 39 +f 158 162 143 +f 42 157 160 +f 157 11 125 +f 160 125 35 +f 157 125 160 +f 39 145 142 +f 145 35 124 +f 142 124 3 +f 145 124 142 +f 42 160 162 +f 160 35 145 +f 162 145 39 +f 160 145 162 +f 11 133 128 +f 133 37 137 +f 128 137 36 +f 133 137 128 +f 37 132 135 +f 132 8 78 +f 135 78 24 +f 132 78 135 +f 36 130 127 +f 130 24 77 +f 127 77 7 +f 130 77 127 +f 37 135 137 +f 135 24 130 +f 137 130 36 +f 135 130 137 +f 8 74 90 +f 74 23 92 +f 90 92 28 +f 74 92 90 +f 23 73 81 +f 73 2 79 +f 81 79 25 +f 73 79 81 +f 28 94 91 +f 94 25 80 +f 91 80 9 +f 94 80 91 +f 23 81 92 +f 81 25 94 +f 92 94 28 +f 81 94 92 +f 4 100 50 +f 100 30 102 +f 50 102 16 +f 100 102 50 +f 30 101 108 +f 101 10 105 +f 108 105 31 +f 101 105 108 +f 16 106 51 +f 106 31 104 +f 51 104 5 +f 106 104 51 +f 30 108 102 +f 108 31 106 +f 102 106 16 +f 108 106 102 +f 4 50 46 +f 50 16 52 +f 46 52 14 +f 50 52 46 +f 16 51 53 +f 51 5 48 +f 53 48 15 +f 51 48 53 +f 14 49 45 +f 49 15 47 +f 45 47 3 +f 49 47 45 +f 16 53 52 +f 53 15 49 +f 52 49 14 +f 53 49 52 +f 4 46 66 +f 46 14 68 +f 66 68 21 +f 46 68 66 +f 14 45 65 +f 45 3 63 +f 65 63 20 +f 45 63 65 +f 21 69 67 +f 69 20 64 +f 67 64 7 +f 69 64 67 +f 14 65 68 +f 65 20 69 +f 68 69 21 +f 65 69 68 +f 4 66 82 +f 66 21 84 +f 82 84 26 +f 66 84 82 +f 21 67 87 +f 67 7 85 +f 87 85 27 +f 67 85 87 +f 26 89 83 +f 89 27 86 +f 83 86 9 +f 89 86 83 +f 21 87 84 +f 87 27 89 +f 84 89 26 +f 87 89 84 +f 4 82 100 +f 82 26 103 +f 100 103 30 +f 82 103 100 +f 26 83 118 +f 83 9 115 +f 118 115 33 +f 83 115 118 +f 30 120 101 +f 120 33 116 +f 101 116 10 +f 120 116 101 +f 26 118 103 +f 118 33 120 +f 103 120 30 +f 118 120 103 +f 5 104 61 +f 104 31 107 +f 61 107 19 +f 104 107 61 +f 31 105 114 +f 105 10 110 +f 114 110 32 +f 105 110 114 +f 19 112 62 +f 112 32 109 +f 62 109 6 +f 112 109 62 +f 31 114 107 +f 114 32 112 +f 107 112 19 +f 114 112 107 +f 3 47 142 +f 47 15 144 +f 142 144 39 +f 47 144 142 +f 15 48 148 +f 48 5 146 +f 148 146 40 +f 48 146 148 +f 39 150 143 +f 150 40 147 +f 143 147 12 +f 150 147 143 +f 15 148 144 +f 148 40 150 +f 144 150 39 +f 148 150 144 +f 7 64 127 +f 64 20 129 +f 127 129 36 +f 64 129 127 +f 20 63 126 +f 63 3 124 +f 126 124 35 +f 63 124 126 +f 36 131 128 +f 131 35 125 +f 128 125 11 +f 131 125 128 +f 20 126 129 +f 126 35 131 +f 129 131 36 +f 126 131 129 +f 9 86 91 +f 86 27 95 +f 91 95 28 +f 86 95 91 +f 27 85 88 +f 85 7 77 +f 88 77 24 +f 85 77 88 +f 28 93 90 +f 93 24 78 +f 90 78 8 +f 93 78 90 +f 27 88 95 +f 88 24 93 +f 95 93 28 +f 88 93 95 +f 10 116 97 +f 116 33 119 +f 97 119 29 +f 116 119 97 +f 33 115 117 +f 115 9 80 +f 117 80 25 +f 115 80 117 +f 29 99 96 +f 99 25 79 +f 96 79 2 +f 99 79 96 +f 33 117 119 +f 117 25 99 +f 119 99 29 +f 117 99 119 \ No newline at end of file diff --git a/cellpack/tests/geometry/sphere_4.obj b/cellpack/tests/geometry/sphere_4.obj new file mode 100644 index 000000000..3175e6118 --- /dev/null +++ b/cellpack/tests/geometry/sphere_4.obj @@ -0,0 +1,483 @@ +# https://github.com/mikedh/trimesh +v -2.10292445 3.40260323 0.00000000 1.00000000 0.00000000 1.00000000 +v 2.10292445 3.40260323 0.00000000 1.00000000 0.00000000 1.00000000 +v -2.10292445 -3.40260323 0.00000000 1.00000000 0.00000000 1.00000000 +v 2.10292445 -3.40260323 0.00000000 1.00000000 0.00000000 1.00000000 +v 0.00000000 -2.10292445 3.40260323 1.00000000 0.00000000 1.00000000 +v 0.00000000 2.10292445 3.40260323 1.00000000 0.00000000 1.00000000 +v 0.00000000 -2.10292445 -3.40260323 1.00000000 0.00000000 1.00000000 +v 0.00000000 2.10292445 -3.40260323 1.00000000 0.00000000 1.00000000 +v 3.40260323 0.00000000 -2.10292445 1.00000000 0.00000000 1.00000000 +v 3.40260323 0.00000000 2.10292445 1.00000000 0.00000000 1.00000000 +v -3.40260323 0.00000000 -2.10292445 1.00000000 0.00000000 1.00000000 +v -3.40260323 0.00000000 2.10292445 1.00000000 0.00000000 1.00000000 +v 0.00000000 4.00000000 0.00000000 1.00000000 0.00000000 1.00000000 +v 0.00000000 -4.00000000 0.00000000 1.00000000 0.00000000 1.00000000 +v -1.23606798 -3.23606798 2.00000000 1.00000000 0.00000000 1.00000000 +v 1.23606798 -3.23606798 2.00000000 1.00000000 0.00000000 1.00000000 +v -1.23606798 3.23606798 2.00000000 1.00000000 0.00000000 1.00000000 +v 1.23606798 3.23606798 2.00000000 1.00000000 0.00000000 1.00000000 +v 0.00000000 0.00000000 4.00000000 1.00000000 0.00000000 1.00000000 +v -1.23606798 -3.23606798 -2.00000000 1.00000000 0.00000000 1.00000000 +v 1.23606798 -3.23606798 -2.00000000 1.00000000 0.00000000 1.00000000 +v -1.23606798 3.23606798 -2.00000000 1.00000000 0.00000000 1.00000000 +v 1.23606798 3.23606798 -2.00000000 1.00000000 0.00000000 1.00000000 +v 0.00000000 0.00000000 -4.00000000 1.00000000 0.00000000 1.00000000 +v 3.23606798 2.00000000 -1.23606798 1.00000000 0.00000000 1.00000000 +v 3.23606798 -2.00000000 -1.23606798 1.00000000 0.00000000 1.00000000 +v 2.00000000 -1.23606798 -3.23606798 1.00000000 0.00000000 1.00000000 +v 2.00000000 1.23606798 -3.23606798 1.00000000 0.00000000 1.00000000 +v 3.23606798 2.00000000 1.23606798 1.00000000 0.00000000 1.00000000 +v 3.23606798 -2.00000000 1.23606798 1.00000000 0.00000000 1.00000000 +v 2.00000000 -1.23606798 3.23606798 1.00000000 0.00000000 1.00000000 +v 2.00000000 1.23606798 3.23606798 1.00000000 0.00000000 1.00000000 +v 4.00000000 0.00000000 0.00000000 1.00000000 0.00000000 1.00000000 +v -3.23606798 2.00000000 -1.23606798 1.00000000 0.00000000 1.00000000 +v -3.23606798 -2.00000000 -1.23606798 1.00000000 0.00000000 1.00000000 +v -2.00000000 -1.23606798 -3.23606798 1.00000000 0.00000000 1.00000000 +v -2.00000000 1.23606798 -3.23606798 1.00000000 0.00000000 1.00000000 +v -3.23606798 2.00000000 1.23606798 1.00000000 0.00000000 1.00000000 +v -3.23606798 -2.00000000 1.23606798 1.00000000 0.00000000 1.00000000 +v -2.00000000 -1.23606798 3.23606798 1.00000000 0.00000000 1.00000000 +v -2.00000000 1.23606798 3.23606798 1.00000000 0.00000000 1.00000000 +v -4.00000000 0.00000000 0.00000000 1.00000000 0.00000000 1.00000000 +v -1.09306612 3.84775343 0.00000000 1.00000000 0.00000000 1.00000000 +v 1.09306612 3.84775343 0.00000000 1.00000000 0.00000000 1.00000000 +v -1.09306612 -3.84775343 0.00000000 1.00000000 0.00000000 1.00000000 +v 1.09306612 -3.84775343 0.00000000 1.00000000 0.00000000 1.00000000 +v -1.73555426 -3.45067392 1.03956765 1.00000000 0.00000000 1.00000000 +v -0.64248814 -2.77512191 2.80818578 1.00000000 0.00000000 1.00000000 +v -0.64983939 -3.80422607 1.05146222 1.00000000 0.00000000 1.00000000 +v 1.73555426 -3.45067392 1.03956765 1.00000000 0.00000000 1.00000000 +v 0.64248814 -2.77512191 2.80818578 1.00000000 0.00000000 1.00000000 +v 0.64983939 -3.80422607 1.05146222 1.00000000 0.00000000 1.00000000 +v 0.00000000 -3.40260323 2.10292445 1.00000000 0.00000000 1.00000000 +v -1.73555426 3.45067392 1.03956765 1.00000000 0.00000000 1.00000000 +v -0.64248814 2.77512191 2.80818578 1.00000000 0.00000000 1.00000000 +v -0.64983939 3.80422607 1.05146222 1.00000000 0.00000000 1.00000000 +v 1.73555426 3.45067392 1.03956765 1.00000000 0.00000000 1.00000000 +v 0.64248814 2.77512191 2.80818578 1.00000000 0.00000000 1.00000000 +v 0.64983939 3.80422607 1.05146222 1.00000000 0.00000000 1.00000000 +v 0.00000000 3.40260323 2.10292445 1.00000000 0.00000000 1.00000000 +v 0.00000000 -1.09306612 3.84775343 1.00000000 0.00000000 1.00000000 +v 0.00000000 1.09306612 3.84775343 1.00000000 0.00000000 1.00000000 +v -1.73555426 -3.45067392 -1.03956765 1.00000000 0.00000000 1.00000000 +v -0.64248814 -2.77512191 -2.80818578 1.00000000 0.00000000 1.00000000 +v -0.64983939 -3.80422607 -1.05146222 1.00000000 0.00000000 1.00000000 +v 1.73555426 -3.45067392 -1.03956765 1.00000000 0.00000000 1.00000000 +v 0.64248814 -2.77512191 -2.80818578 1.00000000 0.00000000 1.00000000 +v 0.64983939 -3.80422607 -1.05146222 1.00000000 0.00000000 1.00000000 +v 0.00000000 -3.40260323 -2.10292445 1.00000000 0.00000000 1.00000000 +v -1.73555426 3.45067392 -1.03956765 1.00000000 0.00000000 1.00000000 +v -0.64248814 2.77512191 -2.80818578 1.00000000 0.00000000 1.00000000 +v -0.64983939 3.80422607 -1.05146222 1.00000000 0.00000000 1.00000000 +v 1.73555426 3.45067392 -1.03956765 1.00000000 0.00000000 1.00000000 +v 0.64248814 2.77512191 -2.80818578 1.00000000 0.00000000 1.00000000 +v 0.64983939 3.80422607 -1.05146222 1.00000000 0.00000000 1.00000000 +v 0.00000000 3.40260323 -2.10292445 1.00000000 0.00000000 1.00000000 +v 0.00000000 -1.09306612 -3.84775343 1.00000000 0.00000000 1.00000000 +v 0.00000000 1.09306612 -3.84775343 1.00000000 0.00000000 1.00000000 +v 2.77512191 2.80818578 -0.64248814 1.00000000 0.00000000 1.00000000 +v 3.45067392 1.03956765 -1.73555426 1.00000000 0.00000000 1.00000000 +v 2.35114101 2.75276384 -1.70130162 1.00000000 0.00000000 1.00000000 +v 2.77512191 -2.80818578 -0.64248814 1.00000000 0.00000000 1.00000000 +v 3.45067392 -1.03956765 -1.73555426 1.00000000 0.00000000 1.00000000 +v 2.35114101 -2.75276384 -1.70130162 1.00000000 0.00000000 1.00000000 +v 1.03956765 -1.73555426 -3.45067392 1.00000000 0.00000000 1.00000000 +v 2.80818578 -0.64248814 -2.77512191 1.00000000 0.00000000 1.00000000 +v 1.70130162 -2.35114101 -2.75276384 1.00000000 0.00000000 1.00000000 +v 1.05146222 -0.64983939 -3.80422607 1.00000000 0.00000000 1.00000000 +v 2.75276384 -1.70130162 -2.35114101 1.00000000 0.00000000 1.00000000 +v 1.03956765 1.73555426 -3.45067392 1.00000000 0.00000000 1.00000000 +v 2.80818578 0.64248814 -2.77512191 1.00000000 0.00000000 1.00000000 +v 1.70130162 2.35114101 -2.75276384 1.00000000 0.00000000 1.00000000 +v 1.05146222 0.64983939 -3.80422607 1.00000000 0.00000000 1.00000000 +v 2.75276384 1.70130162 -2.35114101 1.00000000 0.00000000 1.00000000 +v 2.10292445 0.00000000 -3.40260323 1.00000000 0.00000000 1.00000000 +v 2.77512191 2.80818578 0.64248814 1.00000000 0.00000000 1.00000000 +v 3.45067392 1.03956765 1.73555426 1.00000000 0.00000000 1.00000000 +v 2.35114101 2.75276384 1.70130162 1.00000000 0.00000000 1.00000000 +v 3.40260323 2.10292445 0.00000000 1.00000000 0.00000000 1.00000000 +v 2.77512191 -2.80818578 0.64248814 1.00000000 0.00000000 1.00000000 +v 3.45067392 -1.03956765 1.73555426 1.00000000 0.00000000 1.00000000 +v 2.35114101 -2.75276384 1.70130162 1.00000000 0.00000000 1.00000000 +v 3.40260323 -2.10292445 0.00000000 1.00000000 0.00000000 1.00000000 +v 1.03956765 -1.73555426 3.45067392 1.00000000 0.00000000 1.00000000 +v 2.80818578 -0.64248814 2.77512191 1.00000000 0.00000000 1.00000000 +v 1.70130162 -2.35114101 2.75276384 1.00000000 0.00000000 1.00000000 +v 1.05146222 -0.64983939 3.80422607 1.00000000 0.00000000 1.00000000 +v 2.75276384 -1.70130162 2.35114101 1.00000000 0.00000000 1.00000000 +v 1.03956765 1.73555426 3.45067392 1.00000000 0.00000000 1.00000000 +v 2.80818578 0.64248814 2.77512191 1.00000000 0.00000000 1.00000000 +v 1.70130162 2.35114101 2.75276384 1.00000000 0.00000000 1.00000000 +v 1.05146222 0.64983939 3.80422607 1.00000000 0.00000000 1.00000000 +v 2.75276384 1.70130162 2.35114101 1.00000000 0.00000000 1.00000000 +v 2.10292445 0.00000000 3.40260323 1.00000000 0.00000000 1.00000000 +v 3.84775343 0.00000000 -1.09306612 1.00000000 0.00000000 1.00000000 +v 3.84775343 0.00000000 1.09306612 1.00000000 0.00000000 1.00000000 +v 3.80422607 1.05146222 -0.64983939 1.00000000 0.00000000 1.00000000 +v 3.80422607 -1.05146222 -0.64983939 1.00000000 0.00000000 1.00000000 +v 3.80422607 1.05146222 0.64983939 1.00000000 0.00000000 1.00000000 +v 3.80422607 -1.05146222 0.64983939 1.00000000 0.00000000 1.00000000 +v -2.77512191 2.80818578 -0.64248814 1.00000000 0.00000000 1.00000000 +v -3.45067392 1.03956765 -1.73555426 1.00000000 0.00000000 1.00000000 +v -2.35114101 2.75276384 -1.70130162 1.00000000 0.00000000 1.00000000 +v -2.77512191 -2.80818578 -0.64248814 1.00000000 0.00000000 1.00000000 +v -3.45067392 -1.03956765 -1.73555426 1.00000000 0.00000000 1.00000000 +v -2.35114101 -2.75276384 -1.70130162 1.00000000 0.00000000 1.00000000 +v -1.03956765 -1.73555426 -3.45067392 1.00000000 0.00000000 1.00000000 +v -2.80818578 -0.64248814 -2.77512191 1.00000000 0.00000000 1.00000000 +v -1.70130162 -2.35114101 -2.75276384 1.00000000 0.00000000 1.00000000 +v -1.05146222 -0.64983939 -3.80422607 1.00000000 0.00000000 1.00000000 +v -2.75276384 -1.70130162 -2.35114101 1.00000000 0.00000000 1.00000000 +v -1.03956765 1.73555426 -3.45067392 1.00000000 0.00000000 1.00000000 +v -2.80818578 0.64248814 -2.77512191 1.00000000 0.00000000 1.00000000 +v -1.70130162 2.35114101 -2.75276384 1.00000000 0.00000000 1.00000000 +v -1.05146222 0.64983939 -3.80422607 1.00000000 0.00000000 1.00000000 +v -2.75276384 1.70130162 -2.35114101 1.00000000 0.00000000 1.00000000 +v -2.10292445 0.00000000 -3.40260323 1.00000000 0.00000000 1.00000000 +v -2.77512191 2.80818578 0.64248814 1.00000000 0.00000000 1.00000000 +v -3.45067392 1.03956765 1.73555426 1.00000000 0.00000000 1.00000000 +v -2.35114101 2.75276384 1.70130162 1.00000000 0.00000000 1.00000000 +v -3.40260323 2.10292445 0.00000000 1.00000000 0.00000000 1.00000000 +v -2.77512191 -2.80818578 0.64248814 1.00000000 0.00000000 1.00000000 +v -3.45067392 -1.03956765 1.73555426 1.00000000 0.00000000 1.00000000 +v -2.35114101 -2.75276384 1.70130162 1.00000000 0.00000000 1.00000000 +v -3.40260323 -2.10292445 0.00000000 1.00000000 0.00000000 1.00000000 +v -1.03956765 -1.73555426 3.45067392 1.00000000 0.00000000 1.00000000 +v -2.80818578 -0.64248814 2.77512191 1.00000000 0.00000000 1.00000000 +v -1.70130162 -2.35114101 2.75276384 1.00000000 0.00000000 1.00000000 +v -1.05146222 -0.64983939 3.80422607 1.00000000 0.00000000 1.00000000 +v -2.75276384 -1.70130162 2.35114101 1.00000000 0.00000000 1.00000000 +v -1.03956765 1.73555426 3.45067392 1.00000000 0.00000000 1.00000000 +v -2.80818578 0.64248814 2.77512191 1.00000000 0.00000000 1.00000000 +v -1.70130162 2.35114101 2.75276384 1.00000000 0.00000000 1.00000000 +v -1.05146222 0.64983939 3.80422607 1.00000000 0.00000000 1.00000000 +v -2.75276384 1.70130162 2.35114101 1.00000000 0.00000000 1.00000000 +v -2.10292445 0.00000000 3.40260323 1.00000000 0.00000000 1.00000000 +v -3.84775343 0.00000000 -1.09306612 1.00000000 0.00000000 1.00000000 +v -3.84775343 0.00000000 1.09306612 1.00000000 0.00000000 1.00000000 +v -3.80422607 1.05146222 -0.64983939 1.00000000 0.00000000 1.00000000 +v -3.80422607 -1.05146222 -0.64983939 1.00000000 0.00000000 1.00000000 +v -3.80422607 1.05146222 0.64983939 1.00000000 0.00000000 1.00000000 +v -3.80422607 -1.05146222 0.64983939 1.00000000 0.00000000 1.00000000 +f 1 138 54 +f 138 38 140 +f 54 140 17 +f 138 140 54 +f 38 139 155 +f 139 12 152 +f 155 152 41 +f 139 152 155 +f 17 153 55 +f 153 41 151 +f 55 151 6 +f 153 151 55 +f 38 155 140 +f 155 41 153 +f 140 153 17 +f 155 153 140 +f 1 54 43 +f 54 17 56 +f 43 56 13 +f 54 56 43 +f 17 55 60 +f 55 6 58 +f 60 58 18 +f 55 58 60 +f 13 59 44 +f 59 18 57 +f 44 57 2 +f 59 57 44 +f 17 60 56 +f 60 18 59 +f 56 59 13 +f 60 59 56 +f 1 43 70 +f 43 13 72 +f 70 72 22 +f 43 72 70 +f 13 44 75 +f 44 2 73 +f 75 73 23 +f 44 73 75 +f 22 76 71 +f 76 23 74 +f 71 74 8 +f 76 74 71 +f 13 75 72 +f 75 23 76 +f 72 76 22 +f 75 76 72 +f 1 70 121 +f 70 22 123 +f 121 123 34 +f 70 123 121 +f 22 71 134 +f 71 8 132 +f 134 132 37 +f 71 132 134 +f 34 136 122 +f 136 37 133 +f 122 133 11 +f 136 133 122 +f 22 134 123 +f 134 37 136 +f 123 136 34 +f 134 136 123 +f 1 121 138 +f 121 34 141 +f 138 141 38 +f 121 141 138 +f 34 122 159 +f 122 11 157 +f 159 157 42 +f 122 157 159 +f 38 161 139 +f 161 42 158 +f 139 158 12 +f 161 158 139 +f 34 159 141 +f 159 42 161 +f 141 161 38 +f 159 161 141 +f 2 57 96 +f 57 18 98 +f 96 98 29 +f 57 98 96 +f 18 58 111 +f 58 6 109 +f 111 109 32 +f 58 109 111 +f 29 113 97 +f 113 32 110 +f 97 110 10 +f 113 110 97 +f 18 111 98 +f 111 32 113 +f 98 113 29 +f 111 113 98 +f 6 151 62 +f 151 41 154 +f 62 154 19 +f 151 154 62 +f 41 152 156 +f 152 12 147 +f 156 147 40 +f 152 147 156 +f 19 149 61 +f 149 40 146 +f 61 146 5 +f 149 146 61 +f 41 156 154 +f 156 40 149 +f 154 149 19 +f 156 149 154 +f 12 158 143 +f 158 42 162 +f 143 162 39 +f 158 162 143 +f 42 157 160 +f 157 11 125 +f 160 125 35 +f 157 125 160 +f 39 145 142 +f 145 35 124 +f 142 124 3 +f 145 124 142 +f 42 160 162 +f 160 35 145 +f 162 145 39 +f 160 145 162 +f 11 133 128 +f 133 37 137 +f 128 137 36 +f 133 137 128 +f 37 132 135 +f 132 8 78 +f 135 78 24 +f 132 78 135 +f 36 130 127 +f 130 24 77 +f 127 77 7 +f 130 77 127 +f 37 135 137 +f 135 24 130 +f 137 130 36 +f 135 130 137 +f 8 74 90 +f 74 23 92 +f 90 92 28 +f 74 92 90 +f 23 73 81 +f 73 2 79 +f 81 79 25 +f 73 79 81 +f 28 94 91 +f 94 25 80 +f 91 80 9 +f 94 80 91 +f 23 81 92 +f 81 25 94 +f 92 94 28 +f 81 94 92 +f 4 100 50 +f 100 30 102 +f 50 102 16 +f 100 102 50 +f 30 101 108 +f 101 10 105 +f 108 105 31 +f 101 105 108 +f 16 106 51 +f 106 31 104 +f 51 104 5 +f 106 104 51 +f 30 108 102 +f 108 31 106 +f 102 106 16 +f 108 106 102 +f 4 50 46 +f 50 16 52 +f 46 52 14 +f 50 52 46 +f 16 51 53 +f 51 5 48 +f 53 48 15 +f 51 48 53 +f 14 49 45 +f 49 15 47 +f 45 47 3 +f 49 47 45 +f 16 53 52 +f 53 15 49 +f 52 49 14 +f 53 49 52 +f 4 46 66 +f 46 14 68 +f 66 68 21 +f 46 68 66 +f 14 45 65 +f 45 3 63 +f 65 63 20 +f 45 63 65 +f 21 69 67 +f 69 20 64 +f 67 64 7 +f 69 64 67 +f 14 65 68 +f 65 20 69 +f 68 69 21 +f 65 69 68 +f 4 66 82 +f 66 21 84 +f 82 84 26 +f 66 84 82 +f 21 67 87 +f 67 7 85 +f 87 85 27 +f 67 85 87 +f 26 89 83 +f 89 27 86 +f 83 86 9 +f 89 86 83 +f 21 87 84 +f 87 27 89 +f 84 89 26 +f 87 89 84 +f 4 82 100 +f 82 26 103 +f 100 103 30 +f 82 103 100 +f 26 83 118 +f 83 9 115 +f 118 115 33 +f 83 115 118 +f 30 120 101 +f 120 33 116 +f 101 116 10 +f 120 116 101 +f 26 118 103 +f 118 33 120 +f 103 120 30 +f 118 120 103 +f 5 104 61 +f 104 31 107 +f 61 107 19 +f 104 107 61 +f 31 105 114 +f 105 10 110 +f 114 110 32 +f 105 110 114 +f 19 112 62 +f 112 32 109 +f 62 109 6 +f 112 109 62 +f 31 114 107 +f 114 32 112 +f 107 112 19 +f 114 112 107 +f 3 47 142 +f 47 15 144 +f 142 144 39 +f 47 144 142 +f 15 48 148 +f 48 5 146 +f 148 146 40 +f 48 146 148 +f 39 150 143 +f 150 40 147 +f 143 147 12 +f 150 147 143 +f 15 148 144 +f 148 40 150 +f 144 150 39 +f 148 150 144 +f 7 64 127 +f 64 20 129 +f 127 129 36 +f 64 129 127 +f 20 63 126 +f 63 3 124 +f 126 124 35 +f 63 124 126 +f 36 131 128 +f 131 35 125 +f 128 125 11 +f 131 125 128 +f 20 126 129 +f 126 35 131 +f 129 131 36 +f 126 131 129 +f 9 86 91 +f 86 27 95 +f 91 95 28 +f 86 95 91 +f 27 85 88 +f 85 7 77 +f 88 77 24 +f 85 77 88 +f 28 93 90 +f 93 24 78 +f 90 78 8 +f 93 78 90 +f 27 88 95 +f 88 24 93 +f 95 93 28 +f 88 93 95 +f 10 116 97 +f 116 33 119 +f 97 119 29 +f 116 119 97 +f 33 115 117 +f 115 9 80 +f 117 80 25 +f 115 80 117 +f 29 99 96 +f 99 25 79 +f 96 79 2 +f 99 79 96 +f 33 117 119 +f 117 25 99 +f 119 99 29 +f 117 99 119 \ No newline at end of file diff --git a/cellpack/tests/recipes/v2/test_nested_mesh_gradient.json b/cellpack/tests/recipes/v2/test_nested_mesh_gradient.json new file mode 100644 index 000000000..3df99957c --- /dev/null +++ b/cellpack/tests/recipes/v2/test_nested_mesh_gradient.json @@ -0,0 +1,104 @@ +{ + "version": "1.0.0", + "format_version": "2.1", + "name": "test_nested_mesh_gradient", + "bounding_box": [ + [ + -5, + -5, + -5 + ], + [ + 5, + 5, + 5 + ] + ], + "gradients": { + "surface_gradient": { + "description": "gradient based on distance from the surface of a mesh", + "pick_mode": "rnd", + "mode": "surface", + "mode_settings": { + "object": "nucleus", + "scale_to_next_surface": false, + "weight_mode": "exponential" + }, + "weight_mode_settings": { + "decay_length": 0.3 + } + } + }, + "objects": { + "membrane_mesh": { + "type": "mesh", + "color": [ + 1, + 0, + 1 + ], + "representations": { + "mesh": { + "path": "cellpack/tests/geometry", + "name": "sphere_4.obj", + "format": "obj" + } + } + }, + "nucleus_mesh": { + "type": "mesh", + "color": [ + 0, + 1, + 1 + ], + "representations": { + "mesh": { + "path": "cellpack/tests/geometry", + "name": "sphere_2.obj", + "format": "obj" + } + } + }, + "primitive_sphere": { + "type": "single_sphere", + "color": [ + 0.2, + 0.7, + 0.1 + ], + "radius": 0.5, + "packing_mode": "gradient", + "gradient": "surface_gradient" + } + }, + "composition": { + "bounding_area": { + "regions": { + "interior": [ + "membrane" + ] + } + }, + "membrane": { + "object": "membrane_mesh", + "count": 1, + "regions": { + "interior": [ + "nucleus", + { + "object": "primitive_sphere", + "count": 100 + } + ] + } + }, + "nucleus": { + "object": "nucleus_mesh", + "count": 1, + "regions": { + "interior": [] + } + } + } +} \ No newline at end of file diff --git a/cellpack/tests/recipes/v2/test_variable_count.json b/cellpack/tests/recipes/v2/test_variable_count.json index af06457dc..94bcf165c 100644 --- a/cellpack/tests/recipes/v2/test_variable_count.json +++ b/cellpack/tests/recipes/v2/test_variable_count.json @@ -83,5 +83,6 @@ "max": 15 } } - } + }, + "randomness_seed": 0 } \ No newline at end of file