TransWikia.com

Circle Packing in Cone Texture

Mathematica Asked on January 19, 2021

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.

enter image description here

enter image description here

enter image description here

So my goal is Macaroon Tower

enter image description here

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.

enter image description here

2 Answers

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]

enter image description here

Answered by cvgmt on January 19, 2021

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)])]]}]]

enter image description here

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}]

enter image description here

Answered by cvgmt on January 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP