Skip to content
Snippets Groups Projects
Commit ea8639f5 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

add comments

parent 1516b417
No related branches found
No related tags found
1 merge request!2443Few comments to explain some points in the slicing algorithm
Pipeline #134000 passed
...@@ -143,7 +143,7 @@ SliceStack slicify(const MultiLayer& sample, bool useAvgMaterials) ...@@ -143,7 +143,7 @@ SliceStack slicify(const MultiLayer& sample, bool useAvgMaterials)
const ZLimits& particle_span = particle_spans[i]; const ZLimits& particle_span = particle_spans[i];
// if no slicing is needed, create single slice for the layer // if no slicing is needed, create single slice for the layer
if (!particle_span.isFinite()) { if (!particle_span.isFinite()) { // also if layer contains no particles
if (i == nLayers - 1) if (i == nLayers - 1)
tl = 0.0; tl = 0.0;
if (i == 0) if (i == 0)
...@@ -168,10 +168,11 @@ SliceStack slicify(const MultiLayer& sample, bool useAvgMaterials) ...@@ -168,10 +168,11 @@ SliceStack slicify(const MultiLayer& sample, bool useAvgMaterials)
} }
// middle or bottom layer // middle or bottom layer
else { else {
ASSERT(top <= 0);
if (top < 0) { if (top < 0) {
result.addSlice(-top, *material, roughness); result.addSlice(-top, *material, roughness);
result.addNSlices(nSlices, top - bottom, *material); result.addNSlices(nSlices, top - bottom, *material);
} else { } else { // top == 0
result.addNSlices(nSlices, top - bottom, *material, roughness); result.addNSlices(nSlices, top - bottom, *material, roughness);
} }
// middle layer // middle layer
......
...@@ -48,6 +48,8 @@ public: ...@@ -48,6 +48,8 @@ public:
SliceStack setBField(const R3& externalField); SliceStack setBField(const R3& externalField);
// the name "bottom roughness" refers to the normal top roughness of a slice, but from the point
// of view of the inverted stack used in the recurrence relation computation algorithm.
const LayerRoughness* bottomRoughness(size_t i_slice) const; const LayerRoughness* bottomRoughness(size_t i_slice) const;
RoughnessModel roughnessModel() const { return m_roughness_model; } RoughnessModel roughnessModel() const { return m_roughness_model; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment