# Circle Packing in Cone Texture

This is a cone with texture generated by PatternFilling in plane.

The problem this texture mapping is not conformal.

So my question is how to generated a pattern image which could suit a fixed height cone.

So my goal is Macaroon Tower

First goal is texture level, we just generate a suitable texture with mathematica or any other softwares or methods.

Second goal is Model Level, maybe another question.

I found two ways to do this. Here only post one of them since the other one need more time to modify. I will post the other one before Christmas Eve.

All of this use the isometry between cone and sector.

The key is : Both of TextureCoordinateFunction and MeshFunctions are using Polar Coordinate {ρ*Cos[θ], ρ*Sin[θ]}.( It took me three days to find out this)

g = Graphics[{Red, Disk[{0, 0}, 1]}, PlotRangePadding -> 0];
R = 8;
α = 0.05 π;(* 0< 2α < π *)

f[ρ_, θ_] := {
ρ*Sin[α] Cos[θ/Sin[α]],
ρ*Sin[α] Sin[θ/Sin[α]],
ρ*Cos[α]
};
ParametricPlot3D[
f[ρ, θ], {ρ, -R, 0}, {θ, 0,
2 π*Sin[α]}, Mesh -> None, PlotStyle -> Texture[g],
TextureCoordinateScaling -> False,
TextureCoordinateFunction ->
Function[{x, y,
z, ρ, θ}, {ρ*Cos[θ], ρ*Sin[θ]}],
PlotPoints -> 50, ViewPoint -> {1, 1, 1},
AspectRatio -> Automatic, ViewProjection -> "Orthographic",
Boxed -> False, Axes -> False]


• +1. Very cool. (I would have shown, or mentioned, the backside. Unless there's a known solution to circle packing on a cone, I expect this will be hard.)( Dec 17, 2020 at 14:04
• @MichaelE2 Thanks! The other way is use MeshFunctions -> Function[{x, y, z, ρ, θ},Norm[ρ {Cos[θ], Sin[θ]} - ρ0 {Cos[θ0], Sin[θ0]}] - .4] , I will explain the methods later. Dec 17, 2020 at 14:11
• Wow, exciting. Let me play with it. If you have time, you can also play the question of Model Level. In that situation, the circles should be plane disks. Something are slight different in packing. My question was just originated by Christmas Tree. I was using RegionPoints to generating Tree, meanwhile I recall this old idea. Dec 18, 2020 at 7:56

Sorry for too late to modify the another code. The idea is draw some circle or semicircle in the sector using polar coordinate.

R = 10.5;
α = 0.05 π;(* 0< 2α < π *)
r = 0.5;
ϕ = 2 π*Sin[α];
draw2d[k_, θ0_] :=
With[{ρ0 = 2 k*r},
ParametricPlot[{ρ*Cos[θ], ρ*
Sin[θ]}, {ρ, 0, R}, {θ, 0,
2 π*Sin[α]},
MeshFunctions ->
Function[{x, y, ρ, θ},
Norm[ρ {Cos[θ],
Sin[θ]} - ρ0 {Cos[θ0], Sin[θ0]}] -
r], Mesh -> {{0}}, MeshShading -> {Red, None},
PlotPoints -> 80]];
Show[draw2d[0, 0],
Table[draw2d[k, θ0], {k, 1, Floor[R]}, {θ0,
Subdivide[0, ϕ, Round[ϕ/(2 ArcSin[1/(2 k)])]]}]]


And then use the isometry between sector and cone by this maps.

f[ρ_, θ_] = {ρ*Sin[α] Cos[θ/Sin[α]], ρ*Sin[α] Sin[θ/Sin[α]], ρ*Cos[α]};


After that we can lift the 2D to 3D.

R = 11.5;
α = 0.05 π;(*0<2α<π*)r = 0.5;
ϕ = 2 π*Sin[α];
f[ρ_, θ_] = {ρ*
Sin[α] Cos[θ/Sin[α]], ρ*
Sin[α] Sin[θ/Sin[α]], ρ*Cos[α]};
colors = {Pink, CMYKColor[4/100, 7/100, 19/100, 0]};
draw3d[k_, θ0_] :=
With[{ρ0 = 2 k*r},
ParametricPlot3D[
f[ρ, θ], {ρ, 0, R}, {θ, 0,
2 π*Sin[α]},
MeshFunctions ->
Function[{x, y, z, ρ, θ},
Norm[ρ {Cos[θ],
Sin[θ]} - ρ0 {Cos[θ0],
Sin[θ0]}] - r], Mesh -> {{0}},
MeshShading -> {colors[[Mod[k, 2, 1]]], None},
PlotPoints -> 80]];
Show[draw3d[0, 0],
Table[draw3d[k, θ0], {k, 1, Floor[R]}, {θ0,
Subdivide[0, ϕ, Round[ϕ/(2 ArcSin[1/(2 k)])]]}],
Boxed -> False, Axes -> False, ViewPoint -> {-2.39, 1.72, -1.64},
ViewVertical -> {-0.31, 0.18, -0.93}]