using Test using stlProcess using FileIO using MeshIO using LinearAlgebra @testset "simple cube stl" begin """ inertia math: https://hepweb.ucsd.edu/ph110b/110b_notes/node26.html Cube is a standard cube with a length of 2 for each side. """ cube_path = raw"test_assets\cubeblender.stl" stl = load(cube_path) @testset "get_mass_properties" begin props = get_mass_properties(stl) @test props.volume == 8.0 @test all(props.center_of_gravity .== 0.0) @test all(eigvals(props.inertia) .≈ (5.0 + 1 / 3)) @testset "get_volume" begin @test get_volume(stl; scale=1) ≈ props.volume rtol = 0.01 @test get_volume(stl; scale=4) ≈ (4 * 2)^3 rtol = 0.01 end end end