Skip to content

Commit 8ef1da0

Browse files
committed
Add flag to bypass trim_to_limits
1 parent c76516f commit 8ef1da0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Algoim.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ function fill_cpp_data_raw(phi,partition,xmin,xmax,degree,::Val{3})
173173
coords
174174
end
175175

176-
fill_cpp_data(phi::AlgoimCallLevelSetFunction,partition::D,xmin::V,xmax::V,degree::Int=2,limitstol::Float64=1.0e-8) where {D,V} =
177-
fill_cpp_data(phi,partition,xmin,xmax,degree,limitstol,Val{length(xmin)}())
176+
fill_cpp_data(phi::AlgoimCallLevelSetFunction,partition::D,xmin::V,xmax::V,degree::Int=2,trim::Bool=false,limitstol::Float64=1.0e-8) where {D,V} =
177+
fill_cpp_data(phi,partition,xmin,xmax,degree,trim,limitstol,Val{length(xmin)}())
178178

179179
function trim_to_limits!(coords::Matrix{T},xmin,xmax,limitstol) where {T<:Number}
180180
map(eachcol(coords)) do cd
@@ -188,19 +188,19 @@ function trim_to_limits!(coords::Matrix{T},xmin,xmax,limitstol) where {T<:Number
188188
end
189189
end
190190

191-
function fill_cpp_data(phi,partition,xmin,xmax,degree,limitstol,::Val{2})
191+
function fill_cpp_data(phi,partition,xmin,xmax,degree,trim,limitstol,::Val{2})
192192
coords = fill_cpp_data_raw(phi,partition,xmin,xmax,degree,Val{2}())
193193
np = (partition[1]+1)*(partition[2]+1)
194194
coords = reshape(coords,(2,np))
195-
trim_to_limits!(coords,xmin,xmax,limitstol)
195+
trim && trim_to_limits!(coords,xmin,xmax,limitstol)
196196
typeof(xmin)[eachcol(coords)...]
197197
end
198198

199-
function fill_cpp_data(phi,partition,xmin,xmax,degree,limitstol,::Val{3})
199+
function fill_cpp_data(phi,partition,xmin,xmax,degree,trim,limitstol,::Val{3})
200200
coords = fill_cpp_data_raw(phi,partition,xmin,xmax,degree,Val{3}())
201201
np = (partition[1]+1)*(partition[2]+1)*(partition[3]+1)
202202
coords = reshape(coords,(3,np))
203-
trim_to_limits!(coords,xmin,xmax,limitstol)
203+
trim && trim_to_limits!(coords,xmin,xmax,limitstol)
204204
typeof(xmin)[eachcol(coords)...]
205205
end
206206

0 commit comments

Comments
 (0)