Skip to content

Commit 25f1920

Browse files
committed
Style fixes and some exports
1 parent 4ea0519 commit 25f1920

File tree

3 files changed

+27
-14
lines changed

3 files changed

+27
-14
lines changed

src/solidmodels/render.jl

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -940,38 +940,41 @@ function gmsh_meshsize(
940940
# points. KDTree appears to use more memory, but can be significantly faster, especially
941941
# for highly repetitive geometries.
942942
if true
943-
l1 = Inf64
943+
l = Inf64
944944
# Explicit type tag here to remove hypothetical type instability.
945945
for ((h, α), tree) in SolidModels.MESHSIZE_PARAMS[:ct]::Dict{
946946
Tuple{Float64, Float64},
947947
KDTree{SVector{3, Float64}, Euclidean, Float64, SVector{3, Float64}}
948948
}
949949

950950
_, d::Float64 = nn(tree, SVector{3}(x, y, z))
951-
l1 = min(
952-
l1,
951+
l = min(
952+
l,
953953
h * max(SolidModels.MESHSIZE_PARAMS[:mesh_scale]::Float64, (d/h)^α)
954954
)::Float64
955955
end
956-
return l1
956+
return l
957957
else
958-
l2 = Inf64
958+
l = Inf64
959959
# Explicit type tag here to remove hypothetical type instability.
960960
for ((h, α), vs) in SolidModels.MESHSIZE_PARAMS[:cp]::Dict{
961961
Tuple{Float64, Float64},
962962
Vector{SVector{3, Float64}}
963963
}
964964

965-
α_local = α < 0 ? SolidModels.MESHSIZE_PARAMS[:alpha_default] : α
965+
local_α = α < 0 ? SolidModels.MESHSIZE_PARAMS[:global_α] : α
966966
for v in vs
967967
d = sqrt((x - v[1])^2 + (y - v[2])^2 + (z - v[3])^2)
968-
l2 = min(
969-
l2,
970-
h * max(SolidModels.MESHSIZE_PARAMS[:mesh_scale]::Float64, (d/h)^α)
968+
l = min(
969+
l,
970+
h * max(
971+
SolidModels.MESHSIZE_PARAMS[:mesh_scale]::Float64,
972+
(d/h)^local_α
973+
)
971974
)
972975
end
973976
end
974-
return l2
977+
return l
975978
end
976979
end
977980

src/solidmodels/solidmodels.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ const MESHSIZE_PARAMS = Dict{
2020
}
2121
}()
2222
export MESHSIZE_PARAMS
23+
export mesh_order,
24+
mesh_scale,
25+
mesh_grading_default,
26+
add_mesh_size_point,
27+
set_gmsh_option,
28+
finalize_size_fields!,
29+
mesh_control_points,
30+
mesh_control_trees,
31+
clear_mesh_control_points!,
32+
reset_mesh_control!
2333

2434
import DeviceLayout
2535
import DeviceLayout:

src/styles.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ mesh size = h * max(s_g, (d/h)^α)
158158
```
159159
160160
where d is the distance away from the styled entity, and `s_g` is the global mesh scale
161-
parameter specified in [`mesh_scale`](@ref). A smaller value of `h` will give a finer mesh
161+
parameter specified in [`SolidModels.mesh_scale`](@ref). A smaller value of `h` will give a finer mesh
162162
attached to the styled entity, and a larger value of `α` will give a more rapid increase in
163163
size away from the styled entity.
164164
165-
If `α < 0`, the size field will use [`mesh_grading_default`](@ref) used in rendering.
165+
If `α < 0`, the size field will use [`SolidModels.mesh_grading_default`](@ref) used in rendering.
166166
167167
See also [`meshsized_entity`](@ref).
168168
"""
@@ -183,11 +183,11 @@ mesh size = h * max(s_g, (d/h)^α)
183183
```
184184
185185
where d is the distance away from the styled entity, and `s_g` is the global mesh scale
186-
parameter specified in [`mesh_scale`](@ref). A smaller value of `h` will give a finer mesh
186+
parameter specified in [`SolidModels.mesh_scale`](@ref). A smaller value of `h` will give a finer mesh
187187
attached to the styled entity, and a larger value of `α` will give a more rapid increase in
188188
size away from the styled entity.
189189
190-
If `α < 0`, the size field will use [`mesh_grading_default`](@ref) used in rendering.
190+
If `α < 0`, the size field will use [`SolidModels.mesh_grading_default`](@ref) used in rendering.
191191
"""
192192
meshsized_entity(ent::GeometryEntity, h::T, α::S=-1.0) where {T, S <: Real} =
193193
MeshSized(h, α)(ent)

0 commit comments

Comments
 (0)