MCPcopy Create free account
hub / github.com/OpenWebCAD/node-occ / installFor

Function installFor

test/test_meshSolid.js:239–296  ·  view source on GitHub ↗
(makeShape)

Source from the content-addressed store, hash-verified

237 }
238
239 function installFor(makeShape) {
240
241 let shape2;
242 beforeEach(function () {
243 shape2 = makeShape();
244 });
245 function test_with(tol, angle) {
246 it(makeShape.name + " testing with parameter : deflection : " + tol + " angle :" + angle, function () {
247 const mesh1 = shape2.createMesh(tol, angle);
248 debugLog(" vertices = ", mesh1.vertices.length);
249 debugLog(" triangles = ", mesh1.triangles.length);
250 });
251 }
252 test_with(0.01, 0.5);
253 test_with(0.01, 5);
254 test_with(0.01, 10);
255
256 test_with(0.1, 0.5);
257 test_with(0.1, 1);
258 test_with(0.1, 5);
259 test_with(0.1, 10);
260 test_with(0.1, 20);
261
262 test_with(1, 0.5);
263 test_with(1, 1);
264 test_with(1, 5);
265 test_with(1, 10);
266 test_with(1, 20);
267
268 test_with(2, 0.5);
269 test_with(2, 1);
270 test_with(2, 5);
271 test_with(2, 10);
272 test_with(2, 20);
273
274 describe(makeShape.name + " : comparing JSON ", function () {
275
276 let shape2;
277 beforeEach(function () {
278 shape2 = makeUnitBox();
279 });
280 it("should create default JSON file with acceptable size", function () {
281 shape2.name = "shape2";
282 const obj1 = occ.buildSolidMesh(shape2);
283 debugLog("json json1", JSON.stringify(obj1, null, "\t"));
284 debugLog("json json1", JSON.stringify(obj1).length);
285
286 });
287 it("should create default JSON file with acceptable size", function () {
288 shape2.name = "shape2";
289 const obj2 = occ.buildSolidMeshNew(shape2);
290 debugLog("json json1", JSON.stringify(obj2, null, "\t"));
291 debugLog("json json2", JSON.stringify(obj2).length);
292
293 });
294 });
295
296 }

Callers 1

test_meshSolid.jsFile · 0.85

Calls 7

beforeEachFunction · 0.85
makeShapeFunction · 0.85
test_withFunction · 0.85
describeFunction · 0.85
makeUnitBoxFunction · 0.85
itFunction · 0.85
debugLogFunction · 0.70

Tested by

no test coverage detected