Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. n1=8;n2=16;
  2. w8=Round[.78 Table[{Cos[2[Pi] k/n1],Sin[2[Pi] k/n1]},{k,0,n1-1}],.01];
  3. w16=Round[1 Table[{Cos[2[Pi] k/n2],Sin[2[Pi] k/n2]},{k,0,n2-1}],.01];
  4. n=12;
  5. y1=.267;
  6. x2=1/Sqrt[2];
  7. w=1.8;
  8. pts={{{w,w},{w,-w},{-w,-w},{-w,w}}};
  9.  
  10. frame=RegionPlot[{
  11. MeshRegion[{{w,w},{w,-w},{-w,-w},{-w,w}},Polygon[{1,2,3,4}]], (*green box *)
  12. ImplicitRegion[x^2+y^2<2.8,{x,y}], (*white, largest circle *)
  13. ImplicitRegion[Or@@(((x-#)^2+(y-#2)^2<.1)&@@@w16),{x,y}], (*yellow scallops*)
  14. ImplicitRegion[x^2+y^2<1,{x,y}],(*white circle *)
  15. ImplicitRegion[x^2+y^2<1.4,{x,y}],(*white disk*)
  16. ImplicitRegion[Or@@(((x-#)^2+(y-#2)^2<.15)&@@@w8),{x,y}],(*red scallops*)
  17. ImplicitRegion[x^2+y^2<1,{x,y}] , (*white disk *)
  18. ImplicitRegion[1.8 < x^2+y^2< 2.2,{x,y}] ,(*brown outer rim*)
  19. ImplicitRegion[2.5 < x^2+y^2< 2.8,{x,y}](*yellow outer rim*)},
  20. BoundaryStyle->Directive[Thickness[.005],Black],
  21. AspectRatio->1,
  22. PlotStyle->{
  23. Darker@Green,White,Yellow,White,White,
  24. Red,White,Brown,Yellow,Red,
  25. White,White,White,White,White,
  26. White,White,Red,Red,Darker@Blue,
  27. Darker@Blue,Darker@Blue,Darker@Blue,Darker@Blue,Darker@Blue,
  28. Red,Red,Darker@Blue,Red,Yellow,Red
  29. }];
  30.  
  31. Graphics[{White,Disk[{0,0},.99]}]
  32.  
  33. p1={-Cos[ArcTan[.267]],y1};
  34. p2={Cos[ArcTan[.267]],y1};
  35. p3={-Cos[ArcTan[.267]],-y1};
  36. p4={Cos[ArcTan[.267]],-y1};
  37. p5={-x2,(x2+y1)/2};
  38. p6={x2,(x2+y1)/2};
  39. p7={-x2,-(x2+y1)/2};
  40. p8={x2,-(x2+y1)/2};
  41. p9={0.5,-x2};
  42. p10={-0.5,-x2};
  43. p11={0.5,-x2};
  44. p12={-0.5,-x2};
  45. p13={a=-.34,b=-.12};
  46. p14={-a,b};
  47. p15={0.5,x2};
  48. p16={-0.5,x2};
  49.  
  50.  
  51. t1=MeshRegion[{{0,-1},p1,p2},Triangle[{1,2,3}]];
  52. t2=MeshRegion[{{0,1},p3,p4},Triangle[{1,3,2}]];
  53. t3=MeshRegion[{{0,-x2},p5,p6},Triangle[{1,3,2}]];
  54. t4=MeshRegion[{{0,x2},p7,p8},Triangle[{1,3,2}]];
  55. t5=MeshRegion[{{0,+y1},p9,p10},Triangle[{1,3,2}]];
  56. (*t6 is off *)
  57. t6=MeshRegion[{{0,p5[[2]]},p13,p14},Triangle[{1,3,2}]];
  58. t7=MeshRegion[{{0,p13[[2]]},p15,p16},Triangle[{1,3,2}]];
  59. t8=MeshRegion[{{0,p7[[2]]},{-.33,p1[[2]]-.12},{.33,p1[[2]]-.12}},Triangle[{1,3,2}]];
  60. t9=MeshRegion[{{0,p3[[2]]},{z=-.23,0.063},{-z,.063}},Triangle[{1,3,2}]];
  61.  
  62. innerds=RegionPlot[{
  63. t1,(*white *)
  64. t2,(*white *)
  65.  
  66. t3,(*white *)
  67. t4,(*white *)
  68. t5,(*white *)
  69. t6,(*white *)
  70. t7,(*white *)
  71.  
  72. t8,(*white *)
  73. t9,(*White*)
  74. RegionDifference[t1,RegionUnion[t5,t4,t2]],(*Blue*)
  75. RegionDifference[t4,RegionUnion[t1,t3,t5]],(*red*)
  76.  
  77. RegionDifference[t3,RegionUnion[t7,t4,t2]], (*blue*)
  78. RegionDifference[t2,RegionUnion[t1,t7,t3]], (*blue*)
  79.  
  80. RegionDifference[t5,t1], (*blue*)
  81. RegionDifference[t4,RegionUnion[t1,t7]], (*Blue *)
  82. RegionDifference[t7,t2],(*Blue*)
  83. RegionDifference[t3,RegionUnion[t1,t2]],(*Blue *)
  84. RegionDifference[t8,t2], (* blue *)
  85.  
  86. RegionDifference[t9,t5], (* red *)
  87. RegionDifference[t9,t6], (* red *)
  88. RegionIntersection[t4,RegionDifference[t6,t1]], (*blue*)
  89. RegionIntersection[t6,RegionDifference[t5,t8]], (* red *)
  90. RegionIntersection[t7,t9], (*yellow*)
  91. ImplicitRegion[x^2+y^2<= .001,{x,y}] (* smallest circle *) (* red *)},
  92. BoundaryStyle->Directive[Thickness[.005],Black],
  93. AspectRatio->1,
  94.  
  95. PlotStyle->{
  96. White,White,White,White,White,White,White,White,White,
  97. Blue,Red,
  98. Blue,Blue,Blue,Blue,Blue,Blue,Blue,
  99. Red,Red,Blue,Red,Yellow,Red}]
  100.  
  101. Show[
  102. frame,
  103. Graphics[{White,Disk[{0,0},.99]}],
  104. innerds]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement