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:
@@ -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
|
||||
|
Reference in New Issue
Block a user