diff --git a/process.jl b/process.jl index 09788bb..9d533a4 100644 --- a/process.jl +++ b/process.jl @@ -7,6 +7,11 @@ stl = load(raw"C:\Users\albig\Downloads\cubeblender.stl") # stl = load(raw"C:\Coding\stl_read\3DBenchy.stl") function get_mass_properties(triangles) + """ + Reference: + https://github.com/WoLpH/numpy-stl/blob/42b6c67324e13b8712af6730f77e5e9544ef63b0/stl/base.py#L362 + https://www.geometrictools.com/Documentation/PolyhedralMassProperties.pdf + """ x = reduce(hcat, [[v[1] for v in tri] for tri in triangles])' y = reduce(hcat, [[v[2] for v in tri] for tri in triangles])' z = reduce(hcat, [[v[3] for v in tri] for tri in triangles])'