MCPcopy Create free account
hub / github.com/BIMCoderLiang/LNLib / TEST

Function TEST

tests/T_AdvancedGeometric.cpp:13–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11using namespace LNLib;
12
13TEST(Test_AdvancedGeometric, Curve_GetParamOrGetPoint)
14{
15 int degree = 2;
16 std::vector<double> kv = { 0,0,0,1,2,3,3,3 };
17 std::vector<XYZW> cps = { XYZW(XYZ(0,0,0),1), XYZW(XYZ(1,1,0),4), XYZW(XYZ(3,2,0),1), XYZW(XYZ(4,1,0),1), XYZW(XYZ(5,-1,0),1) };
18
19 LN_NurbsCurve curve;
20 curve.Degree = degree;
21 curve.KnotVector = kv;
22 curve.ControlPoints = cps;
23
24 XYZ result = NurbsCurve::GetPointOnCurve(curve, 1.0);
25 double param = NurbsCurve::GetParamOnCurve(curve, result);
26 EXPECT_TRUE(MathUtils::IsAlmostEqualTo(1.0, param));
27}
28
29TEST(Test_AdvancedGeometric, Surface_GetParamOrGetPoint)
30{

Callers

nothing calls this directly

Calls 7

GetPointOnCurveFunction · 0.85
GetPointOnSurfaceFunction · 0.85
XYZWClass · 0.50
XYZClass · 0.50
UVClass · 0.50
IsAlmostEqualToMethod · 0.45
GetWMethod · 0.45

Tested by

no test coverage detected