Skip to content

Commit eeed649

Browse files
committed
Makes willCollide() take Mesh argument
1 parent e697835 commit eeed649

File tree

7 files changed

+13
-12
lines changed

7 files changed

+13
-12
lines changed

Diff for: build/root.build

+6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
cxx.std = latest
2+
# We don't have modules yet
3+
#cxx.std = experimental
24

35
using cxx
46

7+
# We don't have modules yet
8+
#assert $cxx.features.modules 'compiler does not support modules'
9+
510
hxx{*}: extension = h++
611
ixx{*}: extension = i++
712
txx{*}: extension = t++
813
cxx{*}: extension = c++
14+
mxx{*}: extension = m++
915

1016
# The test target for cross-testing (running tests under Wine, etc).
1117
#

Diff for: linc/linc.c++

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <linc/linc.h++>
22

3-
auto willCollide(Stl const &mesh, Pivots const &pivots,
3+
auto willCollide(Mesh const &mesh, Pivots const &pivots,
44
SI::milli_metre_t<double> const &layerHeight) -> bool {
55
(void)pivots;
66
(void)mesh;

Diff for: linc/linc.h++

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
#include <SI/length.h>
33

44
#include <linc/params.h++>
5-
#include <linc/stl.h++>
5+
#include <linc/mesh.h++>
66

7-
[[nodiscard]] bool willCollide(Stl const &, Pivots const &, Millimeter const &);
7+
[[nodiscard]] bool willCollide(Mesh const &, Pivots const &, Millimeter const &);

Diff for: linc/main.c++

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using namespace SI::literals;
1313
auto main(int argc, char *argv[]) -> int {
1414

1515
// Parse the arguments...
16-
if (not(std::set<int>{{3, 4}}.contains(argc))) {
16+
if (not(argc == 3 or argc == 4)) {
1717
std::cerr << "Usage:\n"
1818
<< *argv << " <3d-model> <params> [layer-height (mm)]\n";
1919
return 1;
@@ -25,11 +25,12 @@ auto main(int argc, char *argv[]) -> int {
2525
auto const layerHeight =
2626
Millimeter((argc > 3) ? std::stod(gsl::at(args, 3)) : 1.0);
2727

28-
Stl mesh{modelFileName};
29-
if (not mesh.m_initialized) {
28+
Stl const stl{modelFileName};
29+
if (not stl.m_initialized) {
3030
std::cerr << "Failed to load " << modelFileName << '\n';
3131
return 1;
3232
}
33+
Mesh const mesh{stl};
3334

3435
if (not validateParamsFile(paramsFileName)) {
3536
std::cerr << "Validation of " << paramsFileName << " failed\n";

Diff for: linc/mesh.c++

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
#include <linc/mesh.h++>
44

5-
using namespace mesh;
6-
75
Mesh::Mesh(Stl const &stl) {
86
// Save vertices
97
for (const auto &facet : stl.m_facets) {

Diff for: linc/mesh.h++

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <linc/mesh-types.h++>
88
#include <linc/stl.h++>
99

10-
namespace mesh {
1110
// Describing an edge by indexing into a sequence of vertices.
1211
// An edge must have exactly two endpoints.
1312
using EdgeByVertexIterators = std::array<std::set<Vertex>::iterator, 2>;
@@ -95,4 +94,3 @@ public:
9594

9695
Mesh(Stl const &stl);
9796
};
98-
} // namespace mesh

Diff for: linc/mesh.test.c++

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
#include <linc/mesh.h++>
66

7-
using namespace mesh;
8-
97
auto main() -> int {
108
try {
119
{

0 commit comments

Comments
 (0)