Skip to content

Commit bd3f897

Browse files
committed
Define Base.length for Cylinders
1 parent 86fc11c commit bd3f897

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/primitives/cylinders.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ radius(c::Cylinder) = c.r
2121
height(c::Cylinder) = norm(c.extremity - c.origin)
2222
direction(c::Cylinder) = (c.extremity .- c.origin) ./ height(c)
2323

24+
Base.length(c::Cylinder) = LinearAlgebra.norm(extremity(c) - origin(c))
25+
2426
"""
2527
rotation(prim::GeometryPrimitive)
2628
rotation(direction::VecTypes{3})

0 commit comments

Comments
 (0)