Skip to content

Commit 8f678a9

Browse files
authored
Merge pull request #1486 from LLNL/feature/kweiss/opencascade-example
Adds a quest example to process STEP files
2 parents 511ae0a + 99d3647 commit 8f678a9

File tree

12 files changed

+2264
-29
lines changed

12 files changed

+2264
-29
lines changed

RELEASE-NOTES.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/
2222
### Added
2323
- `sidre::View` holding array data may now be re-shaped. See `sidre::View::reshapeArray`.
2424
- Sina C++ library is now a component of Axom
25-
- Adds optional dependency on [Open CASCADE](https://dev.opencascade.org). The initial intention is
26-
to use Open CASCADE's file I/O capabilities in support of Quest applications.
25+
- Adds optional dependency on [Open Cascade](https://dev.opencascade.org). The initial intention is
26+
to use Open Cascade's file I/O capabilities in support of Quest applications.
2727
- Adds `primal::NURBSCurve` and `primal::NURBSPatch` classes, supported by `primal::KnotVector`.
28+
- Adds a Quest example that reads in a STEP file using Open Cascade and processes its geometry
2829

2930
### Changed
3031
- Importing Conduit array data into `sidre::View` now allocates destination
3132
data using the `View`'s parent's allocator ID, instead of always using
3233
host memory. This is consistent with the behavior of deep-copying data
3334
from Sidre.
3435
- ItemCollection and its child classes MapCollection, ListCollection, and IndexedCollection were moved from Sidre
35-
to core. The namespace prefix for these classes is now axom:: insteand of axom::sidre. The internal usage of
36+
to core. The namespace prefix for these classes is now `axom::` instead of `axom::sidre`. The internal usage of
3637
these types within Sidre Datastore and Group is unchanged.
3738

3839
### Deprecated
@@ -74,7 +75,7 @@ as well as support for 32-bit `Word`s in Slam's `BitSet` class.
7475
- Primal: Adds `Polygon::reverseOrientation()` to reverse orientation of
7576
a polygon in-place.
7677
- Adds `StaticArray`, a wrapper for `StackArray` with a size member variable.
77-
- Multidimenional `core::Array` supports column-major and arbitrary stride ordering,
78+
- Multidimensional `core::Array` supports column-major and arbitrary stride ordering,
7879
in addition to the default row-major ordering.
7980
- Adds new `PolygonArray` and `MAX_VERTS` template parameters to `primal::Polygon` for dynamic
8081
or static allocation.

scripts/vcpkg_ports/opencascade/vcpkg.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "opencascade",
33
"version": "7.8.0",
4-
"description": "Open CASCADE Technology (OCCT) is an open-source software development platform for 3D CAD, CAM, CAE.",
4+
"description": "Open Cascade Technology (OCCT) is an open-source software development platform for 3D CAD, CAM, CAE.",
55
"homepage": "https://github.com/Open-Cascade-SAS/OCCT",
66
"license": "LGPL-2.1-only",
77
"supports": "!xbox",

src/axom/primal/geometry/NURBSPatch.hpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "axom/primal/operators/squared_distance.hpp"
2828

2929
#include <ostream>
30+
#include "axom/fmt.hpp"
3031

3132
namespace axom
3233
{
@@ -329,7 +330,7 @@ class NURBSPatch
329330
*/
330331
NURBSPatch(const CoordsMat& pts, int deg_u, int deg_v) : m_controlPoints(pts)
331332
{
332-
auto pts_shape = pts.shape();
333+
const auto pts_shape = pts.shape();
333334

334335
SLIC_ASSERT(pts_shape[0] >= deg_u + 1 && pts_shape[1] >= deg_v + 1);
335336
SLIC_ASSERT(deg_u >= 0 && deg_v >= 0);
@@ -357,11 +358,11 @@ class NURBSPatch
357358
: m_controlPoints(pts)
358359
, m_weights(weights)
359360
{
360-
auto pts_shape = pts.shape();
361-
auto weights_shape = weights.shape();
361+
const auto pts_shape = pts.shape();
362362

363-
SLIC_ASSERT(pts_shape[0] >= deg_u + 1 && pts_shape[1] >= deg_v + 1);
364363
SLIC_ASSERT(deg_u >= 0 && deg_v >= 0);
364+
SLIC_ASSERT(pts_shape[0] >= deg_u + 1 && pts_shape[1] >= deg_v + 1);
365+
SLIC_ASSERT(pts_shape == weights.shape());
365366

366367
m_knotvec_u = KnotVectorType(pts_shape[0], deg_u);
367368
m_knotvec_v = KnotVectorType(pts_shape[1], deg_v);
@@ -2821,4 +2822,9 @@ std::ostream& operator<<(std::ostream& os, const NURBSPatch<T, NDIMS>& nPatch)
28212822
} // namespace primal
28222823
} // namespace axom
28232824

2825+
/// Overload to format a primal::NURBSPatch using fmt
2826+
template <typename T, int NDIMS>
2827+
struct axom::fmt::formatter<axom::primal::NURBSPatch<T, NDIMS>> : ostream_formatter
2828+
{ };
2829+
28242830
#endif // AXOM_PRIMAL_NURBSPATCH_HPP_

src/axom/primal/tests/primal_nurbs_patch.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,6 @@ TEST(primal_nurbspatch, knot_insertion)
710710
const int DIM = 3;
711711
using CoordType = double;
712712
using PointType = primal::Point<CoordType, DIM>;
713-
using VectorType = primal::Vector<CoordType, DIM>;
714713
using NURBSPatchType = primal::NURBSPatch<CoordType, DIM>;
715714

716715
const int npts_u = 5;
@@ -883,7 +882,6 @@ TEST(primal_nurbspatch, bezier_extraction)
883882
using CoordType = double;
884883
using PointType = primal::Point<CoordType, DIM>;
885884
using NURBSPatchType = primal::NURBSPatch<CoordType, DIM>;
886-
using BezierPatchType = primal::BezierPatch<CoordType, DIM>;
887885

888886
const int npts_u = 5;
889887
const int npts_v = 4;

src/axom/quest/examples/CMakeLists.txt

+11
Original file line numberDiff line numberDiff line change
@@ -571,3 +571,14 @@ if( MFEM_FOUND)
571571
FOLDER axom/quest/examples
572572
)
573573
endif()
574+
575+
576+
if(OPENCASCADE_FOUND)
577+
axom_add_executable(
578+
NAME quest_step_file_ex
579+
SOURCES quest_step_file.cpp
580+
OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY}
581+
DEPENDS_ON axom cli11 fmt opencascade
582+
FOLDER axom/quest/examples
583+
)
584+
endif()

0 commit comments

Comments
 (0)