Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e0b0c5a
Starting to add polygonal clip tables.
BradWhitlock Oct 23, 2025
1807f60
Add some casts.
BradWhitlock Oct 23, 2025
d1610fe
Start of a MIR polygonal test.
BradWhitlock Oct 23, 2025
8a2c767
Added slots for polygon clip cases in ClipTableManager.
BradWhitlock Oct 23, 2025
8b627c5
Initial cut cases.
BradWhitlock Dec 3, 2025
e1332d6
Add polygonal support in ClipField.
BradWhitlock Dec 4, 2025
e523e40
printing improvement in ClipTableManager.
BradWhitlock Dec 4, 2025
5d2c397
Added specialization for polygonal unstructured.
BradWhitlock Dec 4, 2025
f7ad914
Added polygonal equiZ test.
BradWhitlock Dec 4, 2025
88cae27
Merge branch 'develop' into bugfix/whitlock/clipfield_mir_polygon_sup…
BradWhitlock Dec 4, 2025
9e80096
Updated RELEASE-NOTES.md
BradWhitlock Dec 4, 2025
74984e6
Improved type traits and polygonal support.
BradWhitlock Dec 5, 2025
b46f6da
Change ClipField to prefer polygonal over mixed for 2D shapes.
BradWhitlock Dec 5, 2025
55d7e7b
Initial draft of polygonal clip cases.
BradWhitlock Dec 5, 2025
4cf4e9a
Use traits more for Blueprint shape names.
BradWhitlock Dec 5, 2025
6156635
Only pass fields that are on the relevant topology in EquiZ so debug …
BradWhitlock Dec 6, 2025
5e222dc
Check MIR output in saveMesh.
BradWhitlock Dec 6, 2025
29440ae
Fixed polygon support issues.
BradWhitlock Dec 6, 2025
baa76a0
Improved polygonal clipping tables.
BradWhitlock Dec 6, 2025
b268654
Small change in equiz test.
BradWhitlock Dec 6, 2025
8b609c6
Updated data directory branch.
BradWhitlock Dec 6, 2025
2f789c0
make style
BradWhitlock Dec 6, 2025
fd163fb
Removed some files that would be in a different PR.
BradWhitlock Dec 6, 2025
3725bde
Added calls to save vis files in clipfield test. Updated one test.
BradWhitlock Dec 6, 2025
cc3c43d
Fixed a test after clip algorithm changes.
BradWhitlock Dec 6, 2025
519f2fd
Updated data dir
BradWhitlock Dec 6, 2025
15499f8
Merged develop into branch.
BradWhitlock Dec 6, 2025
f5a9cea
Moved some files.
BradWhitlock Dec 6, 2025
554d9b0
Renamed some files.
BradWhitlock Dec 6, 2025
0a93cae
make style
BradWhitlock Dec 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/
- Sina fortran `sina_write_document` now accepts a third argument that preserves records in memory so they can be written to another file (otherwise they're released from memory as soon as they're written)
- Primal: In Bezier and NURBS classes, accessors for arrays of control points, weights and knots
are now returned by (const) reference instead of returning a copy by value.
- The `axom::bump::clipping::ClipField` and `axom::mir::EquiZAlgorithm` classes were enhanced so they can clip polygons up to 8 sides.
- De-virtualized `axom::Array` methods to improve performance. This change may break code which
utilizes `axom::Array` or `sidre::Array/MCArray` in a polymorphic manner, for example by overriding
`Array::updateNumElements()` or `Array::dynamicRealloc()`.
Expand Down
4 changes: 4 additions & 0 deletions src/axom/bump/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ set(bump_headers

set(bump_sources
clipping/ClipCasesHex.cpp
clipping/ClipCasesPoly5.cpp
clipping/ClipCasesPoly6.cpp
clipping/ClipCasesPoly7.cpp
clipping/ClipCasesPoly8.cpp
clipping/ClipCasesPyr.cpp
clipping/ClipCasesQua.cpp
clipping/ClipCasesTet.cpp
Expand Down
15 changes: 7 additions & 8 deletions src/axom/bump/MergeMeshes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ class MergeMeshes
{
// Check the shape types.
std::map<std::string, int> shape_map = buildShapeMap(inputs);
if(shape_map.find("polyhedral") != shape_map.end())
if(shape_map.find(views::PolyhedronTraits::name()) != shape_map.end())
{
// At least one input was polyhedral. Force all polyhedral output.
mergeTopologiesPolyhedral(inputs, n_options, output);
Expand Down Expand Up @@ -516,18 +516,17 @@ class MergeMeshes

// If there are polygon shapes then assume that the rest of the shapes
// are 2D and should be promoted to polygons.
if(shape_map.find("polygonal") != shape_map.end() && shape_map.size() > 1)
if(shape_map.find(views::PolygonTraits::name()) != shape_map.end() && shape_map.size() > 1)
{
shape_map.clear();
shape_map["polygonal"] = axom::bump::views::shapeNameToID("polygonal");
shape_map[views::PolygonTraits::name()] = views::PolygonTraits::id();
}

conduit::Node *n_newTopoPtr = nullptr;
axom::IndexType connOffset = 0, sizesOffset = 0, shapesOffset = 0, coordOffset = 0;
for(axom::IndexType i = 0; i < n; i++)
{
const conduit::Node &n_srcTopo = getTopology(inputs[i]);

const std::string srcShape = n_srcTopo.fetch_existing("elements/shape").as_string();
const conduit::Node &n_srcConn = n_srcTopo.fetch_existing("elements/connectivity");
const conduit::Node &n_srcSizes = n_srcTopo.fetch_existing("elements/sizes");
Expand Down Expand Up @@ -703,28 +702,28 @@ class MergeMeshes
views::IndexNode_to_ArrayView(n_elem_conn, [&](auto connView) {
using ConnectivityType = typename decltype(connView)::value_type;

if(shape == "tet")
if(shape == views::TetTraits::name())
{
using TetShape = views::TetShape<ConnectivityType>;
auto topologyView =
views::make_unstructured_single_shape_topology<TetShape>::view(n_srcTopo);
makePolyhedralMesh(topologyView, n_srcTopo, n_phTopo);
}
else if(shape == "pyramid")
else if(shape == views::PyramidTraits::name())
{
using PyramidShape = views::PyramidShape<ConnectivityType>;
auto topologyView =
views::make_unstructured_single_shape_topology<PyramidShape>::view(n_srcTopo);
makePolyhedralMesh(topologyView, n_srcTopo, n_phTopo);
}
else if(shape == "wedge")
else if(shape == views::WedgeTraits::name())
{
using WedgeShape = views::WedgeShape<ConnectivityType>;
auto topologyView =
views::make_unstructured_single_shape_topology<WedgeShape>::view(n_srcTopo);
makePolyhedralMesh(topologyView, n_srcTopo, n_phTopo);
}
else if(shape == "hex")
else if(shape == views::HexTraits::name())
{
using HexShape = views::HexShape<ConnectivityType>;
auto topologyView =
Expand Down
15 changes: 12 additions & 3 deletions src/axom/bump/clipping/ClipCases.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// NOTE: The values for EA-EL and N0-N3 were reduced.
// NOTE: We're using AXOM_BUMP_EXPORT instead of VISIT_VTK_LIGHT_API throughout.
// NOTE: All #define were changed to constexpr variables to avoid symbol collisions.
// NOTE: We added ST_POLY5 through ST_POLY8.
// clang-format off

#include "axom/export/bump.h"
Expand Down Expand Up @@ -81,9 +82,13 @@ constexpr unsigned char ST_WDG = 102;
constexpr unsigned char ST_HEX = 103;
constexpr unsigned char ST_TRI = 104;
constexpr unsigned char ST_QUA = 105;
constexpr unsigned char ST_VTX = 106;
constexpr unsigned char ST_LIN = 107;
constexpr unsigned char ST_PNT = 108;
constexpr unsigned char ST_POLY5 = 106;
constexpr unsigned char ST_POLY6 = 107;
constexpr unsigned char ST_POLY7 = 108;
constexpr unsigned char ST_POLY8 = 109;
constexpr unsigned char ST_VTX = 110;
constexpr unsigned char ST_LIN = 111;
constexpr unsigned char ST_PNT = 112;

// Colors
constexpr unsigned char COLOR0 = 120;
Expand Down Expand Up @@ -168,6 +173,10 @@ constexpr unsigned char ST_MAX = (ST_PNT + 1);

extern AXOM_BUMP_EXPORT const size_t clipShapesTriSize;
extern AXOM_BUMP_EXPORT const size_t clipShapesQuaSize;
extern AXOM_BUMP_EXPORT const size_t clipShapesPoly5Size;
extern AXOM_BUMP_EXPORT const size_t clipShapesPoly6Size;
extern AXOM_BUMP_EXPORT const size_t clipShapesPoly7Size;
extern AXOM_BUMP_EXPORT const size_t clipShapesPoly8Size;
extern AXOM_BUMP_EXPORT const size_t clipShapesTetSize;
extern AXOM_BUMP_EXPORT const size_t clipShapesPyrSize;
extern AXOM_BUMP_EXPORT const size_t clipShapesWdgSize;
Expand Down
139 changes: 139 additions & 0 deletions src/axom/bump/clipping/ClipCasesPoly5.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
// Copyright (c) 2017-2025, Lawrence Livermore National Security, LLC and
// other Axom Project Developers. See the top-level LICENSE file for details.
//
// SPDX-License-Identifier: (BSD-3-Clause)
#include "ClipCases.h"

namespace axom
{
namespace bump
{
namespace clipping
{
namespace tables
{

int numClipCasesPoly5 = 32;

int numClipShapesPoly5[] = {1, 2, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 2, 3, 2, 2,
2, 2, 3, 2, 3, 3, 3, 2, 2, 2, 3, 2, 2, 2, 2, 1};

int startClipShapesPoly5[] = {0, 7, 20, 33, 46, 59, 78, 91, 104, 117, 136,
155, 174, 187, 206, 219, 232, 245, 258, 277, 290, 309,
328, 347, 360, 373, 386, 405, 418, 431, 444, 457};

// clang-format off
unsigned char clipShapesPoly5[] = {
// Case #0
ST_POLY5, COLOR0, P0, P1, P2, P3, P4,
// Case #1
ST_POLY6, COLOR0, EA, P1, P2, P3, P4, EE,
ST_TRI, COLOR1, P0, EA, EE,
// Case #2
ST_POLY6, COLOR0, P0, EA, EB, P2, P3, P4,
ST_TRI, COLOR1, EA, P1, EB,
// Case #3
ST_POLY5, COLOR0, EB, P2, P3, P4, EE,
ST_QUA, COLOR1, P0, P1, EB, EE,
// Case #4
ST_POLY6, COLOR0, P0, P1, EB, EC, P3, P4,
ST_TRI, COLOR1, EB, P2, EC,
// Case #5
ST_TRI, COLOR0, EA, P1, EB,
ST_QUA, COLOR0, EC, P3, P4, EE,
ST_POLY6, COLOR1, P0, EA, EB, P2, EC, EE,
// Case #6
ST_POLY5, COLOR0, P0, EA, EC, P3, P4,
ST_QUA, COLOR1, EA, P1, P2, EC,
// Case #7
ST_QUA, COLOR0, EC, P3, P4, EE,
ST_POLY5, COLOR1, P0, P1, P2, EC, EE,
// Case #8
ST_POLY6, COLOR0, P0, P1, P2, EC, ED, P4,
ST_TRI, COLOR1, EC, P3, ED,
// Case #9
ST_TRI, COLOR0, ED, P4, EE,
ST_QUA, COLOR0, EA, P1, P2, EC,
ST_POLY6, COLOR1, P0, EA, EC, P3, ED, EE,
// Case #10
ST_TRI, COLOR0, EB, P2, EC,
ST_QUA, COLOR0, P0, EA, ED, P4,
ST_POLY6, COLOR1, EA, P1, EB, EC, P3, ED,
// Case #11
ST_TRI, COLOR0, EB, P2, EC,
ST_TRI, COLOR0, ED, P4, EE,
ST_POLY7, COLOR1, P0, P1, EB, EC, P3, ED, EE,
// Case #12
ST_POLY5, COLOR0, P0, P1, EB, ED, P4,
ST_QUA, COLOR1, EB, P2, P3, ED,
// Case #13
ST_TRI, COLOR0, ED, P4, EE,
ST_TRI, COLOR0, EA, P1, EB,
ST_POLY7, COLOR1, P0, EA, EB, P2, P3, ED, EE,
// Case #14
ST_QUA, COLOR0, P0, EA, ED, P4,
ST_POLY5, COLOR1, EA, P1, P2, P3, ED,
// Case #15
ST_TRI, COLOR0, ED, P4, EE,
ST_POLY6, COLOR1, P0, P1, P2, P3, ED, EE,
// Case #16
ST_POLY6, COLOR0, P0, P1, P2, P3, ED, EE,
ST_TRI, COLOR1, ED, P4, EE,
// Case #17
ST_POLY5, COLOR0, EA, P1, P2, P3, ED,
ST_QUA, COLOR1, P0, EA, ED, P4,
// Case #18
ST_TRI, COLOR0, P0, EA, EE,
ST_QUA, COLOR0, EB, P2, P3, ED,
ST_POLY6, COLOR1, EA, P1, EB, ED, P4, EE,
// Case #19
ST_QUA, COLOR0, EB, P2, P3, ED,
ST_POLY5, COLOR1, P0, P1, EB, ED, P4,
// Case #20
ST_TRI, COLOR0, EC, P3, ED,
ST_QUA, COLOR0, P0, P1, EB, EE,
ST_POLY6, COLOR1, EB, P2, EC, ED, P4, EE,
// Case #21
ST_TRI, COLOR0, EA, P1, EB,
ST_TRI, COLOR0, EC, P3, ED,
ST_POLY7, COLOR1, P0, EA, EB, P2, EC, ED, P4,
// Case #22
ST_TRI, COLOR0, EC, P3, ED,
ST_TRI, COLOR0, P0, EA, EE,
ST_POLY7, COLOR1, EA, P1, P2, EC, ED, P4, EE,
// Case #23
ST_TRI, COLOR0, EC, P3, ED,
ST_POLY6, COLOR1, P0, P1, P2, EC, ED, P4,
// Case #24
ST_POLY5, COLOR0, P0, P1, P2, EC, EE,
ST_QUA, COLOR1, EC, P3, P4, EE,
// Case #25
ST_QUA, COLOR0, EA, P1, P2, EC,
ST_POLY5, COLOR1, P0, EA, EC, P3, P4,
// Case #26
ST_TRI, COLOR0, P0, EA, EE,
ST_TRI, COLOR0, EB, P2, EC,
ST_POLY7, COLOR1, EA, P1, EB, EC, P3, P4, EE,
// Case #27
ST_TRI, COLOR0, EB, P2, EC,
ST_POLY6, COLOR1, P0, P1, EB, EC, P3, P4,
// Case #28
ST_QUA, COLOR0, P0, P1, EB, EE,
ST_POLY5, COLOR1, EB, P2, P3, P4, EE,
// Case #29
ST_TRI, COLOR0, EA, P1, EB,
ST_POLY6, COLOR1, P0, EA, EB, P2, P3, P4,
// Case #30
ST_TRI, COLOR0, P0, EA, EE,
ST_POLY6, COLOR1, EA, P1, P2, P3, P4, EE,
// Case #31
ST_POLY5, COLOR1, P0, P1, P2, P3, P4
};
// clang-format on

const size_t clipShapesPoly5Size = sizeof(clipShapesPoly5) / sizeof(unsigned char);

} // namespace tables
} // namespace clipping
} // namespace bump
} // namespace axom
Loading