Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
ed4141e2
Commit
ed4141e2
authored
1 month ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Raise an error if compact generator with different radii is used
parent
33ce0d93
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scripts/model_maker.py
+10
-7
10 additions, 7 deletions
src/scripts/model_maker.py
with
10 additions
and
7 deletions
src/scripts/model_maker.py
+
10
−
7
View file @
ed4141e2
...
...
@@ -378,6 +378,9 @@ def load_model(model_file):
rnd_engine
=
"
COMPACT
"
if
(
rnd_engine
==
"
COMPACT
"
):
check
=
random_compact
(
sconf
,
gconf
,
rnd_seed
,
max_rad
)
if
(
check
==
1
):
print
(
"
ERROR: compact random generator works only when all sphere types have the same radius.
"
)
return
(
None
,
None
)
elif
(
rnd_engine
==
"
LOOSE
"
):
check
=
random_aggregate
(
sconf
,
gconf
,
rnd_seed
,
max_rad
)
else
:
...
...
@@ -782,13 +785,13 @@ def random_compact(scatterer, geometry, seed, max_rad):
# mesh = pv.Sphere(radius / max_rad, (x, y, z))
# pl.add_mesh(mesh)
#pl.export_obj("scene.obj")
sph_index
=
0
for
sphere
in
sorted
(
vec_spheres
,
key
=
lambda
item
:
item
[
'
itype
'
]):
scatterer
[
'
vec_types
'
][
sph_index
]
=
sphere
[
'
itype
'
]
geometry
[
'
vec_sph_x
'
][
sph_index
]
=
sphere
[
'
x
'
]
geometry
[
'
vec_sph_y
'
][
sph_index
]
=
sphere
[
'
y
'
]
geometry
[
'
vec_sph_z
'
][
sph_index
]
=
sphere
[
'
z
'
]
sph_index
+=
1
sph_index
=
0
for
sphere
in
sorted
(
vec_spheres
,
key
=
lambda
item
:
item
[
'
itype
'
]):
scatterer
[
'
vec_types
'
][
sph_index
]
=
sphere
[
'
itype
'
]
geometry
[
'
vec_sph_x
'
][
sph_index
]
=
sphere
[
'
x
'
]
geometry
[
'
vec_sph_y
'
][
sph_index
]
=
sphere
[
'
y
'
]
geometry
[
'
vec_sph_z
'
][
sph_index
]
=
sphere
[
'
z
'
]
sph_index
+=
1
return
result
## \brief Write the geometry configuration dictionary to legacy format.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment