This repository was archived by the owner on Feb 19, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathT_Data.cpp
More file actions
69 lines (63 loc) · 2.4 KB
/
T_Data.cpp
File metadata and controls
69 lines (63 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "gtest/gtest.h"
#include "T_Utils.h"
#include "LNData.h"
#include "LNObject.h"
#include <string>
TEST(Test_LNData, ExportSTEP)
{
std::vector<LNLib::LN_NurbsSurface> surfaces;
LNLib::LN_NurbsSurface surface1;
surface1.DegreeU = 2;
surface1.DegreeV = 2;
surface1.KnotVectorU = { 0, 0, 0, 1, 1, 1 };
surface1.KnotVectorV = { 0, 0, 0, 1, 1, 1 };
surface1.ControlPoints = {
{{0, 0, 0, 1}, {1, 0, 0, 1}, {2, 0, 0, 1}},
{{0, 1, 0, 1}, {1, 1, 0, 1}, {2, 1, 0, 1}},
{{0, 2, 0, 1}, {1, 2, 0, 1}, {2, 2, 0, 1}}
};
surfaces.push_back(surface1);
LNLib::LN_NurbsSurface surface2;
surface2.DegreeU = 3;
surface2.DegreeV = 3;
surface2.KnotVectorU = { 0, 0, 0, 0, 1, 1, 1, 1 };
surface2.KnotVectorV = { 0, 0, 0, 0, 1, 1, 1, 1 };
surface2.ControlPoints = {
{{3, 0, 0, 1}, {4, 0, 0, 1}, {5, 0, 0, 1}, {6, 0, 0, 1}},
{{3, 1, 0, 1}, {4, 1, 0, 2}, {5, 1, 0, 1}, {6, 1, 0, 1}},
{{3, 2, 0, 1}, {4, 2, 0, 1}, {5, 2, 0, 2}, {6, 2, 0, 1}},
{{3, 3, 0, 1}, {4, 3, 0, 1}, {5, 3, 0, 1}, {6, 3, 0, 1}}
};
surfaces.push_back(surface2);
std::string exportPath = LNTest::GetProgramDir() + "\\STEPTest.stp";
EXPECT_TRUE(LNLibEx::LNData::ToSTEPFile(surfaces, exportPath));
}
TEST(Test_LNData, ExportIGES)
{
std::vector<LNLib::LN_NurbsSurface> surfaces;
LNLib::LN_NurbsSurface surface1;
surface1.DegreeU = 2;
surface1.DegreeV = 2;
surface1.KnotVectorU = { 0, 0, 0, 1, 1, 1 };
surface1.KnotVectorV = { 0, 0, 0, 1, 1, 1 };
surface1.ControlPoints = {
{{0, 0, 0, 1}, {1, 0, 0, 1}, {2, 0, 0, 1}},
{{0, 1, 0, 1}, {1, 1, 0, 1}, {2, 1, 0, 1}},
{{0, 2, 0, 1}, {1, 2, 0, 1}, {2, 2, 0, 1}}
};
surfaces.push_back(surface1);
LNLib::LN_NurbsSurface surface2;
surface2.DegreeU = 3;
surface2.DegreeV = 3;
surface2.KnotVectorU = { 0, 0, 0, 0, 1, 1, 1, 1 };
surface2.KnotVectorV = { 0, 0, 0, 0, 1, 1, 1, 1 };
surface2.ControlPoints = {
{{3, 0, 0, 1}, {4, 0, 0, 1}, {5, 0, 0, 1}, {6, 0, 0, 1}},
{{3, 1, 0, 1}, {4, 1, 0, 2}, {5, 1, 0, 1}, {6, 1, 0, 1}},
{{3, 2, 0, 1}, {4, 2, 0, 1}, {5, 2, 0, 2}, {6, 2, 0, 1}},
{{3, 3, 0, 1}, {4, 3, 0, 1}, {5, 3, 0, 1}, {6, 3, 0, 1}}
};
surfaces.push_back(surface2);
std::string exportPath = LNTest::GetProgramDir() + "\\IGESTest.igs";
EXPECT_TRUE(LNLibEx::LNData::ToIGESFile(surfaces, exportPath));
}