EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
EBGeometry_SurfacePieces.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Robert Marskar <robert.marskar@sintef.no>
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
11#ifndef EBGEOMETRY_SURFACEPIECES_HPP
12#define EBGEOMETRY_SURFACEPIECES_HPP
13
14// Std includes
15#include <algorithm>
16#include <cstdint>
17#include <string>
18#include <utility>
19#include <vector>
20
21// Our includes
23#include "EBGeometry_Expr.hpp"
24#include "EBGeometry_Macros.hpp"
25#include "EBGeometry_Ray.hpp"
27
28namespace EBGeometry {
29
35template <class T>
64
80template <class TapeType>
81[[nodiscard]] EBGEOMETRY_HOST
82std::vector<SurfacePiece<ShapePrecision<TapeType>>>
83findSurfacePieces(const TapeType& a_tape, const uint32_t a_resolution = 64)
84{
86
87 std::vector<SurfacePiece<T>> pieces;
88
89 const BoundingVolumes::AABBT<T> box = a_tape.computeBoundingVolume();
90
91 const Vec3T<T> low = box.getLowCorner();
92 const Vec3T<T> high = box.getHighCorner();
93 const Vec3T<T> size = high - low;
94
95 if (!(size.length() > T(0)) || !(size.length() < Math::Limits<T>::max()) || a_resolution == 0U) {
96 return pieces;
97 }
98
99 // Past the box on both ends, so that every crossing is inside the interval.
100 const T margin = T(0.01) * size.length();
101
102 // The cell offset, irrational so that no ray lies in an axis-aligned face.
103 const T jitter = T(0.4142135623730950488);
104
105 for (int axis = 0; axis < 3; axis++) {
106 const int u = (axis + 1) % 3;
107 const int v = (axis + 2) % 3;
108
109 for (uint32_t i = 0; i < a_resolution; i++) {
110 for (uint32_t j = 0; j < a_resolution; j++) {
111 Vec3T<T> origin = low;
112
113 origin[axis] = low[axis] - margin;
114 origin[u] = low[u] + (T(i) + jitter) * size[u] / T(a_resolution);
115 origin[v] = low[v] + (T(j) + T(1) - jitter) * size[v] / T(a_resolution);
116
117 Vec3T<T> direction = Vec3T<T>::zeros();
118
119 direction[axis] = T(1);
120
121 const RayT<T> ray{origin, direction};
122 const T tMax = size[axis] + T(2) * margin;
123
124 T t = T(0);
125
126 for (uint32_t crossing = 0; crossing < 4096U; crossing++) {
127 const SurfaceHitT<T> change = a_tape.firstRegionChange(ray, t, tMax);
128
129 if (!change.m_hit.hit()) {
130 break;
131 }
132
133 // On past it: a marched crossing is placed short of the surface, within the march's tolerance.
134 t = change.m_hit.m_t + (change.m_hit.m_exact ? T(0) : T(4) * RayOptions<T>().m_tolerance * size.length());
135
136 // The piece the same whichever way it was crossed: the later region the owner, the normal pointing out of it.
137 SurfaceRef<T> surface = change.m_surface;
138 Vec3T<T> normal = change.m_hit.m_normal;
139
140 if (surface.m_ownerRegion < surface.m_neighborRegion) {
141 const uint32_t region = surface.m_ownerRegion;
142 const MaterialLabelId material = surface.m_ownerMaterial;
143
144 surface.m_ownerRegion = surface.m_neighborRegion;
145 surface.m_ownerMaterial = surface.m_neighborMaterial;
146 surface.m_neighborRegion = region;
147 surface.m_neighborMaterial = material;
148
149 // The crossing's normal points into the region entered, here the inside.
150 normal = -normal;
151 }
152
153 SurfacePiece<T>* known = nullptr;
154
155 for (SurfacePiece<T>& piece : pieces) {
156 const SurfaceRef<T>& other = piece.m_surface;
157
158 if (other.m_surface == surface.m_surface && other.m_ownerRegion == surface.m_ownerRegion &&
159 other.m_neighborRegion == surface.m_neighborRegion) {
160 known = &piece;
161
162 break;
163 }
164 }
165
166 if (known == nullptr) {
167 pieces.push_back(SurfacePiece<T>{surface, change.m_hit.m_point, normal, 0U, {}});
168
169 known = &pieces.back();
170 }
171
172 known->m_crossings++;
173
174 const auto at = std::lower_bound(known->m_parts.begin(), known->m_parts.end(), surface.m_part);
175
176 if (at == known->m_parts.end() || *at != surface.m_part) {
177 known->m_parts.insert(at, surface.m_part);
178 }
179 }
180 }
181 }
182 }
183
184 return pieces;
185}
186
192{
196 static constexpr uint32_t None = 0xFFFFFFFFU;
197
202 uint32_t m_node = None;
203
207 uint32_t m_firstSurface = 0;
208
212 uint32_t m_numSurfaces = 0;
213
218
222 std::string m_operation;
223};
224
234{
235public:
239 SurfaceInventory() = default;
240
246 template <class T>
248 explicit SurfaceInventory(const ExprIndex<T>& a_index)
249 {
250 for (uint32_t leaf = 0; leaf < a_index.getNumLeaves(); leaf++) {
251 m_leafParts.push_back(a_index.getNumPartsOfLeaf(leaf));
252 m_leafLabels.push_back(a_index.getSurfaceLabel(leaf));
253 m_leafPartLabels.push_back(a_index.getPartSurfaceLabels(leaf));
254 m_leafSides.push_back(a_index.getSidesOfLeaf(leaf));
255 }
256
257 for (uint32_t surface = 0; surface < a_index.getNumSurfaces(); surface++) {
258 m_surfaceLeaves.push_back(a_index.getLeafOfSurface(surface));
259 }
260
261 for (uint32_t region = 0; region < a_index.getNumRegions(); region++) {
262 m_regionMaterials.push_back(a_index.getMaterialOf(region));
263 }
264
265 for (uint32_t node = 0; node < a_index.getNumNodes(); node++) {
266 const typename ExprIndex<T>::Node& n = a_index.getNode(node);
267
268 m_nodes.push_back(NodeLevel{n.m_parent, n.m_firstSurface, n.m_numSurfaces, n.m_surfaceLabel, n.m_operation});
269 }
270
271 for (uint32_t leaf = 0; leaf < a_index.getNumLeaves(); leaf++) {
272 m_leafNodes.push_back(a_index.getLeafNode(leaf));
273 }
274 }
275
284 [[nodiscard]] EBGEOMETRY_HOST
285 std::vector<SurfaceLevel>
286 levelsOf(const uint32_t a_surface) const
287 {
288 std::vector<SurfaceLevel> levels;
289
290 if (m_nodes.empty()) {
291 return levels;
292 }
293
294 const uint32_t leafNode = m_leafNodes[this->getLeaf(a_surface)];
295
296 // One member of a collection is a level below the collection's node.
297 if (m_nodes[leafNode].m_numSurfaces > 1U) {
298 SurfaceLevel member;
299
300 member.m_firstSurface = a_surface;
301 member.m_numSurfaces = 1U;
302 member.m_operation = "Member";
303
304 levels.push_back(member);
305 }
306
307 for (uint32_t node = leafNode; node != SurfaceLevel::None; node = m_nodes[node].m_parent) {
308 const NodeLevel& n = m_nodes[node];
309
310 const bool same = !levels.empty() && levels.back().m_node != SurfaceLevel::None &&
311 levels.back().m_firstSurface == n.m_firstSurface &&
312 levels.back().m_numSurfaces == n.m_numSurfaces;
313
314 if (same) {
315 // The outermost node of those covering the same surfaces, with its label, or the inner one's.
316 SurfaceLevel& level = levels.back();
317
318 level.m_node = node;
319 level.m_operation = n.m_operation;
320 level.m_label = n.m_label.isNone() ? level.m_label : n.m_label;
321 }
322 else {
323 levels.push_back(SurfaceLevel{node, n.m_firstSurface, n.m_numSurfaces, n.m_label, n.m_operation});
324 }
325 }
326
327 return levels;
328 }
329
334 [[nodiscard]] EBGEOMETRY_HOST
335 uint32_t
336 getNumSurfaces() const noexcept
337 {
338 return static_cast<uint32_t>(m_surfaceLeaves.size());
339 }
340
346 [[nodiscard]] EBGEOMETRY_HOST
347 uint32_t
348 getLeaf(const uint32_t a_surface) const
349 {
350 EBGEOMETRY_REQUIRE(a_surface < m_surfaceLeaves.size(),
351 "SurfaceInventory: surface %u of %zu",
352 unsigned(a_surface),
353 m_surfaceLeaves.size());
354
355 return m_surfaceLeaves[a_surface];
356 }
357
363 [[nodiscard]] EBGEOMETRY_HOST
364 uint32_t
365 getNumParts(const uint32_t a_surface) const
366 {
367 return m_leafParts[this->getLeaf(a_surface)];
368 }
369
376 [[nodiscard]] EBGEOMETRY_HOST
378 getLabel(const uint32_t a_surface, const uint32_t a_part) const
379 {
380 const uint32_t leaf = this->getLeaf(a_surface);
381 const std::vector<SurfaceLabelId>& parts = m_leafPartLabels[leaf];
382
383 return (a_part < parts.size()) ? parts[a_part] : m_leafLabels[leaf];
384 }
385
391 [[nodiscard]] EBGEOMETRY_HOST
392 bool
393 hasPartLabels(const uint32_t a_surface) const
394 {
395 return !m_leafPartLabels[this->getLeaf(a_surface)].empty();
396 }
397
403 [[nodiscard]] EBGEOMETRY_HOST
404 const std::vector<std::pair<uint32_t, uint32_t>>&
405 getSides(const uint32_t a_surface) const
406 {
407 return m_leafSides[this->getLeaf(a_surface)];
408 }
409
415 [[nodiscard]] EBGEOMETRY_HOST
417 getMaterial(const uint32_t a_region) const noexcept
418 {
419 return (a_region < m_regionMaterials.size()) ? m_regionMaterials[a_region] : MaterialLabelId::none();
420 }
421
422private:
426 std::vector<uint32_t> m_surfaceLeaves;
427
431 std::vector<uint32_t> m_leafParts;
432
436 std::vector<SurfaceLabelId> m_leafLabels;
437
441 std::vector<std::vector<SurfaceLabelId>> m_leafPartLabels;
442
446 std::vector<std::vector<std::pair<uint32_t, uint32_t>>> m_leafSides;
447
451 std::vector<MaterialLabelId> m_regionMaterials;
452
456 struct NodeLevel
457 {
458 uint32_t m_parent;
459 uint32_t m_firstSurface;
460 uint32_t m_numSurfaces;
461 SurfaceLabelId m_label;
462 std::string m_operation;
463 };
464
468 std::vector<NodeLevel> m_nodes;
469
473 std::vector<uint32_t> m_leafNodes;
474};
475
480{
484 uint32_t m_surface = 0;
485
489 uint32_t m_ownerRegion = 0;
490
494 uint32_t m_neighborRegion = 0;
495};
496
504[[nodiscard]] EBGEOMETRY_HOST
505inline std::vector<PossiblePiece>
507{
508 std::vector<PossiblePiece> pieces;
509
510 for (uint32_t surface = 0; surface < a_inventory.getNumSurfaces(); surface++) {
511 for (const auto& [first, second] : a_inventory.getSides(surface)) {
512 pieces.push_back(PossiblePiece{surface, Math::max(first, second), Math::min(first, second)});
513 }
514 }
515
516 return pieces;
517}
518
522enum class Coverage : uint8_t
523{
524 None,
525 Partly,
526 Full
527};
528
545
559[[nodiscard]] EBGEOMETRY_HOST
560inline PieceCoverage
562 const SurfaceInventory& a_inventory,
563 const DomainSetup& a_setup,
564 const std::vector<uint32_t>& a_parts)
565{
566 bool partConditions = false;
567 bool labelConditions = false;
568
569 for (uint32_t i = 0; i < a_setup.getNumSelectors(); i++) {
570 partConditions = partConditions || a_setup.getSelector(i).m_part != SurfaceSelector::Any;
571 labelConditions = labelConditions || a_setup.getSelector(i).m_label != SurfaceSelector::Any;
572 }
573
574 const uint32_t parts = a_inventory.getNumParts(a_piece.m_surface);
575 const bool perPart =
576 parts > 1U && (partConditions || (labelConditions && a_inventory.hasPartLabels(a_piece.m_surface)));
577
578 // The selectors match surface references; their precision does not enter.
579 SurfaceRef<double> surface;
580
581 surface.m_surface = a_piece.m_surface;
582 surface.m_leaf = a_inventory.getLeaf(a_piece.m_surface);
583 surface.m_ownerRegion = a_piece.m_ownerRegion;
584 surface.m_neighborRegion = a_piece.m_neighborRegion;
585 surface.m_ownerMaterial = a_inventory.getMaterial(a_piece.m_ownerRegion);
586 surface.m_neighborMaterial = a_inventory.getMaterial(a_piece.m_neighborRegion);
587
588 // The parts checked: every part, or those listed (when they name any of the shape's). A piece findSurfacePieces()
589 // reports lists the parts its samples met, so for a shape with parts it names at least one; an empty or foreign list
590 // (the overload without parts) checks them all.
591 std::vector<uint32_t> checked;
592
593 if (perPart) {
594 for (const uint32_t part : a_parts) {
595 if (part < parts) {
596 checked.push_back(part);
597 }
598 }
599
600 if (checked.empty()) {
601 for (uint32_t part = 0; part < parts; part++) {
602 checked.push_back(part);
603 }
604 }
605 }
606 else {
607 checked.push_back(0U);
608 }
609
610 const uint32_t checks = static_cast<uint32_t>(checked.size());
611 uint32_t covered = 0;
612 uint32_t group = SurfaceGroups::None;
613 bool mixed = false;
614
615 for (const uint32_t part : checked) {
616 // A collection's member: a part no part condition matches.
617 // (The label's part is named before the call: clang-tidy 18's bugprone-argument-comment crashed on the conditional
618 // as an argument.)
619 const uint32_t labeled = (parts == 0U) ? 0U : part;
620
621 surface.m_part = (parts == 0U) ? SurfaceSelector::Any - 1U : part;
622 surface.m_surfaceLabel = a_inventory.getLabel(a_piece.m_surface, labeled);
623
624 const uint32_t g = a_setup.surfaceGroupOf(surface);
625
626 if (g != SurfaceGroups::None) {
627 mixed = mixed || (covered > 0U && g != group);
628 group = g;
629
630 covered++;
631 }
632 }
633
634 PieceCoverage coverage;
635
636 coverage.m_coverage = (covered == checks) ? Coverage::Full : (covered > 0U) ? Coverage::Partly : Coverage::None;
637 coverage.m_surfaceGroup = (coverage.m_coverage == Coverage::Full && !mixed) ? group : SurfaceGroups::None;
638
639 return coverage;
640}
641
654[[nodiscard]] EBGEOMETRY_HOST
655inline PieceCoverage
656coverageOf(const PossiblePiece& a_piece, const SurfaceInventory& a_inventory, const DomainSetup& a_setup)
657{
658 return coverageOf(a_piece, a_inventory, a_setup, std::vector<uint32_t>());
659}
660
661} // namespace EBGeometry
662
663#endif
DomainSetup: how a domain is made, as an editable value on the host (see Domain).
The tape's front end: Expr, a host-side value that describes a composed object, and the free function...
#define EBGEOMETRY_HOST
Mark a function as callable from host code only (no-op on host compilers).
Definition EBGeometry_GPU.hpp:83
Utility macros for EBGeometry.
#define EBGEOMETRY_REQUIRE(cond,...)
Always-on check of user input and one-time host setup.
Definition EBGeometry_Macros.hpp:200
Ray queries on any shape: where a ray, or the segment between two points, first crosses its surface (...
SurfaceRef: which surface of a shape decides its value at a point, and the container protocol that na...
Axis-aligned bounding box (AABB) enclosing a set of 3D points.
Definition EBGeometry_BoundingVolumes.hpp:37
Vec3T< T > & getLowCorner() noexcept
Get a modifiable reference to the low corner of the AABB.
Vec3T< T > & getHighCorner() noexcept
Get a modifiable reference to the high corner of the AABB.
How a domain is made: its subdomains (the regions each computes in) and its surface groups (the selec...
Definition EBGeometry_DomainSetup.hpp:39
uint32_t getNumSelectors() const noexcept
How many selectors there are, over all surface groups.
Definition EBGeometry_DomainSetup.hpp:290
const SurfaceSelector & getSelector(const uint32_t a_selector) const
A selector.
Definition EBGeometry_DomainSetup.hpp:302
uint32_t surfaceGroupOf(const SurfaceRef< T > &a_surface) const noexcept
The surface group a surface point is in (as SurfaceGroups::surfaceGroupOf()).
Definition EBGeometry_DomainSetup.hpp:328
The nodes of an expression, numbered, with the leaves below each and their labels: on the host,...
Definition EBGeometry_Expr.hpp:1058
MaterialLabelId getMaterialOf(uint32_t a_region) const
A region's material (see Region::m_material).
uint32_t getNumSurfaces() const noexcept
The number of surfaces: Tape::getNumSurfaces() of a tape compiled from the expression.
const std::vector< std::pair< uint32_t, uint32_t > > & getSidesOfLeaf(uint32_t a_leaf) const
The pairs of regions a leaf's surface may separate, conservatively: every pair it does is listed,...
uint32_t getNumPartsOfLeaf(uint32_t a_leaf) const
How many parts a leaf's shape has (see hasParts): one for a shape without parts, a mesh's faces,...
SurfaceLabelId getSurfaceLabel(uint32_t a_leaf) const
A leaf's label: that of the nearest labeled node on its path, the leaf's own included,...
uint32_t getLeafNode(uint32_t a_leaf) const
The node of a leaf.
uint32_t getLeafOfSurface(uint32_t a_surface) const
The leaf a surface belongs to: SurfaceRef::m_leaf of a tape's closestSurface() that reported it.
uint32_t getNumRegions() const noexcept
The number of regions: the background (region 0), and one per operand of the Overlays,...
const std::vector< SurfaceLabelId > & getPartSurfaceLabels(uint32_t a_leaf) const
The labels of a leaf's parts, one per part, as getPartSurfaceLabel() gives them; empty for a leaf who...
uint32_t getNumLeaves() const noexcept
The number of leaves: Tape::getNumPrimitives() of a tape compiled from the expression.
const Node & getNode(uint32_t a_node) const
A node.
uint32_t getNumNodes() const noexcept
The number of nodes.
static constexpr uint32_t None
No surface group: a surface no selector matches.
Definition EBGeometry_SurfaceGroups.hpp:301
What an expression's index says about its surfaces, kept for checking surface groups against them wit...
Definition EBGeometry_SurfacePieces.hpp:234
MaterialLabelId getMaterial(const uint32_t a_region) const noexcept
A region's material.
Definition EBGeometry_SurfacePieces.hpp:417
SurfaceInventory()=default
An empty inventory: no surfaces.
SurfaceInventory(const ExprIndex< T > &a_index)
The inventory of an expression's index.
Definition EBGeometry_SurfacePieces.hpp:248
bool hasPartLabels(const uint32_t a_surface) const
Whether a surface's parts have labels of their own (face groups).
Definition EBGeometry_SurfacePieces.hpp:393
uint32_t getNumParts(const uint32_t a_surface) const
How many parts a surface's shape has (ExprIndex::getNumPartsOfLeaf()): 0 for a collection's member.
Definition EBGeometry_SurfacePieces.hpp:365
std::vector< SurfaceLevel > levelsOf(const uint32_t a_surface) const
The levels a surface belongs to, innermost first: the surface (when it is one member of a collection,...
Definition EBGeometry_SurfacePieces.hpp:286
uint32_t getNumSurfaces() const noexcept
How many surfaces there are.
Definition EBGeometry_SurfacePieces.hpp:336
uint32_t getLeaf(const uint32_t a_surface) const
A surface's shape.
Definition EBGeometry_SurfacePieces.hpp:348
const std::vector< std::pair< uint32_t, uint32_t > > & getSides(const uint32_t a_surface) const
The pairs of regions a surface may separate, smaller region first.
Definition EBGeometry_SurfacePieces.hpp:405
SurfaceLabelId getLabel(const uint32_t a_surface, const uint32_t a_part) const
A part's surface label: its face group's, or its shape's.
Definition EBGeometry_SurfacePieces.hpp:378
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:258
T length() const noexcept
Compute vector length.
static constexpr Vec3T< T > zeros() noexcept
Return a vector with x = y = z = 0.
constexpr T max(const T &a_a, const T &a_b) noexcept
The larger of two values.
Definition EBGeometry_Math.hpp:61
constexpr T min(const T &a_a, const T &a_b) noexcept
The smaller of two values.
Definition EBGeometry_Math.hpp:44
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26
Coverage
How much of a piece a domain's surface groups hold.
Definition EBGeometry_SurfacePieces.hpp:523
@ None
No part of it.
@ Partly
Some parts, not all.
PieceCoverage coverageOf(const PossiblePiece &a_piece, const SurfaceInventory &a_inventory, const DomainSetup &a_setup, const std::vector< uint32_t > &a_parts)
How a domain's surface groups cover a piece an object may have, judged on the parts of it found (a Su...
Definition EBGeometry_SurfacePieces.hpp:561
typename ExprDetail::ShapeInfo< S >::precision ShapePrecision
The precision of a shape type: T for a shape whose box type is AABBT<T>.
Definition EBGeometry_Expr.hpp:176
Vec3T< T > normal(const F &a_function, const Vec3T< T > &a_point, const T &a_delta) noexcept
Outward unit normal of a function's level set, by central finite differences.
std::vector< SurfacePiece< ShapePrecision< TapeType > > > findSurfacePieces(const TapeType &a_tape, const uint32_t a_resolution=64)
The pieces of surface an object with regions has, as rays find them: every surface between every pair...
Definition EBGeometry_SurfacePieces.hpp:83
std::vector< PossiblePiece > possiblePieces(const SurfaceInventory &a_inventory)
Every piece of surface an object may have: each surface between each pair of regions its index says i...
Definition EBGeometry_SurfacePieces.hpp:506
@ None
As written: the tape evaluates every operand, however many there are.
One node of the expression.
Definition EBGeometry_Expr.hpp:1069
uint32_t m_numSurfaces
How many surfaces are below it: one per leaf, or a container leaf's own count (see hasSurfaces).
Definition EBGeometry_Expr.hpp:1093
uint32_t m_parent
The node it is an operand of; None for the root.
Definition EBGeometry_Expr.hpp:1073
SurfaceLabelId m_surfaceLabel
Its own surface label, or none (the label its leaves inherit from further up is getSurfaceLabel()'s).
Definition EBGeometry_Expr.hpp:1098
std::string m_operation
What it does: Primitive, Transform, Elongate, Repeat, Complement, Offset, Annulus,...
Definition EBGeometry_Expr.hpp:1110
uint32_t m_firstSurface
The first surface below it (see Tape::closestSurface()).
Definition EBGeometry_Expr.hpp:1088
constexpr bool isNone() const noexcept
Whether this is no label.
Definition EBGeometry_LabelId.hpp:85
static constexpr LabelId none() noexcept
No label.
Definition EBGeometry_LabelId.hpp:63
Numeric limits, with the meanings of the std::numeric_limits members of the same names.
Definition EBGeometry_Math.hpp:91
How surface groups cover a piece: how much of it they hold, and the surface group when one holds all ...
Definition EBGeometry_SurfacePieces.hpp:534
uint32_t m_surfaceGroup
The surface group holding all of it, or SurfaceGroups::None (none, or several).
Definition EBGeometry_SurfacePieces.hpp:543
Coverage m_coverage
How much.
Definition EBGeometry_SurfacePieces.hpp:538
A piece of surface an object may have: a surface between two regions, the later inside.
Definition EBGeometry_SurfacePieces.hpp:480
uint32_t m_ownerRegion
The later region.
Definition EBGeometry_SurfacePieces.hpp:489
uint32_t m_surface
The surface.
Definition EBGeometry_SurfacePieces.hpp:484
uint32_t m_neighborRegion
The earlier region.
Definition EBGeometry_SurfacePieces.hpp:494
How a query marches, where a shape has no ray form.
Definition EBGeometry_Ray.hpp:203
T m_tolerance
The march's tolerance, times the scale.
Definition EBGeometry_Ray.hpp:211
A ray: the points origin + t * direction.
Definition EBGeometry_Ray.hpp:56
A ray's first crossing of a shape's surface, with the surface it crossed, as firstSurface() reports i...
Definition EBGeometry_Ray.hpp:550
SurfaceRef< T > m_surface
The surface crossed, drilled down as closestSurface() does (its surface, leaf, label,...
Definition EBGeometry_Ray.hpp:560
HitT< T > m_hit
The crossing, as firstHit() reports it.
Definition EBGeometry_Ray.hpp:554
One level a surface belongs to (SurfaceInventory::levelsOf()): the surface itself,...
Definition EBGeometry_SurfacePieces.hpp:192
std::string m_operation
What it is: the node's operation (ExprIndex::Node::m_operation), or "Member" for one member of a coll...
Definition EBGeometry_SurfacePieces.hpp:222
SurfaceLabelId m_label
Its own surface label (SurfaceLabel() on the node, or on a node covering the same surfaces),...
Definition EBGeometry_SurfacePieces.hpp:217
uint32_t m_node
The node of the expression (ExprIndex numbering), the outermost of those covering the same surfaces; ...
Definition EBGeometry_SurfacePieces.hpp:202
static constexpr uint32_t None
No node.
Definition EBGeometry_SurfacePieces.hpp:196
uint32_t m_numSurfaces
How many surfaces it covers, from m_firstSurface.
Definition EBGeometry_SurfacePieces.hpp:212
uint32_t m_firstSurface
The first surface it covers.
Definition EBGeometry_SurfacePieces.hpp:207
One piece of an object's surface, as found: a shape's surface between two regions (see SurfaceSelecto...
Definition EBGeometry_SurfacePieces.hpp:37
Vec3T< T > m_normal
The normal there, pointing outside (into m_surface.m_neighborRegion).
Definition EBGeometry_SurfacePieces.hpp:52
uint32_t m_crossings
How many rays crossed it: a measure of its size.
Definition EBGeometry_SurfacePieces.hpp:57
std::vector< uint32_t > m_parts
The parts of it the rays crossed (a box's faces, a mesh's faces), sorted.
Definition EBGeometry_SurfacePieces.hpp:62
Vec3T< T > m_point
A point on it, where a ray crossed it first.
Definition EBGeometry_SurfacePieces.hpp:47
SurfaceRef< T > m_surface
The piece where it was first crossed: its surface, part and labels, and its two sides,...
Definition EBGeometry_SurfacePieces.hpp:42
The surface that decides a shape's value at a point, as closestSurface() reports it.
Definition EBGeometry_SurfaceRef.hpp:39
uint32_t m_ownerRegion
Set by a tape's region queries: the owner, the region the surface is reported from at the queried poi...
Definition EBGeometry_SurfaceRef.hpp:74
SurfaceLabelId m_surfaceLabel
Set by a tape: the surface's label, or none. A part labeled through face groups (SurfaceLabel(shape,...
Definition EBGeometry_SurfaceRef.hpp:59
uint32_t m_part
The part of the deepest shape reached, read from its own formula at the local point (see hasParts): a...
Definition EBGeometry_SurfaceRef.hpp:65
uint32_t m_leaf
Set by a tape: the leaf the surface belongs to, as Tape::closestLeaf() numbers it.
Definition EBGeometry_SurfaceRef.hpp:53
uint32_t m_neighborRegion
Set by a tape's region queries: the neighbor, the region across the surface from the owner at the que...
Definition EBGeometry_SurfaceRef.hpp:80
MaterialLabelId m_ownerMaterial
Set with the sides: the owner's material (m_ownerRegion's MaterialLabel()), or none.
Definition EBGeometry_SurfaceRef.hpp:85
uint32_t m_surface
The surface, numbered within the shape that was asked (across the scene when that is a tape).
Definition EBGeometry_SurfaceRef.hpp:48
MaterialLabelId m_neighborMaterial
Set with the sides: the neighbor's material (m_neighborRegion's), or none.
Definition EBGeometry_SurfaceRef.hpp:90
static constexpr uint32_t Any
An unset condition: matches anything.
Definition EBGeometry_SurfaceGroups.hpp:44
uint32_t m_label
The surface label (SurfaceRef::m_surfaceLabel), or Any.
Definition EBGeometry_SurfaceGroups.hpp:69
uint32_t m_part
The part (SurfaceRef::m_part), or Any.
Definition EBGeometry_SurfaceGroups.hpp:54