Skip to content

Commit a5acafa

Browse files
refactor(solidcore): update build_part to use boundary primitive and enforce r=0 for SolidCore
1 parent 24a8def commit a5acafa

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

src/cablebuilder/solidcore.jl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,22 @@ end
3737
@inline function build_part(
3838
::Type{Target},
3939
::Type{SolidCore},
40-
cmp::Symbol,
41-
current_r::T,
40+
grp::Symbol,
41+
prev_bound::Circular{T}, # <-- Dispatches on the primitive
4242
payload::Tuple{M, C},
4343
) where {Target, T <: Real, M <: Material, C <: Circular}
4444

4545
mat, params = payload
4646

47-
current_r <= eps(T) ||
48-
throw(DomainError(current_r, "Topological violation: SolidCore must be at r=0."))
47+
prev_bound.r <= eps(T) ||
48+
throw(
49+
DomainError(
50+
prev_bound.r,
51+
"Topological violation: SolidCore must start at r=0.",
52+
),
53+
)
4954

50-
shape = SolidCore(current_r, params.r, params)
51-
52-
return Target(cmp, shape, mat)
55+
shape = SolidCore(prev_bound.r, params.r, params)
56+
return Target(grp, shape, mat)
5357
end
5458

0 commit comments

Comments
 (0)