1
0
mirror of https://gitlab.com/MisterBiggs/stl-process.git synced 2025-08-05 13:01:23 +00:00

added function to find desired scale

This commit is contained in:
2022-04-02 12:17:45 -07:00
parent 2fd254e08d
commit a14208245d
4 changed files with 44 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ module stlProcess
using MeshIO
using FileIO
using Roots
struct Properties
volume::Float64
@@ -104,6 +105,10 @@ function fast_volume(triangles; scale=1)
return volume
end
export get_mass_properties, fast_volume
function find_scale(trianges; desired_volume=1)
return find_zero(scale -> fast_volume(trianges; scale=scale) - desired_volume, 2.0)
end
export get_mass_properties, fast_volume, find_scale
end # module