Skip to main content
added 209 characters in body
Source Link
flinty
  • 25.9k
  • 2
  • 22
  • 92

To get the mesh you can extract the shape from plot and discretize it, then use RegionProduct to extrude along a 1D line. Note that there's a bug in RegionProduct where for meshes the line has to have machine precision numbers for the line coordinates. There is no easy way to do shadows unfortunately, so you'll have to make do with bog-standard diffuse lighting.

{a2, b2} = {1, 10};
plot = ParametricPlot[{x1 - 0.035 x1 x2, 
   0.0175 x1^2 + (1. + 0.0175 x2) x2}, {x1, -b2, b2}, {x2, -a2, a2}, 
  Frame -> False, Axes -> False, Mesh -> None, 
  BoundaryStyle -> {{RGBColor["#2980b9"], 
     Opacity[0.9]}, {RGBColor["#2980b9"]}}, 
  PlotStyle -> {{RGBColor["#2980b9"], 
     Opacity[0.4]}, {RGBColor["#2980b9"], Opacity[0.8]}}, 
  PlotRange -> All
  ]
mesh = DiscretizeGraphics@plot;
(* you need the N[...] because region code is a cruel joke *)
reg = RegionProduct[mesh, Line[{{0}, {N[5]}}]];
Graphics3D[{EdgeForm[None], Lighter[RGBColor["#2980b9"]], reg}, 
 Lighting -> "Neutral", Boxed -> False]

3d mesh

But if you need more fancy effects, you can always Export["mesh.obj", mesh] and throw it into Blender or any 3D software of your choosing:

render

To get the mesh you can extract the shape from plot and discretize it, then use RegionProduct to extrude along a 1D line. Note that there's a bug in RegionProduct where for meshes the line has to have machine precision numbers for the line coordinates. There is no easy way to do shadows unfortunately, so you'll have to make do with bog-standard diffuse lighting.

{a2, b2} = {1, 10};
plot = ParametricPlot[{x1 - 0.035 x1 x2, 
   0.0175 x1^2 + (1. + 0.0175 x2) x2}, {x1, -b2, b2}, {x2, -a2, a2}, 
  Frame -> False, Axes -> False, Mesh -> None, 
  BoundaryStyle -> {{RGBColor["#2980b9"], 
     Opacity[0.9]}, {RGBColor["#2980b9"]}}, 
  PlotStyle -> {{RGBColor["#2980b9"], 
     Opacity[0.4]}, {RGBColor["#2980b9"], Opacity[0.8]}}, 
  PlotRange -> All
  ]
mesh = DiscretizeGraphics@plot;
(* you need the N[...] because region code is a cruel joke *)
reg = RegionProduct[mesh, Line[{{0}, {N[5]}}]];
Graphics3D[{EdgeForm[None], Lighter[RGBColor["#2980b9"]], reg}, 
 Lighting -> "Neutral", Boxed -> False]

3d mesh

To get the mesh you can extract the shape from plot and discretize it, then use RegionProduct to extrude along a 1D line. Note that there's a bug in RegionProduct where for meshes the line has to have machine precision numbers for the line coordinates. There is no easy way to do shadows unfortunately, so you'll have to make do with bog-standard diffuse lighting.

{a2, b2} = {1, 10};
plot = ParametricPlot[{x1 - 0.035 x1 x2, 
   0.0175 x1^2 + (1. + 0.0175 x2) x2}, {x1, -b2, b2}, {x2, -a2, a2}, 
  Frame -> False, Axes -> False, Mesh -> None, 
  BoundaryStyle -> {{RGBColor["#2980b9"], 
     Opacity[0.9]}, {RGBColor["#2980b9"]}}, 
  PlotStyle -> {{RGBColor["#2980b9"], 
     Opacity[0.4]}, {RGBColor["#2980b9"], Opacity[0.8]}}, 
  PlotRange -> All
  ]
mesh = DiscretizeGraphics@plot;
(* you need the N[...] because region code is a cruel joke *)
reg = RegionProduct[mesh, Line[{{0}, {N[5]}}]];
Graphics3D[{EdgeForm[None], Lighter[RGBColor["#2980b9"]], reg}, 
 Lighting -> "Neutral", Boxed -> False]

3d mesh

But if you need more fancy effects, you can always Export["mesh.obj", mesh] and throw it into Blender or any 3D software of your choosing:

render

Source Link
flinty
  • 25.9k
  • 2
  • 22
  • 92

To get the mesh you can extract the shape from plot and discretize it, then use RegionProduct to extrude along a 1D line. Note that there's a bug in RegionProduct where for meshes the line has to have machine precision numbers for the line coordinates. There is no easy way to do shadows unfortunately, so you'll have to make do with bog-standard diffuse lighting.

{a2, b2} = {1, 10};
plot = ParametricPlot[{x1 - 0.035 x1 x2, 
   0.0175 x1^2 + (1. + 0.0175 x2) x2}, {x1, -b2, b2}, {x2, -a2, a2}, 
  Frame -> False, Axes -> False, Mesh -> None, 
  BoundaryStyle -> {{RGBColor["#2980b9"], 
     Opacity[0.9]}, {RGBColor["#2980b9"]}}, 
  PlotStyle -> {{RGBColor["#2980b9"], 
     Opacity[0.4]}, {RGBColor["#2980b9"], Opacity[0.8]}}, 
  PlotRange -> All
  ]
mesh = DiscretizeGraphics@plot;
(* you need the N[...] because region code is a cruel joke *)
reg = RegionProduct[mesh, Line[{{0}, {N[5]}}]];
Graphics3D[{EdgeForm[None], Lighter[RGBColor["#2980b9"]], reg}, 
 Lighting -> "Neutral", Boxed -> False]

3d mesh