mirror of
https://gitlab.com/MisterBiggs/stl-process.git
synced 2025-08-03 12:01:33 +00:00
pgk-ify
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
name = "stlProcess"
|
||||
uuid = "68914fc9-42cf-4b37-b06f-0b65edf9b8fa"
|
||||
authors = ["Anson <anson@ansonbiggs.com>"]
|
||||
version = "0.1.0"
|
||||
|
||||
[deps]
|
||||
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
|
||||
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
|
||||
|
@@ -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
|
Reference in New Issue
Block a user