12
$\begingroup$

How to generate a Coronavirus 3D geometric model like this one:

https://urbanmilwaukee.com/wp-content/uploads/2020/02/1024px3D_medical_animation_coronavirus_structure-1024x576.jpg

Or this one:

https://img-new.cgtrader.com/items/2300416/cbf78a951d/coronavirus-covid-19-3d-model-obj-fbx-ma-3b.jpg

Attempt

Here is some related code:

Block[{ang = -0.9`, dia = 0.04`, ext = 2.4`, turn = 20, r = 0.42}, 
 spring = ParametricPlot3D[
     r*{(ext + Cos[(2 turn x)/(1 - ang)]) Cos[x], 
       Sin[(2 turn x)/(
        1 - ang)], (ext + Cos[(2 turn x)/(1 - ang)]) Sin[x]}, {x, 
      0, (1 - ang) \[Pi]}, 
     PlotStyle -> {Lighter[Yellow], Tube[dia]}][[1, 1]];
 ]

shell = RegionPlot3D[
    2 <= x^2 + y^2 + z^2 <= 3 && (y > -0.5), {x, -2, 2}, {y, -2, 
     2}, {z, -2, 2}, PlotStyle -> Red, Mesh -> None, 
    PlotPoints -> 100, PlotTheme -> "Minimal"][[1, 1]];

Graphics3D[{shell, spring}, Boxed -> False, Background -> Black]

enter image description here

For the spiral formulas I used the code from this demonstration by Sandor Kabai: "Helical Spring between Two Cylinders".

$\endgroup$
7
  • 2
    $\begingroup$ @Shredderroy Yes, to get Coronavirus 3D graphs I started by looking into "spiky" posts in MSE. (Like this one.) $\endgroup$ – Anton Antonov Apr 3 '20 at 15:37
  • 2
    $\begingroup$ This could be of some help: 119324 $\endgroup$ – exp ikr Apr 5 '20 at 15:04
  • 1
    $\begingroup$ @expikx Thanks, that is a great suggestion! $\endgroup$ – Anton Antonov Apr 6 '20 at 1:11
  • 2
    $\begingroup$ related, mathematica.stackexchange.com/q/74193/9490 $\endgroup$ – Jason B. Apr 12 '20 at 20:02
  • 1
    $\begingroup$ also you could try Import["https://www.dropbox.com/sh/uj2n1yjj301gl9j/AAAPg2L-\ EDrE3mcuMzRlSEiWa/Covid%2019.stl?dl=1", "STL"] but the resulting region is too large for the FE to do anything with. $\endgroup$ – Jason B. Apr 12 '20 at 20:05
8
+250
$\begingroup$

The problem of arranging four kinds of elements without intersection on a sphere has many solutions. I will indicate one of them. First, we will depict the entire sphere assuming that the elements are equally and their total number is 300:

p = SpherePoints[300];
p2 = Table[p[[2 i]], {i, 150}];
p1 = Table[p[[2 i - 1]], {i, 150}];
pS = Table[p2[[2 i]], {i, 75}]; pM = Table[p1[[2 i]], {i, 75}]; pE = 
 Table[p1[[2 i - 1]], {i, 75}];
pHE = Table[p2[[2 i - 1]], {i, 75}];
r1 = Sqrt[3]; r0 = Sqrt[2]; r2 = 
 r0 + 2.7 (Sqrt[3] - Sqrt[2]); dr = 0.04;

cylS = Table[{Pink, Cylinder[{r0 pS[[i]], r2 pS[[i]]}, dr]}, {i, 
    Length[pS]}];
sphS = {Pink, Sphere[r2 pS, 2 dr]};
cylE = Table[{Yellow, Cylinder[{r0 pE[[i]], r1 pE[[i]]}, dr/2]}, {i, 
    Length[pE]}];
sphE = {Yellow, Sphere[(r1 + 2 dr) pE, 2 dr]}; sphM = {Green, 
  Sphere[(r1 + 2 dr) pM, 2 dr]}; sphM1 = 
 Rotate[sphM, 5 dr/r1, {1, 1, 1}]; cylHE = 
 Table[{LightBlue, Cylinder[{r0 pHE[[i]], r1 pHE[[i]]}, dr]}, {i, 
   Length[pHE]}];
cylHEt = Table[{LightGreen, 
    Cylinder[{r1 pHE[[i]], (r1 + dr) pHE[[i]]}, 2 dr]}, {i, 
    Length[pHE]}];

Graphics3D[{{Red, Sphere[{0, 0, 0}, r1]}, cylS, sphS, cylE, sphE, 
  cylHE, cylHEt, sphM, sphM1}, Boxed -> False, Background -> Black, 
 Lighting -> "Neutral"]

Figure 1

Cross section with RNA and penetrating elements:

Block[{ang = -0.9`, dia = 0.04`, ext =2.4`, turn = 20, r = 0.42}, 
 spring = ParametricPlot3D[
     r*{(ext + Cos[(2 turn x)/(1 - ang)]) Cos[x], 
       Sin[(2 turn x)/(1 - ang)], (ext + 
          Cos[(2 turn x)/(1 - ang)]) Sin[x]}, {x, 0, (1 - ang) \[Pi]},
      PlotStyle -> {Lighter[Yellow], Tube[dia]}][[1, 1]];]

