diff --git a/Project.toml b/Project.toml index 2875b86..37fe2c0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,3 +1,8 @@ +name = "stlProcess" +uuid = "68914fc9-42cf-4b37-b06f-0b65edf9b8fa" +authors = ["Anson "] +version = "0.1.0" + [deps] BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" diff --git a/process.jl b/src/stlProcess.jl similarity index 91% rename from process.jl rename to src/stlProcess.jl index 9d533a4..22aa1cc 100644 --- a/process.jl +++ b/src/stlProcess.jl @@ -1,3 +1,5 @@ +module stlProcess + using MeshIO using FileIO @@ -7,11 +9,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 - """ + """ + 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])' @@ -73,3 +75,5 @@ cog inertia eigen(inertia) + +end # module