Skip to content

Commit b9b4d8b

Browse files
authored
Merge pull request #145 from JuliaPolyhedra/bl/planar_contour
🎨 Move recipe code in planar_contour
2 parents ba57497 + 9db9dd4 commit b9b4d8b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/recipe.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ function getsemihull(ps::Vector{PT}, sign_sense, counterclockwise, yray = nothin
2727
hull
2828
end
2929

30-
31-
@recipe function f(p::Polyhedron)
30+
function planar_contour(p::Polyhedron)
3231
if fulldim(p) != 2
3332
error("Plotting 3-dimensional polyhedron with Plots is not supported, use Makie, MeshCat or DrakeVisualizer")
3433
end
@@ -51,7 +50,11 @@ end
5150
end
5251
hull = [top; bot]
5352
push!(hull, hull[1]) # ensure shape is closed
53+
return [p[1] for p in hull], [p[2] for p in hull]
54+
end
55+
56+
@recipe function f(p::Polyhedron)
5457
seriestype --> :shape
5558
legend --> false
56-
[p[1] for p in hull], [p[2] for p in hull]
59+
planar_contour(p)
5760
end

0 commit comments

Comments
 (0)