shell = RegionPlot3D[
    r0^2 <= x^2 + y^2 + z^2 <= r1^2 && (y > -0.5), {x, -2, 2}, {y, -2,
      2}, {z, -2, 2}, PlotStyle -> Red, Mesh -> None, 
    PlotPoints -> 100, PlotTheme -> "Minimal"][[1, 1]];

{Graphics3D[{shell, spring, cylS, sphS, cylE, sphE, cylHE, cylHEt, 
   sphM, sphM1}, Boxed -> False, Background -> Black, 
  PlotRange -> {All, {-.0, 2}, All}], 
 Graphics3D[{shell, spring, cylS, sphS, cylE, sphE, cylHE, cylHEt, 
   sphM, sphM1}, Boxed -> False, Background -> Black, 
  PlotRange -> {All, {-.5, 2}, All}]}

Figure2

$\endgroup$
5
  • $\begingroup$ Excellent, thank you! $\endgroup$ – Anton Antonov Apr 14 '20 at 1:19
  • $\begingroup$ @AntonAntonov You are welcome! $\endgroup$ – Alex Trounev Apr 14 '20 at 10:15
  • 1
    $\begingroup$ @AntonAntonov I am sorry, but spring is apparently your code. I just used it without changing. Also check code for broken expressions (now it is a problem of this forum). I fixed the code. Try again. $\endgroup$ – Alex Trounev Apr 14 '20 at 21:09
  • $\begingroup$ Just accepted this answer — I should have done that some time ago... $\endgroup$ – Anton Antonov Sep 26 '20 at 21:19
  • $\begingroup$ @AntonAntonov Thank you! Лучше поздно, чем никогда:) $\endgroup$ – Alex Trounev Sep 26 '20 at 21:34
10
$\begingroup$

enter image description here

One can also try to import 3D parts created by other people. If you search online you can probably find some sites. For instance, from here

https://3dprint.nih.gov/discover/coronavirus

you can get a model and combine it with your spiral (a bit resized):

obj=Import["https://wolfr.am/LNm1PWwN"];

spring=Block[{ang=-0.9`,dia=1,ext=2.4,turn=20,r=10},
ParametricPlot3D[r{
(ext+Cos[(2 turn x)/(1-ang)]) Cos[x],
Sin[(2 turn x)/(1-ang)]+.5,
(ext+Cos[(2 turn x)/(1-ang)]) Sin[x]},
{x,0,(1-ang) \[Pi]},PlotStyle->{Lighter[Yellow],Tube[dia]}]];

Show[{obj,spring},PlotRange->{{-50,50},{-10,50},{-50,50}},ImageSize->400{1,1}]
$\endgroup$
1
  • 1
    $\begingroup$ Thank you for your answer and the 3dprint link! $\endgroup$ – Anton Antonov Apr 14 '20 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.