Skip to content
Prev Previous commit
Next Next commit
bad case
  • Loading branch information
Moelf committed Sep 22, 2022
commit eafe81e0c735a4c6c7daa0d7a3937e074638613e
2 changes: 2 additions & 0 deletions src/Distance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ function distanceToIn(shape, point, dir)
distanceToIn_booleansubtraction(shape, point, dir)
elseif shape isa BooleanIntersection
distanceToIn_booleanintersection(shape, point, dir)
elseif shape isa PlacedVolume
distanceToIn_placedvolume(shape, point, dir)
end
end
function distanceToOut(shape, point, dir)
Expand Down
3 changes: 3 additions & 0 deletions src/DistanceIn.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
function distanceToIn_placedvolume(pvol::PlacedVolume{T}, p::Point3{T}, d::Vector3{T})::T where T<:AbstractFloat
distanceToIn(pvol.volume.shape, pvol.transformation * p, pvol.transformation * d)
end
## Boolean
function distanceToIn_booleanunion(shape::BooleanUnion{T, SL, SR}, point::Point3{T}, dir::Vector3{T})::T where {T,SL,SR}
(; left, right, transformation) = shape
Expand Down
3 changes: 0 additions & 3 deletions src/Volume.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ end
function contains(vol::Volume{T}, p::Point3{T})::Bool where T<:AbstractFloat
inside(vol.shape, p) == kInside
end
function distanceToIn(pvol::PlacedVolume{T}, p::Point3{T}, d::Vector3{T})::T where T<:AbstractFloat
distanceToIn(pvol.volume.shape, pvol.transformation * p, pvol.transformation * d)
end


function placeDaughter!(volume::Volume{T}, placement::Transformation3D{T}, subvol::Volume{T}) where T<:AbstractFloat
Expand Down